From 005c6bafa1904e46805d2e34bde01d01ca406bf7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 17 Jan 2025 18:58:52 +0000 Subject: [PATCH 1/2] feat: Reasoning Engine v1 GAPIC release PiperOrigin-RevId: 716685354 Source-Link: https://github.com/googleapis/googleapis/commit/fcfee53bf9759978b448604ffe610f5418dc05a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/51208a31b04f8969b724703a952126539193aafe Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWFpX3BsYXRmb3JtLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI1MTIwOGEzMWIwNGY4OTY5YjcyNDcwM2E5NTIxMjY1MzkxOTNhYWZlIn0= --- .../google-cloud-ai_platform-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-ai_platform-v1/.rubocop.yml | 33 + .../google-cloud-ai_platform-v1/.toys.rb | 28 + .../google-cloud-ai_platform-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-ai_platform-v1/CHANGELOG.md | 2 + .../google-cloud-ai_platform-v1/Gemfile | 11 + .../google-cloud-ai_platform-v1/LICENSE.md | 201 + .../google-cloud-ai_platform-v1/README.md | 154 + .../google-cloud-ai_platform-v1/Rakefile | 169 + .../gapic_metadata.json | 1927 +++ .../google-cloud-ai_platform-v1.gemspec | 30 + .../lib/google-cloud-ai_platform-v1.rb | 21 + .../lib/google/cloud/ai_platform/v1.rb | 76 + .../cloud/ai_platform/v1/bindings_override.rb | 447 + .../cloud/ai_platform/v1/dataset_service.rb | 56 + .../ai_platform/v1/dataset_service/client.rb | 2455 +++ .../v1/dataset_service/credentials.rb | 47 + .../v1/dataset_service/operations.rb | 814 + .../ai_platform/v1/dataset_service/paths.rb | 153 + .../ai_platform/v1/dataset_service/rest.rb | 54 + .../v1/dataset_service/rest/client.rb | 2305 +++ .../v1/dataset_service/rest/operations.rb | 4293 +++++ .../v1/dataset_service/rest/service_stub.rb | 1323 ++ .../v1/deployment_resource_pool_service.rb | 56 + .../client.rb | 1039 ++ .../credentials.rb | 47 + .../operations.rb | 814 + .../deployment_resource_pool_service/paths.rb | 102 + .../deployment_resource_pool_service/rest.rb | 54 + .../rest/client.rb | 978 ++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 449 + .../cloud/ai_platform/v1/endpoint_service.rb | 56 + .../ai_platform/v1/endpoint_service/client.rb | 1417 ++ .../v1/endpoint_service/credentials.rb | 47 + .../v1/endpoint_service/operations.rb | 814 + .../ai_platform/v1/endpoint_service/paths.rb | 188 + .../ai_platform/v1/endpoint_service/rest.rb | 54 + .../v1/endpoint_service/rest/client.rb | 1337 ++ .../v1/endpoint_service/rest/operations.rb | 4293 +++++ .../v1/endpoint_service/rest/service_stub.rb | 636 + .../ai_platform/v1/evaluation_service.rb | 55 + .../v1/evaluation_service/client.rb | 540 + .../v1/evaluation_service/credentials.rb | 47 + .../v1/evaluation_service/paths.rb | 50 + .../ai_platform/v1/evaluation_service/rest.rb | 53 + .../v1/evaluation_service/rest/client.rb | 516 + .../evaluation_service/rest/service_stub.rb | 143 + .../v1/feature_online_store_admin_service.rb | 57 + .../client.rb | 1873 +++ .../credentials.rb | 47 + .../operations.rb | 814 + .../paths.rb | 111 + .../rest.rb | 55 + .../rest/client.rb | 1765 +++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 879 ++ .../v1/feature_online_store_service.rb | 55 + .../v1/feature_online_store_service/client.rb | 591 + .../credentials.rb | 47 + .../v1/feature_online_store_service/paths.rb | 54 + .../v1/feature_online_store_service/rest.rb | 53 + .../rest/client.rb | 560 + .../rest/service_stub.rb | 205 + .../v1/feature_registry_service.rb | 57 + .../v1/feature_registry_service/client.rb | 1677 ++ .../feature_registry_service/credentials.rb | 47 + .../v1/feature_registry_service/operations.rb | 814 + .../v1/feature_registry_service/paths.rb | 139 + .../v1/feature_registry_service/rest.rb | 55 + .../feature_registry_service/rest/client.rb | 1583 ++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 757 + .../v1/featurestore_online_serving_service.rb | 55 + .../client.rb | 707 + .../credentials.rb | 47 + .../paths.rb | 54 + .../rest.rb | 53 + .../rest/client.rb | 671 + .../rest/service_stub.rb | 261 + .../ai_platform/v1/featurestore_service.rb | 56 + .../v1/featurestore_service/client.rb | 2954 ++++ .../v1/featurestore_service/credentials.rb | 47 + .../v1/featurestore_service/operations.rb | 814 + .../v1/featurestore_service/paths.rb | 158 + .../v1/featurestore_service/rest.rb | 54 + .../v1/featurestore_service/rest/client.rb | 2790 ++++ .../featurestore_service/rest/operations.rb | 4293 +++++ .../featurestore_service/rest/service_stub.rb | 1373 ++ .../ai_platform/v1/gen_ai_cache_service.rb | 55 + .../v1/gen_ai_cache_service/client.rb | 872 ++ .../v1/gen_ai_cache_service/credentials.rb | 47 + .../v1/gen_ai_cache_service/paths.rb | 88 + .../v1/gen_ai_cache_service/rest.rb | 53 + .../v1/gen_ai_cache_service/rest/client.rb | 820 + .../gen_ai_cache_service/rest/service_stub.rb | 388 + .../ai_platform/v1/gen_ai_tuning_service.rb | 56 + .../v1/gen_ai_tuning_service/client.rb | 918 ++ .../v1/gen_ai_tuning_service/credentials.rb | 47 + .../v1/gen_ai_tuning_service/operations.rb | 814 + .../v1/gen_ai_tuning_service/paths.rb | 173 + .../v1/gen_ai_tuning_service/rest.rb | 54 + .../v1/gen_ai_tuning_service/rest/client.rb | 866 + .../gen_ai_tuning_service/rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 389 + .../ai_platform/v1/index_endpoint_service.rb | 56 + .../v1/index_endpoint_service/client.rb | 1252 ++ .../v1/index_endpoint_service/credentials.rb | 47 + .../v1/index_endpoint_service/operations.rb | 814 + .../v1/index_endpoint_service/paths.rb | 107 + .../v1/index_endpoint_service/rest.rb | 54 + .../v1/index_endpoint_service/rest/client.rb | 1179 ++ .../index_endpoint_service/rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 574 + .../cloud/ai_platform/v1/index_service.rb | 56 + .../ai_platform/v1/index_service/client.rb | 1125 ++ .../v1/index_service/credentials.rb | 47 + .../v1/index_service/operations.rb | 814 + .../ai_platform/v1/index_service/paths.rb | 88 + .../ai_platform/v1/index_service/rest.rb | 54 + .../v1/index_service/rest/client.rb | 1059 ++ .../v1/index_service/rest/operations.rb | 4293 +++++ .../v1/index_service/rest/service_stub.rb | 512 + .../cloud/ai_platform/v1/job_service.rb | 56 + .../ai_platform/v1/job_service/client.rb | 4111 +++++ .../ai_platform/v1/job_service/credentials.rb | 48 + .../ai_platform/v1/job_service/operations.rb | 814 + .../cloud/ai_platform/v1/job_service/paths.rb | 401 + .../cloud/ai_platform/v1/job_service/rest.rb | 54 + .../ai_platform/v1/job_service/rest/client.rb | 3849 +++++ .../v1/job_service/rest/operations.rb | 4293 +++++ .../v1/job_service/rest/service_stub.rb | 2231 +++ .../ai_platform/v1/llm_utility_service.rb | 55 + .../v1/llm_utility_service/client.rb | 610 + .../v1/llm_utility_service/credentials.rb | 47 + .../v1/llm_utility_service/paths.rb | 97 + .../v1/llm_utility_service/rest.rb | 53 + .../v1/llm_utility_service/rest/client.rb | 579 + .../llm_utility_service/rest/service_stub.rb | 253 + .../cloud/ai_platform/v1/match_service.rb | 56 + .../ai_platform/v1/match_service/client.rb | 598 + .../v1/match_service/credentials.rb | 47 + .../ai_platform/v1/match_service/paths.rb | 52 + .../ai_platform/v1/match_service/rest.rb | 54 + .../v1/match_service/rest/client.rb | 567 + .../v1/match_service/rest/service_stub.rb | 205 + .../cloud/ai_platform/v1/metadata_service.rb | 56 + .../ai_platform/v1/metadata_service/client.rb | 3884 +++++ .../v1/metadata_service/credentials.rb | 47 + .../v1/metadata_service/operations.rb | 814 + .../ai_platform/v1/metadata_service/paths.rb | 153 + .../ai_platform/v1/metadata_service/rest.rb | 54 + .../v1/metadata_service/rest/client.rb | 3643 +++++ .../v1/metadata_service/rest/operations.rb | 4293 +++++ .../v1/metadata_service/rest/service_stub.rb | 2048 +++ .../cloud/ai_platform/v1/migration_service.rb | 57 + .../v1/migration_service/client.rb | 633 + .../v1/migration_service/credentials.rb | 47 + .../v1/migration_service/operations.rb | 814 + .../ai_platform/v1/migration_service/paths.rb | 148 + .../ai_platform/v1/migration_service/rest.rb | 55 + .../v1/migration_service/rest/client.rb | 602 + .../v1/migration_service/rest/operations.rb | 4293 +++++ .../v1/migration_service/rest/service_stub.rb | 205 + .../ai_platform/v1/model_garden_service.rb | 55 + .../v1/model_garden_service/client.rb | 494 + .../v1/model_garden_service/credentials.rb | 47 + .../v1/model_garden_service/paths.rb | 50 + .../v1/model_garden_service/rest.rb | 53 + .../v1/model_garden_service/rest/client.rb | 470 + .../model_garden_service/rest/service_stub.rb | 142 + .../cloud/ai_platform/v1/model_service.rb | 56 + .../ai_platform/v1/model_service/client.rb | 2376 +++ .../v1/model_service/credentials.rb | 47 + .../v1/model_service/operations.rb | 814 + .../ai_platform/v1/model_service/paths.rb | 196 + .../ai_platform/v1/model_service/rest.rb | 54 + .../v1/model_service/rest/client.rb | 2233 +++ .../v1/model_service/rest/operations.rb | 4293 +++++ .../v1/model_service/rest/service_stub.rb | 1188 ++ .../cloud/ai_platform/v1/notebook_service.rb | 56 + .../ai_platform/v1/notebook_service/client.rb | 2160 +++ .../v1/notebook_service/credentials.rb | 47 + .../v1/notebook_service/operations.rb | 814 + .../ai_platform/v1/notebook_service/paths.rb | 181 + .../ai_platform/v1/notebook_service/rest.rb | 54 + .../v1/notebook_service/rest/client.rb | 2031 +++ .../v1/notebook_service/rest/operations.rb | 4293 +++++ .../v1/notebook_service/rest/service_stub.rb | 1064 ++ .../v1/persistent_resource_service.rb | 56 + .../v1/persistent_resource_service/client.rb | 1028 ++ .../credentials.rb | 47 + .../persistent_resource_service/operations.rb | 814 + .../v1/persistent_resource_service/paths.rb | 105 + .../v1/persistent_resource_service/rest.rb | 54 + .../rest/client.rb | 969 ++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 450 + .../cloud/ai_platform/v1/pipeline_service.rb | 58 + .../ai_platform/v1/pipeline_service/client.rb | 1723 ++ .../v1/pipeline_service/credentials.rb | 47 + .../v1/pipeline_service/operations.rb | 814 + .../ai_platform/v1/pipeline_service/paths.rb | 251 + .../ai_platform/v1/pipeline_service/rest.rb | 56 + .../v1/pipeline_service/rest/client.rb | 1622 ++ .../v1/pipeline_service/rest/operations.rb | 4293 +++++ .../v1/pipeline_service/rest/service_stub.rb | 819 + .../ai_platform/v1/prediction_service.rb | 55 + .../v1/prediction_service/client.rb | 1780 +++ .../v1/prediction_service/credentials.rb | 48 + .../v1/prediction_service/paths.rb | 116 + .../ai_platform/v1/prediction_service/rest.rb | 53 + .../v1/prediction_service/rest/client.rb | 1363 ++ .../prediction_service/rest/service_stub.rb | 701 + .../v1/reasoning_engine_execution_service.rb | 55 + .../client.rb | 593 + .../credentials.rb | 47 + .../paths.rb | 52 + .../rest.rb | 53 + .../rest/client.rb | 564 + .../rest/service_stub.rb | 199 + .../v1/reasoning_engine_service.rb | 56 + .../v1/reasoning_engine_service/client.rb | 914 ++ .../reasoning_engine_service/credentials.rb | 47 + .../v1/reasoning_engine_service/operations.rb | 814 + .../v1/reasoning_engine_service/paths.rb | 69 + .../v1/reasoning_engine_service/rest.rb | 54 + .../reasoning_engine_service/rest/client.rb | 862 + .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 388 + .../lib/google/cloud/ai_platform/v1/rest.rb | 69 + .../cloud/ai_platform/v1/schedule_service.rb | 57 + .../ai_platform/v1/schedule_service/client.rb | 1166 ++ .../v1/schedule_service/credentials.rb | 47 + .../v1/schedule_service/operations.rb | 814 + .../ai_platform/v1/schedule_service/paths.rb | 263 + .../ai_platform/v1/schedule_service/rest.rb | 55 + .../v1/schedule_service/rest/client.rb | 1100 ++ .../v1/schedule_service/rest/operations.rb | 4293 +++++ .../v1/schedule_service/rest/service_stub.rb | 512 + .../ai_platform/v1/specialist_pool_service.rb | 61 + .../v1/specialist_pool_service/client.rb | 926 ++ .../v1/specialist_pool_service/credentials.rb | 47 + .../v1/specialist_pool_service/operations.rb | 814 + .../v1/specialist_pool_service/paths.rb | 69 + .../v1/specialist_pool_service/rest.rb | 59 + .../v1/specialist_pool_service/rest/client.rb | 874 ++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 388 + .../ai_platform/v1/tensorboard_service.rb | 56 + .../v1/tensorboard_service/client.rb | 3509 +++++ .../v1/tensorboard_service/credentials.rb | 48 + .../v1/tensorboard_service/operations.rb | 814 + .../v1/tensorboard_service/paths.rb | 138 + .../v1/tensorboard_service/rest.rb | 54 + .../v1/tensorboard_service/rest/client.rb | 3284 ++++ .../v1/tensorboard_service/rest/operations.rb | 4293 +++++ .../tensorboard_service/rest/service_stub.rb | 1918 +++ .../google/cloud/ai_platform/v1/version.rb | 28 + .../ai_platform/v1/vertex_rag_data_service.rb | 56 + .../v1/vertex_rag_data_service/client.rb | 1430 ++ .../v1/vertex_rag_data_service/credentials.rb | 47 + .../v1/vertex_rag_data_service/operations.rb | 814 + .../v1/vertex_rag_data_service/paths.rb | 173 + .../v1/vertex_rag_data_service/rest.rb | 54 + .../v1/vertex_rag_data_service/rest/client.rb | 1343 ++ .../rest/operations.rb | 4293 +++++ .../rest/service_stub.rb | 695 + .../ai_platform/v1/vertex_rag_service.rb | 55 + .../v1/vertex_rag_service/client.rb | 697 + .../v1/vertex_rag_service/credentials.rb | 47 + .../v1/vertex_rag_service/paths.rb | 69 + .../ai_platform/v1/vertex_rag_service/rest.rb | 53 + .../v1/vertex_rag_service/rest/client.rb | 659 + .../vertex_rag_service/rest/service_stub.rb | 267 + .../cloud/ai_platform/v1/vizier_service.rb | 60 + .../ai_platform/v1/vizier_service/client.rb | 1927 +++ .../v1/vizier_service/credentials.rb | 47 + .../v1/vizier_service/operations.rb | 814 + .../ai_platform/v1/vizier_service/paths.rb | 109 + .../ai_platform/v1/vizier_service/rest.rb | 58 + .../v1/vizier_service/rest/client.rb | 1805 +++ .../v1/vizier_service/rest/operations.rb | 4293 +++++ .../v1/vizier_service/rest/service_stub.rb | 1005 ++ .../aiplatform/v1/accelerator_type_pb.rb | 42 + .../cloud/aiplatform/v1/annotation_pb.rb | 51 + .../cloud/aiplatform/v1/annotation_spec_pb.rb | 47 + .../google/cloud/aiplatform/v1/api_auth_pb.rb | 46 + .../google/cloud/aiplatform/v1/artifact_pb.rb | 50 + .../aiplatform/v1/batch_prediction_job_pb.rb | 70 + .../cloud/aiplatform/v1/cached_content_pb.rb | 54 + .../aiplatform/v1/completion_stats_pb.rb | 44 + .../google/cloud/aiplatform/v1/content_pb.rb | 83 + .../google/cloud/aiplatform/v1/context_pb.rb | 49 + .../cloud/aiplatform/v1/custom_job_pb.rb | 66 + .../cloud/aiplatform/v1/data_item_pb.rb | 49 + .../aiplatform/v1/data_labeling_job_pb.rb | 60 + .../google/cloud/aiplatform/v1/dataset_pb.rb | 60 + .../cloud/aiplatform/v1/dataset_service_pb.rb | 99 + .../v1/dataset_service_services_pb.rb | 83 + .../cloud/aiplatform/v1/dataset_version_pb.rb | 49 + .../aiplatform/v1/deployed_index_ref_pb.rb | 45 + .../aiplatform/v1/deployed_model_ref_pb.rb | 45 + .../v1/deployment_resource_pool_pb.rb | 51 + .../v1/deployment_resource_pool_service_pb.rb | 68 + ...yment_resource_pool_service_services_pb.rb | 55 + .../cloud/aiplatform/v1/encryption_spec_pb.rb | 44 + .../google/cloud/aiplatform/v1/endpoint_pb.rb | 65 + .../aiplatform/v1/endpoint_service_pb.rb | 72 + .../v1/endpoint_service_services_pb.rb | 65 + .../cloud/aiplatform/v1/entity_type_pb.rb | 49 + .../google/cloud/aiplatform/v1/env_var_pb.rb | 45 + .../aiplatform/v1/evaluated_annotation_pb.rb | 53 + .../aiplatform/v1/evaluation_service_pb.rb | 158 + .../v1/evaluation_service_services_pb.rb | 45 + .../google/cloud/aiplatform/v1/event_pb.rb | 48 + .../cloud/aiplatform/v1/execution_pb.rb | 50 + .../aiplatform/v1/explanation_metadata_pb.rb | 55 + .../cloud/aiplatform/v1/explanation_pb.rb | 74 + .../cloud/aiplatform/v1/feature_group_pb.rb | 51 + .../v1/feature_monitoring_stats_pb.rb | 45 + .../feature_online_store_admin_service_pb.rb | 79 + ..._online_store_admin_service_services_pb.rb | 71 + .../aiplatform/v1/feature_online_store_pb.rb | 56 + .../v1/feature_online_store_service_pb.rb | 67 + ...eature_online_store_service_services_pb.rb | 49 + .../google/cloud/aiplatform/v1/feature_pb.rb | 52 + .../v1/feature_registry_service_pb.rb | 66 + .../feature_registry_service_services_pb.rb | 66 + .../aiplatform/v1/feature_selector_pb.rb | 45 + .../cloud/aiplatform/v1/feature_view_pb.rb | 56 + .../aiplatform/v1/feature_view_sync_pb.rb | 52 + .../v1/featurestore_monitoring_pb.rb | 47 + .../v1/featurestore_online_service_pb.rb | 67 + ...featurestore_online_service_services_pb.rb | 57 + .../cloud/aiplatform/v1/featurestore_pb.rb | 52 + .../aiplatform/v1/featurestore_service_pb.rb | 117 + .../v1/featurestore_service_services_pb.rb | 120 + .../aiplatform/v1/gen_ai_cache_service_pb.rb | 57 + .../v1/gen_ai_cache_service_services_pb.rb | 54 + .../aiplatform/v1/genai_tuning_service_pb.rb | 61 + .../v1/genai_tuning_service_services_pb.rb | 65 + .../v1/hyperparameter_tuning_job_pb.rb | 56 + .../cloud/aiplatform/v1/index_endpoint_pb.rb | 57 + .../v1/index_endpoint_service_pb.rb | 70 + .../v1/index_endpoint_service_services_pb.rb | 62 + .../google/cloud/aiplatform/v1/index_pb.rb | 61 + .../cloud/aiplatform/v1/index_service_pb.rb | 70 + .../v1/index_service_services_pb.rb | 60 + .../lib/google/cloud/aiplatform/v1/io_pb.rb | 67 + .../cloud/aiplatform/v1/job_service_pb.rb | 111 + .../aiplatform/v1/job_service_services_pb.rb | 170 + .../cloud/aiplatform/v1/job_state_pb.rb | 42 + .../aiplatform/v1/lineage_subgraph_pb.rb | 49 + .../aiplatform/v1/llm_utility_service_pb.rb | 54 + .../v1/llm_utility_service_services_pb.rb | 47 + .../aiplatform/v1/machine_resources_pb.rb | 56 + .../v1/manual_batch_tuning_parameters_pb.rb | 44 + .../cloud/aiplatform/v1/match_service_pb.rb | 56 + .../v1/match_service_services_pb.rb | 49 + .../cloud/aiplatform/v1/metadata_schema_pb.rb | 48 + .../aiplatform/v1/metadata_service_pb.rb | 114 + .../v1/metadata_service_services_pb.rb | 123 + .../cloud/aiplatform/v1/metadata_store_pb.rb | 51 + .../aiplatform/v1/migratable_resource_pb.rb | 52 + .../aiplatform/v1/migration_service_pb.rb | 66 + .../v1/migration_service_services_pb.rb | 51 + .../v1/model_deployment_monitoring_job_pb.rb | 72 + .../aiplatform/v1/model_evaluation_pb.rb | 52 + .../v1/model_evaluation_slice_pb.rb | 58 + .../aiplatform/v1/model_garden_service_pb.rb | 49 + .../v1/model_garden_service_services_pb.rb | 45 + .../aiplatform/v1/model_monitoring_pb.rb | 57 + .../google/cloud/aiplatform/v1/model_pb.rb | 75 + .../cloud/aiplatform/v1/model_service_pb.rb | 100 + .../v1/model_service_services_pb.rb | 100 + .../google/cloud/aiplatform/v1/nas_job_pb.rb | 68 + .../cloud/aiplatform/v1/network_spec_pb.rb | 44 + .../aiplatform/v1/notebook_euc_config_pb.rb | 44 + .../v1/notebook_execution_job_pb.rb | 63 + .../v1/notebook_idle_shutdown_config_pb.rb | 46 + .../aiplatform/v1/notebook_runtime_pb.rb | 63 + .../v1/notebook_runtime_template_ref_pb.rb | 45 + .../aiplatform/v1/notebook_service_pb.rb | 85 + .../v1/notebook_service_services_pb.rb | 76 + .../google/cloud/aiplatform/v1/openapi_pb.rb | 47 + .../cloud/aiplatform/v1/operation_pb.rb | 49 + .../aiplatform/v1/persistent_resource_pb.rb | 62 + .../v1/persistent_resource_service_pb.rb | 64 + ...persistent_resource_service_services_pb.rb | 55 + .../v1/pipeline_failure_policy_pb.rb | 42 + .../cloud/aiplatform/v1/pipeline_job_pb.rb | 74 + .../aiplatform/v1/pipeline_service_pb.rb | 73 + .../v1/pipeline_service_services_pb.rb | 103 + .../cloud/aiplatform/v1/pipeline_state_pb.rb | 42 + .../aiplatform/v1/prediction_service_pb.rb | 83 + .../v1/prediction_service_services_pb.rb | 95 + .../cloud/aiplatform/v1/publisher_model_pb.rb | 62 + .../reasoning_engine_execution_service_pb.rb | 52 + ...ng_engine_execution_service_services_pb.rb | 47 + .../aiplatform/v1/reasoning_engine_pb.rb | 51 + .../v1/reasoning_engine_service_pb.rb | 62 + .../reasoning_engine_service_services_pb.rb | 53 + .../aiplatform/v1/reservation_affinity_pb.rb | 46 + .../cloud/aiplatform/v1/saved_query_pb.rb | 49 + .../google/cloud/aiplatform/v1/schedule_pb.rb | 53 + .../aiplatform/v1/schedule_service_pb.rb | 61 + .../v1/schedule_service_services_pb.rb | 75 + .../aiplatform/v1/service_networking_pb.rb | 47 + .../cloud/aiplatform/v1/specialist_pool_pb.rb | 45 + .../v1/specialist_pool_service_pb.rb | 62 + .../v1/specialist_pool_service_services_pb.rb | 58 + .../google/cloud/aiplatform/v1/study_pb.rb | 82 + .../aiplatform/v1/tensorboard_data_pb.rb | 52 + .../v1/tensorboard_experiment_pb.rb | 47 + .../cloud/aiplatform/v1/tensorboard_pb.rb | 49 + .../cloud/aiplatform/v1/tensorboard_run_pb.rb | 47 + .../aiplatform/v1/tensorboard_service_pb.rb | 110 + .../v1/tensorboard_service_services_pb.rb | 117 + .../v1/tensorboard_time_series_pb.rb | 49 + .../lib/google/cloud/aiplatform/v1/tool_pb.rb | 67 + .../aiplatform/v1/training_pipeline_pb.rb | 64 + .../cloud/aiplatform/v1/tuning_job_pb.rb | 63 + .../google/cloud/aiplatform/v1/types_pb.rb | 47 + .../v1/unmanaged_container_model_pb.rb | 46 + .../aiplatform/v1/user_action_reference_pb.rb | 42 + .../google/cloud/aiplatform/v1/value_pb.rb | 42 + .../cloud/aiplatform/v1/vertex_rag_data_pb.rb | 67 + .../v1/vertex_rag_data_service_pb.rb | 71 + .../v1/vertex_rag_data_service_services_pb.rb | 63 + .../aiplatform/v1/vertex_rag_service_pb.rb | 65 + .../v1/vertex_rag_service_services_pb.rb | 52 + .../cloud/aiplatform/v1/vizier_service_pb.rb | 76 + .../v1/vizier_service_services_pb.rb | 91 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 459 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/httpbody.rb | 80 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/aiplatform/v1/accelerator_type.rb | 75 + .../google/cloud/aiplatform/v1/annotation.rb | 95 + .../cloud/aiplatform/v1/annotation_spec.rb | 50 + .../google/cloud/aiplatform/v1/api_auth.rb | 45 + .../google/cloud/aiplatform/v1/artifact.rb | 113 + .../aiplatform/v1/batch_prediction_job.rb | 450 + .../cloud/aiplatform/v1/cached_content.rb | 101 + .../cloud/aiplatform/v1/completion_stats.rb | 51 + .../google/cloud/aiplatform/v1/content.rb | 637 + .../google/cloud/aiplatform/v1/context.rb | 93 + .../google/cloud/aiplatform/v1/custom_job.rb | 386 + .../google/cloud/aiplatform/v1/data_item.rb | 80 + .../cloud/aiplatform/v1/data_labeling_job.rb | 207 + .../google/cloud/aiplatform/v1/dataset.rb | 334 + .../cloud/aiplatform/v1/dataset_service.rb | 657 + .../cloud/aiplatform/v1/dataset_version.rb | 66 + .../cloud/aiplatform/v1/deployed_index_ref.rb | 41 + .../cloud/aiplatform/v1/deployed_model_ref.rb | 38 + .../aiplatform/v1/deployment_resource_pool.rb | 74 + .../v1/deployment_resource_pool_service.rb | 187 + .../cloud/aiplatform/v1/encryption_spec.rb | 40 + .../google/cloud/aiplatform/v1/endpoint.rb | 375 + .../cloud/aiplatform/v1/endpoint_service.rb | 362 + .../google/cloud/aiplatform/v1/entity_type.rb | 104 + .../google/cloud/aiplatform/v1/env_var.rb | 44 + .../aiplatform/v1/evaluated_annotation.rb | 186 + .../cloud/aiplatform/v1/evaluation_service.rb | 1560 ++ .../google/cloud/aiplatform/v1/event.rb | 79 + .../google/cloud/aiplatform/v1/execution.rb | 119 + .../google/cloud/aiplatform/v1/explanation.rb | 647 + .../aiplatform/v1/explanation_metadata.rb | 442 + .../google/cloud/aiplatform/v1/feature.rb | 179 + .../cloud/aiplatform/v1/feature_group.rb | 125 + .../aiplatform/v1/feature_monitoring_stats.rb | 89 + .../aiplatform/v1/feature_online_store.rb | 175 + .../v1/feature_online_store_admin_service.rb | 470 + .../v1/feature_online_store_service.rb | 314 + .../aiplatform/v1/feature_registry_service.rb | 211 + .../cloud/aiplatform/v1/feature_selector.rb | 49 + .../cloud/aiplatform/v1/feature_view.rb | 255 + .../cloud/aiplatform/v1/feature_view_sync.rb | 74 + .../cloud/aiplatform/v1/featurestore.rb | 164 + .../aiplatform/v1/featurestore_monitoring.rb | 162 + .../v1/featurestore_online_service.rb | 281 + .../aiplatform/v1/featurestore_service.rb | 1201 ++ .../aiplatform/v1/gen_ai_cache_service.rb | 108 + .../aiplatform/v1/genai_tuning_service.rb | 137 + .../v1/hyperparameter_tuning_job.rb | 117 + .../google/cloud/aiplatform/v1/index.rb | 273 + .../cloud/aiplatform/v1/index_endpoint.rb | 305 + .../aiplatform/v1/index_endpoint_service.rb | 262 + .../cloud/aiplatform/v1/index_service.rb | 324 + .../google/cloud/aiplatform/v1/io.rb | 293 + .../google/cloud/aiplatform/v1/job_service.rb | 893 ++ .../google/cloud/aiplatform/v1/job_state.rb | 67 + .../cloud/aiplatform/v1/lineage_subgraph.rb | 42 + .../aiplatform/v1/llm_utility_service.rb | 75 + .../cloud/aiplatform/v1/machine_resources.rb | 281 + .../v1/manual_batch_tuning_parameters.rb | 41 + .../cloud/aiplatform/v1/match_service.rb | 173 + .../cloud/aiplatform/v1/metadata_schema.rb | 74 + .../cloud/aiplatform/v1/metadata_service.rb | 1023 ++ .../cloud/aiplatform/v1/metadata_store.rb | 75 + .../aiplatform/v1/migratable_resource.rb | 133 + .../cloud/aiplatform/v1/migration_service.rb | 263 + .../google/cloud/aiplatform/v1/model.rb | 873 ++ .../v1/model_deployment_monitoring_job.rb | 333 + .../cloud/aiplatform/v1/model_evaluation.rb | 114 + .../aiplatform/v1/model_evaluation_slice.rb | 203 + .../aiplatform/v1/model_garden_service.rb | 68 + .../cloud/aiplatform/v1/model_monitoring.rb | 275 + .../cloud/aiplatform/v1/model_service.rb | 681 + .../google/cloud/aiplatform/v1/nas_job.rb | 313 + .../cloud/aiplatform/v1/network_spec.rb | 44 + .../aiplatform/v1/notebook_euc_config.rb | 46 + .../aiplatform/v1/notebook_execution_job.rb | 181 + .../v1/notebook_idle_shutdown_config.rb | 41 + .../cloud/aiplatform/v1/notebook_runtime.rb | 278 + .../v1/notebook_runtime_template_ref.rb | 35 + .../cloud/aiplatform/v1/notebook_service.rb | 546 + .../google/cloud/aiplatform/v1/openapi.rb | 153 + .../google/cloud/aiplatform/v1/operation.rb | 55 + .../aiplatform/v1/persistent_resource.rb | 329 + .../v1/persistent_resource_service.rb | 171 + .../aiplatform/v1/pipeline_failure_policy.rb | 45 + .../cloud/aiplatform/v1/pipeline_job.rb | 458 + .../cloud/aiplatform/v1/pipeline_service.rb | 353 + .../cloud/aiplatform/v1/pipeline_state.rb | 59 + .../cloud/aiplatform/v1/prediction_service.rb | 628 + .../cloud/aiplatform/v1/publisher_model.rb | 347 + .../cloud/aiplatform/v1/reasoning_engine.rb | 87 + .../v1/reasoning_engine_execution_service.rb | 73 + .../aiplatform/v1/reasoning_engine_service.rb | 136 + .../aiplatform/v1/reservation_affinity.rb | 63 + .../google/cloud/aiplatform/v1/saved_query.rb | 79 + .../google/cloud/aiplatform/v1/schedule.rb | 156 + .../cloud/aiplatform/v1/schedule_service.rb | 204 + .../predict/instance/image_classification.rb | 52 + .../instance/image_object_detection.rb | 52 + .../predict/instance/image_segmentation.rb | 47 + .../predict/instance/text_classification.rb | 46 + .../predict/instance/text_extraction.rb | 53 + .../schema/predict/instance/text_sentiment.rb | 46 + .../instance/video_action_recognition.rb | 59 + .../predict/instance/video_classification.rb | 59 + .../predict/instance/video_object_tracking.rb | 59 + .../predict/params/image_classification.rb | 47 + .../predict/params/image_object_detection.rb | 47 + .../predict/params/image_segmentation.rb | 44 + .../params/video_action_recognition.rb | 47 + .../predict/params/video_classification.rb | 72 + .../predict/params/video_object_tracking.rb | 51 + .../predict/prediction/classification.rb | 49 + .../prediction/image_object_detection.rb | 58 + .../predict/prediction/image_segmentation.rb | 53 + .../prediction/tabular_classification.rb | 47 + .../predict/prediction/tabular_regression.rb | 47 + .../predict/prediction/text_extraction.rb | 60 + .../predict/prediction/text_sentiment.rb | 45 + .../prediction/video_action_recognition.rb | 60 + .../prediction/video_classification.rb | 73 + .../prediction/video_object_tracking.rb | 91 + .../definition/automl_image_classification.rb | 142 + .../automl_image_object_detection.rb | 134 + .../definition/automl_image_segmentation.rb | 120 + .../trainingjob/definition/automl_tables.rb | 315 + .../definition/automl_text_classification.rb | 48 + .../definition/automl_text_extraction.rb | 46 + .../definition/automl_text_sentiment.rb | 55 + .../automl_video_action_recognition.rb | 73 + .../definition/automl_video_classification.rb | 67 + .../automl_video_object_tracking.rb | 78 + .../export_evaluated_data_items_config.rb | 51 + .../cloud/aiplatform/v1/service_networking.rb | 78 + .../cloud/aiplatform/v1/specialist_pool.rb | 58 + .../aiplatform/v1/specialist_pool_service.rb | 144 + .../google/cloud/aiplatform/v1/study.rb | 731 + .../google/cloud/aiplatform/v1/tensorboard.rb | 102 + .../cloud/aiplatform/v1/tensorboard_data.rb | 111 + .../aiplatform/v1/tensorboard_experiment.rb | 86 + .../cloud/aiplatform/v1/tensorboard_run.rb | 85 + .../aiplatform/v1/tensorboard_service.rb | 825 + .../aiplatform/v1/tensorboard_time_series.rb | 103 + .../google/cloud/aiplatform/v1/tool.rb | 320 + .../cloud/aiplatform/v1/training_pipeline.rb | 434 + .../google/cloud/aiplatform/v1/tuning_job.rb | 308 + .../google/cloud/aiplatform/v1/types.rb | 161 + .../v1/unmanaged_container_model.rb | 44 + .../aiplatform/v1/user_action_reference.rb | 49 + .../google/cloud/aiplatform/v1/value.rb | 41 + .../cloud/aiplatform/v1/vertex_rag_data.rb | 334 + .../aiplatform/v1/vertex_rag_data_service.rb | 293 + .../cloud/aiplatform/v1/vertex_rag_service.rb | 279 + .../cloud/aiplatform/v1/vizier_service.rb | 390 + .../google/longrunning/operations.rb | 169 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/struct.rb | 96 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/date.rb | 53 + .../proto_docs/google/type/expr.rb | 75 + .../proto_docs/google/type/interval.rb | 45 + .../proto_docs/google/type/latlng.rb | 38 + .../proto_docs/google/type/money.rb | 43 + .../snippets/Gemfile | 32 + .../dataset_service/create_dataset.rb | 54 + .../dataset_service/create_dataset_version.rb | 54 + .../dataset_service/delete_dataset.rb | 54 + .../dataset_service/delete_dataset_version.rb | 54 + .../dataset_service/delete_saved_query.rb | 54 + .../snippets/dataset_service/export_data.rb | 54 + .../dataset_service/get_annotation_spec.rb | 47 + .../snippets/dataset_service/get_dataset.rb | 47 + .../dataset_service/get_dataset_version.rb | 47 + .../snippets/dataset_service/import_data.rb | 54 + .../dataset_service/list_annotations.rb | 51 + .../dataset_service/list_data_items.rb | 51 + .../dataset_service/list_dataset_versions.rb | 51 + .../snippets/dataset_service/list_datasets.rb | 51 + .../dataset_service/list_saved_queries.rb | 51 + .../restore_dataset_version.rb | 54 + .../dataset_service/search_data_items.rb | 51 + .../dataset_service/update_dataset.rb | 47 + .../dataset_service/update_dataset_version.rb | 47 + .../create_deployment_resource_pool.rb | 54 + .../delete_deployment_resource_pool.rb | 54 + .../get_deployment_resource_pool.rb | 47 + .../list_deployment_resource_pools.rb | 51 + .../query_deployed_models.rb | 51 + .../update_deployment_resource_pool.rb | 54 + .../endpoint_service/create_endpoint.rb | 54 + .../endpoint_service/delete_endpoint.rb | 54 + .../snippets/endpoint_service/deploy_model.rb | 54 + .../snippets/endpoint_service/get_endpoint.rb | 47 + .../endpoint_service/list_endpoints.rb | 51 + .../endpoint_service/mutate_deployed_model.rb | 54 + .../endpoint_service/undeploy_model.rb | 54 + .../endpoint_service/update_endpoint.rb | 47 + .../update_endpoint_long_running.rb | 54 + .../evaluation_service/evaluate_instances.rb | 47 + .../create_feature_online_store.rb | 54 + .../create_feature_view.rb | 54 + .../delete_feature_online_store.rb | 54 + .../delete_feature_view.rb | 54 + .../get_feature_online_store.rb | 47 + .../get_feature_view.rb | 47 + .../get_feature_view_sync.rb | 47 + .../list_feature_online_stores.rb | 51 + .../list_feature_view_syncs.rb | 51 + .../list_feature_views.rb | 51 + .../sync_feature_view.rb | 47 + .../update_feature_online_store.rb | 54 + .../update_feature_view.rb | 54 + .../fetch_feature_values.rb | 47 + .../search_nearest_entities.rb | 47 + .../batch_create_features.rb | 54 + .../create_feature.rb | 54 + .../create_feature_group.rb | 54 + .../delete_feature.rb | 54 + .../delete_feature_group.rb | 54 + .../feature_registry_service/get_feature.rb | 47 + .../get_feature_group.rb | 47 + .../list_feature_groups.rb | 51 + .../feature_registry_service/list_features.rb | 51 + .../update_feature.rb | 54 + .../update_feature_group.rb | 54 + .../read_feature_values.rb | 47 + .../streaming_read_feature_values.rb | 50 + .../write_feature_values.rb | 47 + .../batch_create_features.rb | 54 + .../batch_read_feature_values.rb | 54 + .../create_entity_type.rb | 54 + .../featurestore_service/create_feature.rb | 54 + .../create_featurestore.rb | 54 + .../delete_entity_type.rb | 54 + .../featurestore_service/delete_feature.rb | 54 + .../delete_feature_values.rb | 54 + .../delete_featurestore.rb | 54 + .../export_feature_values.rb | 54 + .../featurestore_service/get_entity_type.rb | 47 + .../featurestore_service/get_feature.rb | 47 + .../featurestore_service/get_featurestore.rb | 47 + .../import_feature_values.rb | 54 + .../featurestore_service/list_entity_types.rb | 51 + .../featurestore_service/list_features.rb | 51 + .../list_featurestores.rb | 51 + .../featurestore_service/search_features.rb | 51 + .../update_entity_type.rb | 47 + .../featurestore_service/update_feature.rb | 47 + .../update_featurestore.rb | 54 + .../create_cached_content.rb | 47 + .../delete_cached_content.rb | 47 + .../get_cached_content.rb | 47 + .../list_cached_contents.rb | 51 + .../update_cached_content.rb | 47 + .../cancel_tuning_job.rb | 47 + .../create_tuning_job.rb | 47 + .../gen_ai_tuning_service/get_tuning_job.rb | 47 + .../gen_ai_tuning_service/list_tuning_jobs.rb | 51 + .../rebase_tuned_model.rb | 54 + .../create_index_endpoint.rb | 54 + .../delete_index_endpoint.rb | 54 + .../index_endpoint_service/deploy_index.rb | 54 + .../get_index_endpoint.rb | 47 + .../list_index_endpoints.rb | 51 + .../mutate_deployed_index.rb | 54 + .../index_endpoint_service/undeploy_index.rb | 54 + .../update_index_endpoint.rb | 47 + .../snippets/index_service/create_index.rb | 54 + .../snippets/index_service/delete_index.rb | 54 + .../snippets/index_service/get_index.rb | 47 + .../snippets/index_service/list_indexes.rb | 51 + .../index_service/remove_datapoints.rb | 47 + .../snippets/index_service/update_index.rb | 54 + .../index_service/upsert_datapoints.rb | 47 + .../cancel_batch_prediction_job.rb | 47 + .../snippets/job_service/cancel_custom_job.rb | 47 + .../job_service/cancel_data_labeling_job.rb | 47 + .../cancel_hyperparameter_tuning_job.rb | 47 + .../snippets/job_service/cancel_nas_job.rb | 47 + .../create_batch_prediction_job.rb | 47 + .../snippets/job_service/create_custom_job.rb | 47 + .../job_service/create_data_labeling_job.rb | 47 + .../create_hyperparameter_tuning_job.rb | 47 + .../create_model_deployment_monitoring_job.rb | 47 + .../snippets/job_service/create_nas_job.rb | 47 + .../delete_batch_prediction_job.rb | 54 + .../snippets/job_service/delete_custom_job.rb | 54 + .../job_service/delete_data_labeling_job.rb | 54 + .../delete_hyperparameter_tuning_job.rb | 54 + .../delete_model_deployment_monitoring_job.rb | 54 + .../snippets/job_service/delete_nas_job.rb | 54 + .../job_service/get_batch_prediction_job.rb | 47 + .../snippets/job_service/get_custom_job.rb | 47 + .../job_service/get_data_labeling_job.rb | 47 + .../get_hyperparameter_tuning_job.rb | 47 + .../get_model_deployment_monitoring_job.rb | 47 + .../snippets/job_service/get_nas_job.rb | 47 + .../job_service/get_nas_trial_detail.rb | 47 + .../job_service/list_batch_prediction_jobs.rb | 51 + .../snippets/job_service/list_custom_jobs.rb | 51 + .../job_service/list_data_labeling_jobs.rb | 51 + .../list_hyperparameter_tuning_jobs.rb | 51 + .../list_model_deployment_monitoring_jobs.rb | 51 + .../snippets/job_service/list_nas_jobs.rb | 51 + .../job_service/list_nas_trial_details.rb | 51 + .../pause_model_deployment_monitoring_job.rb | 47 + .../resume_model_deployment_monitoring_job.rb | 47 + ...l_deployment_monitoring_stats_anomalies.rb | 51 + .../update_model_deployment_monitoring_job.rb | 54 + .../llm_utility_service/compute_tokens.rb | 47 + .../llm_utility_service/count_tokens.rb | 47 + .../snippets/match_service/find_neighbors.rb | 47 + .../match_service/read_index_datapoints.rb | 47 + .../add_context_artifacts_and_executions.rb | 47 + .../metadata_service/add_context_children.rb | 47 + .../metadata_service/add_execution_events.rb | 47 + .../metadata_service/create_artifact.rb | 47 + .../metadata_service/create_context.rb | 47 + .../metadata_service/create_execution.rb | 47 + .../create_metadata_schema.rb | 47 + .../metadata_service/create_metadata_store.rb | 54 + .../metadata_service/delete_artifact.rb | 54 + .../metadata_service/delete_context.rb | 54 + .../metadata_service/delete_execution.rb | 54 + .../metadata_service/delete_metadata_store.rb | 54 + .../snippets/metadata_service/get_artifact.rb | 47 + .../snippets/metadata_service/get_context.rb | 47 + .../metadata_service/get_execution.rb | 47 + .../metadata_service/get_metadata_schema.rb | 47 + .../metadata_service/get_metadata_store.rb | 47 + .../metadata_service/list_artifacts.rb | 51 + .../metadata_service/list_contexts.rb | 51 + .../metadata_service/list_executions.rb | 51 + .../metadata_service/list_metadata_schemas.rb | 51 + .../metadata_service/list_metadata_stores.rb | 51 + .../metadata_service/purge_artifacts.rb | 54 + .../metadata_service/purge_contexts.rb | 54 + .../metadata_service/purge_executions.rb | 54 + .../query_artifact_lineage_subgraph.rb | 47 + .../query_context_lineage_subgraph.rb | 47 + .../query_execution_inputs_and_outputs.rb | 47 + .../remove_context_children.rb | 47 + .../metadata_service/update_artifact.rb | 47 + .../metadata_service/update_context.rb | 47 + .../metadata_service/update_execution.rb | 47 + .../batch_migrate_resources.rb | 54 + .../search_migratable_resources.rb | 51 + .../get_publisher_model.rb | 47 + .../batch_import_evaluated_annotations.rb | 47 + .../batch_import_model_evaluation_slices.rb | 47 + .../snippets/model_service/copy_model.rb | 54 + .../snippets/model_service/delete_model.rb | 54 + .../model_service/delete_model_version.rb | 54 + .../snippets/model_service/export_model.rb | 54 + .../snippets/model_service/get_model.rb | 47 + .../model_service/get_model_evaluation.rb | 47 + .../get_model_evaluation_slice.rb | 47 + .../model_service/import_model_evaluation.rb | 47 + .../list_model_evaluation_slices.rb | 51 + .../model_service/list_model_evaluations.rb | 51 + .../model_service/list_model_versions.rb | 51 + .../snippets/model_service/list_models.rb | 51 + .../model_service/merge_version_aliases.rb | 47 + .../update_explanation_dataset.rb | 54 + .../snippets/model_service/update_model.rb | 47 + .../snippets/model_service/upload_model.rb | 54 + .../assign_notebook_runtime.rb | 54 + .../create_notebook_execution_job.rb | 54 + .../create_notebook_runtime_template.rb | 54 + .../delete_notebook_execution_job.rb | 54 + .../delete_notebook_runtime.rb | 54 + .../delete_notebook_runtime_template.rb | 54 + .../get_notebook_execution_job.rb | 47 + .../notebook_service/get_notebook_runtime.rb | 47 + .../get_notebook_runtime_template.rb | 47 + .../list_notebook_execution_jobs.rb | 51 + .../list_notebook_runtime_templates.rb | 51 + .../list_notebook_runtimes.rb | 51 + .../start_notebook_runtime.rb | 54 + .../notebook_service/stop_notebook_runtime.rb | 54 + .../update_notebook_runtime_template.rb | 47 + .../upgrade_notebook_runtime.rb | 54 + .../create_persistent_resource.rb | 54 + .../delete_persistent_resource.rb | 54 + .../get_persistent_resource.rb | 47 + .../list_persistent_resources.rb | 51 + .../reboot_persistent_resource.rb | 54 + .../update_persistent_resource.rb | 54 + .../batch_cancel_pipeline_jobs.rb | 54 + .../batch_delete_pipeline_jobs.rb | 54 + .../pipeline_service/cancel_pipeline_job.rb | 47 + .../cancel_training_pipeline.rb | 47 + .../pipeline_service/create_pipeline_job.rb | 47 + .../create_training_pipeline.rb | 47 + .../pipeline_service/delete_pipeline_job.rb | 54 + .../delete_training_pipeline.rb | 54 + .../pipeline_service/get_pipeline_job.rb | 47 + .../pipeline_service/get_training_pipeline.rb | 47 + .../pipeline_service/list_pipeline_jobs.rb | 51 + .../list_training_pipelines.rb | 51 + .../prediction_service/direct_predict.rb | 47 + .../prediction_service/direct_raw_predict.rb | 47 + .../snippets/prediction_service/explain.rb | 47 + .../prediction_service/generate_content.rb | 47 + .../snippets/prediction_service/predict.rb | 47 + .../prediction_service/raw_predict.rb | 47 + .../server_streaming_predict.rb | 50 + .../stream_direct_predict.rb | 56 + .../stream_direct_raw_predict.rb | 56 + .../stream_generate_content.rb | 50 + .../prediction_service/stream_raw_predict.rb | 50 + .../prediction_service/streaming_predict.rb | 56 + .../streaming_raw_predict.rb | 56 + .../query_reasoning_engine.rb | 47 + .../stream_query_reasoning_engine.rb | 50 + .../create_reasoning_engine.rb | 54 + .../delete_reasoning_engine.rb | 54 + .../get_reasoning_engine.rb | 47 + .../list_reasoning_engines.rb | 51 + .../update_reasoning_engine.rb | 54 + .../schedule_service/create_schedule.rb | 47 + .../schedule_service/delete_schedule.rb | 54 + .../snippets/schedule_service/get_schedule.rb | 47 + .../schedule_service/list_schedules.rb | 51 + .../schedule_service/pause_schedule.rb | 47 + .../schedule_service/resume_schedule.rb | 47 + .../schedule_service/update_schedule.rb | 47 + ...t_metadata_google.cloud.aiplatform.v1.json | 13055 ++++++++++++++++ .../create_specialist_pool.rb | 54 + .../delete_specialist_pool.rb | 54 + .../get_specialist_pool.rb | 47 + .../list_specialist_pools.rb | 51 + .../update_specialist_pool.rb | 54 + .../batch_create_tensorboard_runs.rb | 47 + .../batch_create_tensorboard_time_series.rb | 47 + ...batch_read_tensorboard_time_series_data.rb | 47 + .../tensorboard_service/create_tensorboard.rb | 54 + .../create_tensorboard_experiment.rb | 47 + .../create_tensorboard_run.rb | 47 + .../create_tensorboard_time_series.rb | 47 + .../tensorboard_service/delete_tensorboard.rb | 54 + .../delete_tensorboard_experiment.rb | 54 + .../delete_tensorboard_run.rb | 54 + .../delete_tensorboard_time_series.rb | 54 + .../export_tensorboard_time_series_data.rb | 51 + .../tensorboard_service/get_tensorboard.rb | 47 + .../get_tensorboard_experiment.rb | 47 + .../get_tensorboard_run.rb | 47 + .../get_tensorboard_time_series.rb | 47 + .../list_tensorboard_experiments.rb | 51 + .../list_tensorboard_runs.rb | 51 + .../list_tensorboard_time_series.rb | 51 + .../tensorboard_service/list_tensorboards.rb | 51 + .../read_tensorboard_blob_data.rb | 50 + .../read_tensorboard_size.rb | 47 + .../read_tensorboard_time_series_data.rb | 47 + .../read_tensorboard_usage.rb | 47 + .../tensorboard_service/update_tensorboard.rb | 54 + .../update_tensorboard_experiment.rb | 47 + .../update_tensorboard_run.rb | 47 + .../update_tensorboard_time_series.rb | 47 + .../write_tensorboard_experiment_data.rb | 47 + .../write_tensorboard_run_data.rb | 47 + .../create_rag_corpus.rb | 54 + .../delete_rag_corpus.rb | 54 + .../delete_rag_file.rb | 54 + .../vertex_rag_data_service/get_rag_corpus.rb | 47 + .../vertex_rag_data_service/get_rag_file.rb | 47 + .../import_rag_files.rb | 54 + .../list_rag_corpora.rb | 51 + .../vertex_rag_data_service/list_rag_files.rb | 51 + .../update_rag_corpus.rb | 54 + .../upload_rag_file.rb | 47 + .../vertex_rag_service/augment_prompt.rb | 47 + .../vertex_rag_service/corroborate_content.rb | 47 + .../vertex_rag_service/retrieve_contexts.rb | 47 + .../vizier_service/add_trial_measurement.rb | 47 + .../check_trial_early_stopping_state.rb | 54 + .../snippets/vizier_service/complete_trial.rb | 47 + .../snippets/vizier_service/create_study.rb | 47 + .../snippets/vizier_service/create_trial.rb | 47 + .../snippets/vizier_service/delete_study.rb | 47 + .../snippets/vizier_service/delete_trial.rb | 47 + .../snippets/vizier_service/get_study.rb | 47 + .../snippets/vizier_service/get_trial.rb | 47 + .../vizier_service/list_optimal_trials.rb | 47 + .../snippets/vizier_service/list_studies.rb | 51 + .../snippets/vizier_service/list_trials.rb | 51 + .../snippets/vizier_service/lookup_study.rb | 47 + .../snippets/vizier_service/stop_trial.rb | 47 + .../snippets/vizier_service/suggest_trials.rb | 54 + .../v1/dataset_service_operations_test.rb | 398 + .../v1/dataset_service_paths_test.rb | 115 + .../v1/dataset_service_rest_test.rb | 1170 ++ .../ai_platform/v1/dataset_service_test.rb | 1362 ++ ...t_resource_pool_service_operations_test.rb | 398 + ...oyment_resource_pool_service_paths_test.rb | 91 + ...loyment_resource_pool_service_rest_test.rb | 430 + .../deployment_resource_pool_service_test.rb | 486 + .../v1/endpoint_service_operations_test.rb | 398 + .../v1/endpoint_service_paths_test.rb | 130 + .../v1/endpoint_service_rest_test.rb | 599 + .../ai_platform/v1/endpoint_service_test.rb | 684 + .../v1/evaluation_service_paths_test.rb | 55 + .../v1/evaluation_service_rest_test.rb | 154 + .../ai_platform/v1/evaluation_service_test.rb | 146 + ...ine_store_admin_service_operations_test.rb | 398 + ...e_online_store_admin_service_paths_test.rb | 91 + ...re_online_store_admin_service_rest_test.rb | 821 + ...feature_online_store_admin_service_test.rb | 938 ++ ...feature_online_store_service_paths_test.rb | 55 + .../feature_online_store_service_rest_test.rb | 211 + .../v1/feature_online_store_service_test.rb | 209 + ...eature_registry_service_operations_test.rb | 398 + .../v1/feature_registry_service_paths_test.rb | 94 + .../v1/feature_registry_service_rest_test.rb | 711 + .../v1/feature_registry_service_test.rb | 818 + ...store_online_serving_service_paths_test.rb | 55 + ...estore_online_serving_service_rest_test.rb | 266 + ...eaturestore_online_serving_service_test.rb | 284 + .../featurestore_service_operations_test.rb | 398 + .../v1/featurestore_service_paths_test.rb | 106 + .../v1/featurestore_service_rest_test.rb | 1281 ++ .../v1/featurestore_service_test.rb | 1498 ++ .../v1/gen_ai_cache_service_paths_test.rb | 79 + .../v1/gen_ai_cache_service_rest_test.rb | 373 + .../v1/gen_ai_cache_service_test.rb | 388 + .../gen_ai_tuning_service_operations_test.rb | 398 + .../v1/gen_ai_tuning_service_paths_test.rb | 118 + .../v1/gen_ai_tuning_service_rest_test.rb | 377 + .../v1/gen_ai_tuning_service_test.rb | 415 + .../index_endpoint_service_operations_test.rb | 398 + .../v1/index_endpoint_service_paths_test.rb | 91 + .../v1/index_endpoint_service_rest_test.rb | 540 + .../v1/index_endpoint_service_test.rb | 611 + .../v1/index_service_operations_test.rb | 398 + .../v1/index_service_paths_test.rb | 79 + .../ai_platform/v1/index_service_rest_test.rb | 486 + .../ai_platform/v1/index_service_test.rb | 543 + .../v1/job_service_operations_test.rb | 398 + .../ai_platform/v1/job_service_paths_test.rb | 262 + .../ai_platform/v1/job_service_rest_test.rb | 2030 +++ .../cloud/ai_platform/v1/job_service_test.rb | 2286 +++ .../v1/llm_utility_service_paths_test.rb | 70 + .../v1/llm_utility_service_rest_test.rb | 216 + .../v1/llm_utility_service_test.rb | 221 + .../v1/match_service_paths_test.rb | 55 + .../ai_platform/v1/match_service_rest_test.rb | 212 + .../ai_platform/v1/match_service_test.rb | 211 + .../v1/metadata_service_operations_test.rb | 398 + .../v1/metadata_service_paths_test.rb | 115 + .../v1/metadata_service_rest_test.rb | 1878 +++ .../ai_platform/v1/metadata_service_test.rb | 2122 +++ .../v1/migration_service_operations_test.rb | 398 + .../v1/migration_service_paths_test.rb | 106 + .../v1/migration_service_rest_test.rb | 211 + .../ai_platform/v1/migration_service_test.rb | 233 + .../v1/model_garden_service_paths_test.rb | 55 + .../v1/model_garden_service_rest_test.rb | 157 + .../v1/model_garden_service_test.rb | 151 + .../v1/model_service_operations_test.rb | 398 + .../v1/model_service_paths_test.rb | 130 + .../ai_platform/v1/model_service_rest_test.rb | 1103 ++ .../ai_platform/v1/model_service_test.rb | 1258 ++ .../v1/notebook_service_operations_test.rb | 398 + .../v1/notebook_service_paths_test.rb | 139 + .../v1/notebook_service_rest_test.rb | 987 ++ .../ai_platform/v1/notebook_service_test.rb | 1135 ++ ...istent_resource_service_operations_test.rb | 398 + .../persistent_resource_service_paths_test.rb | 91 + .../persistent_resource_service_rest_test.rb | 428 + .../v1/persistent_resource_service_test.rb | 482 + .../v1/pipeline_service_operations_test.rb | 398 + .../v1/pipeline_service_paths_test.rb | 166 + .../v1/pipeline_service_rest_test.rb | 761 + .../ai_platform/v1/pipeline_service_test.rb | 853 + .../v1/prediction_service_paths_test.rb | 82 + .../v1/prediction_service_rest_test.rb | 615 + .../ai_platform/v1/prediction_service_test.rb | 1082 ++ ...ing_engine_execution_service_paths_test.rb | 55 + ...ning_engine_execution_service_rest_test.rb | 211 + ...reasoning_engine_execution_service_test.rb | 224 + ...easoning_engine_service_operations_test.rb | 398 + .../v1/reasoning_engine_service_paths_test.rb | 67 + .../v1/reasoning_engine_service_rest_test.rb | 374 + .../v1/reasoning_engine_service_test.rb | 419 + .../v1/schedule_service_operations_test.rb | 398 + .../v1/schedule_service_paths_test.rb | 187 + .../v1/schedule_service_rest_test.rb | 484 + .../ai_platform/v1/schedule_service_test.rb | 529 + ...specialist_pool_service_operations_test.rb | 398 + .../v1/specialist_pool_service_paths_test.rb | 67 + .../v1/specialist_pool_service_rest_test.rb | 375 + .../v1/specialist_pool_service_test.rb | 421 + .../v1/tensorboard_service_operations_test.rb | 398 + .../v1/tensorboard_service_paths_test.rb | 103 + .../v1/tensorboard_service_rest_test.rb | 1762 +++ .../v1/tensorboard_service_test.rb | 1995 +++ ...vertex_rag_data_service_operations_test.rb | 398 + .../v1/vertex_rag_data_service_paths_test.rb | 118 + .../v1/vertex_rag_data_service_rest_test.rb | 648 + .../v1/vertex_rag_data_service_test.rb | 732 + .../v1/vertex_rag_service_paths_test.rb | 67 + .../v1/vertex_rag_service_rest_test.rb | 269 + .../ai_platform/v1/vertex_rag_service_test.rb | 278 + .../v1/vizier_service_operations_test.rb | 398 + .../v1/vizier_service_paths_test.rb | 91 + .../v1/vizier_service_rest_test.rb | 923 ++ .../ai_platform/v1/vizier_service_test.rb | 1017 ++ .../test/helper.rb | 25 + 1057 files changed, 369818 insertions(+) create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/README.md create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/google-cloud-ai_platform-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google-cloud-ai_platform-v1.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/api_auth_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/artifact_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/cached_content_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/content_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/context_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/custom_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_item_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/entity_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/env_var_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/event_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/execution_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_group_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/io_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_state_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/nas_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/network_spec_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_euc_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/openapi_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/operation_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reservation_affinity_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/saved_query_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/service_networking_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/study_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tool_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/types_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/value_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/httpbody.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation_spec.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/api_auth.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/cached_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/completion_stats.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/custom_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_item.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_labeling_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_model_ref.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/encryption_spec.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/entity_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/env_var.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluation_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/event.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_group.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_monitoring_stats.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_selector.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_monitoring.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/gen_ai_cache_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/hyperparameter_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/io.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_state.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/lineage_subgraph.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/llm_utility_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/match_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_schema.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migratable_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migration_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation_slice.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/nas_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/network_spec.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/openapi.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/operation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_failure_policy.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_state.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reservation_affinity.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/saved_query.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/types.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/unmanaged_container_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/value.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/vertex_rag_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/vizier_service.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/type/interval.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/delete_saved_query.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/export_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/get_annotation_spec.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/import_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/list_annotations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/list_data_items.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/list_dataset_versions.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/list_datasets.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/list_saved_queries.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/restore_dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/search_data_items.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/create_deployment_resource_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/delete_deployment_resource_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/get_deployment_resource_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/list_deployment_resource_pools.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/query_deployed_models.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/deployment_resource_pool_service/update_deployment_resource_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/create_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/delete_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/deploy_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/get_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/list_endpoints.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/mutate_deployed_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/undeploy_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint_long_running.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/evaluation_service/evaluate_instances.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/create_feature_online_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/create_feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/delete_feature_online_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/delete_feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/get_feature_online_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/get_feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/get_feature_view_sync.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/list_feature_online_stores.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/list_feature_view_syncs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/list_feature_views.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/sync_feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/update_feature_online_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_admin_service/update_feature_view.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_service/fetch_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_online_store_service/search_nearest_entities.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/batch_create_features.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/create_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/create_feature_group.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/delete_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/delete_feature_group.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/get_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/get_feature_group.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/list_feature_groups.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/list_features.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/update_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/feature_registry_service/update_feature_group.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/read_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/streaming_read_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/write_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_create_features.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_read_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/create_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/create_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/create_featurestore.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_featurestore.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/export_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/get_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/get_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/get_featurestore.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/import_feature_values.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/list_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/list_features.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/list_featurestores.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/search_features.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/update_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/update_feature.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/featurestore_service/update_featurestore.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_cache_service/create_cached_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_cache_service/delete_cached_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_cache_service/get_cached_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_cache_service/list_cached_contents.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_cache_service/update_cached_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_tuning_service/cancel_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_tuning_service/create_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_tuning_service/get_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_tuning_service/list_tuning_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/gen_ai_tuning_service/rebase_tuned_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/create_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/delete_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/deploy_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/get_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/list_index_endpoints.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/mutate_deployed_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/undeploy_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_endpoint_service/update_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/create_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/delete_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/get_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/list_indexes.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/remove_datapoints.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/update_index.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/index_service/upsert_datapoints.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/cancel_batch_prediction_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/cancel_custom_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/cancel_data_labeling_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/cancel_hyperparameter_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/cancel_nas_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_batch_prediction_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_custom_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_data_labeling_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_hyperparameter_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/create_nas_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_batch_prediction_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_custom_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_data_labeling_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_hyperparameter_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/delete_nas_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_batch_prediction_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_custom_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_data_labeling_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_hyperparameter_tuning_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_nas_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/get_nas_trial_detail.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_batch_prediction_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_custom_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_data_labeling_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_hyperparameter_tuning_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_model_deployment_monitoring_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_nas_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/list_nas_trial_details.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/pause_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/resume_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/search_model_deployment_monitoring_stats_anomalies.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/job_service/update_model_deployment_monitoring_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/llm_utility_service/compute_tokens.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/llm_utility_service/count_tokens.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/match_service/find_neighbors.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/match_service/read_index_datapoints.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_artifacts_and_executions.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_children.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/add_execution_events.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/create_artifact.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/create_context.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/create_execution.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_schema.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/delete_artifact.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/delete_context.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/delete_execution.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/delete_metadata_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/get_artifact.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/get_context.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/get_execution.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_schema.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_store.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/list_artifacts.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/list_contexts.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/list_executions.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_schemas.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_stores.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/purge_artifacts.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/purge_contexts.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/purge_executions.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/query_artifact_lineage_subgraph.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/query_context_lineage_subgraph.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/query_execution_inputs_and_outputs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/remove_context_children.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/update_artifact.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/update_context.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/metadata_service/update_execution.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/migration_service/batch_migrate_resources.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/migration_service/search_migratable_resources.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_garden_service/get_publisher_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/batch_import_evaluated_annotations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/batch_import_model_evaluation_slices.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/copy_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/delete_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/delete_model_version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/export_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/get_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation_slice.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/import_model_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluation_slices.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/list_model_versions.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/list_models.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/merge_version_aliases.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/update_explanation_dataset.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/update_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/model_service/upload_model.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/assign_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/create_notebook_execution_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/create_notebook_runtime_template.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/delete_notebook_execution_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/delete_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/delete_notebook_runtime_template.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/get_notebook_execution_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/get_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/get_notebook_runtime_template.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/list_notebook_execution_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/list_notebook_runtime_templates.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/list_notebook_runtimes.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/start_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/stop_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/update_notebook_runtime_template.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/notebook_service/upgrade_notebook_runtime.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/create_persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/delete_persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/get_persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/list_persistent_resources.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/reboot_persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/persistent_resource_service/update_persistent_resource.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/batch_cancel_pipeline_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/batch_delete_pipeline_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_pipeline_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_training_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/create_pipeline_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/create_training_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_pipeline_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_training_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/get_pipeline_job.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/get_training_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/list_pipeline_jobs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/pipeline_service/list_training_pipelines.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/direct_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/direct_raw_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/explain.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/generate_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/raw_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/server_streaming_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/stream_direct_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/stream_direct_raw_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/stream_generate_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/stream_raw_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/streaming_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/prediction_service/streaming_raw_predict.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/query_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/stream_query_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/create_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/delete_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/get_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/list_reasoning_engines.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/update_reasoning_engine.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/create_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/delete_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/get_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/list_schedules.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/pause_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/resume_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/schedule_service/update_schedule.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/specialist_pool_service/create_specialist_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/specialist_pool_service/delete_specialist_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/specialist_pool_service/get_specialist_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/specialist_pool_service/list_specialist_pools.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/specialist_pool_service/update_specialist_pool.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_runs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_read_tensorboard_time_series_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_experiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_run.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_experiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_run.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/export_tensorboard_time_series_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_experiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_run.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_experiments.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_runs.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboards.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_blob_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_size.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_time_series_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_usage.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_experiment.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_run.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_time_series.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_experiment_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_run_data.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/create_rag_corpus.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/delete_rag_corpus.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/delete_rag_file.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/get_rag_corpus.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/get_rag_file.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/import_rag_files.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/list_rag_corpora.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/list_rag_files.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/update_rag_corpus.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_data_service/upload_rag_file.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_service/augment_prompt.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_service/corroborate_content.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vertex_rag_service/retrieve_contexts.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/add_trial_measurement.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/check_trial_early_stopping_state.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/complete_trial.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/create_study.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/create_trial.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/delete_study.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/delete_trial.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/get_study.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/get_trial.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/list_optimal_trials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/list_studies.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/list_trials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/lookup_study.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/stop_trial.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/snippets/vizier_service/suggest_trials.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/dataset_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/dataset_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/dataset_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/dataset_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/deployment_resource_pool_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/deployment_resource_pool_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/deployment_resource_pool_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/deployment_resource_pool_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/endpoint_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/endpoint_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/endpoint_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/endpoint_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/evaluation_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/evaluation_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/evaluation_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_admin_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_admin_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_admin_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_admin_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_online_store_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_registry_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_registry_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_registry_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/feature_registry_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_online_serving_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_online_serving_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_online_serving_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_cache_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_cache_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_cache_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_tuning_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_tuning_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_tuning_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/gen_ai_tuning_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_endpoint_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_endpoint_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_endpoint_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_endpoint_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/index_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/job_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/job_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/job_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/job_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/llm_utility_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/llm_utility_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/llm_utility_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/match_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/match_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/match_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/metadata_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/metadata_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/metadata_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/metadata_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/migration_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/migration_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/migration_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/migration_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_garden_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_garden_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_garden_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/model_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/notebook_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/notebook_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/notebook_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/notebook_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/persistent_resource_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/persistent_resource_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/persistent_resource_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/persistent_resource_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/pipeline_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/pipeline_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/pipeline_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/pipeline_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/prediction_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/prediction_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/prediction_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/schedule_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/schedule_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/schedule_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/schedule_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/specialist_pool_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/specialist_pool_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/specialist_pool_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/specialist_pool_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/tensorboard_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/tensorboard_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/tensorboard_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/tensorboard_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_data_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_data_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_data_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_data_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vertex_rag_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vizier_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vizier_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vizier_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/vizier_service_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/.gitignore b/owl-bot-staging/google-cloud-ai_platform-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-ai_platform-v1/.repo-metadata.json new file mode 100644 index 000000000000..83f0386542cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "aiplatform.googleapis.com", + "api_shortname": "aiplatform", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest", + "distribution_name": "google-cloud-ai_platform-v1", + "is_cloud": true, + "language": "ruby", + "name": "aiplatform", + "name_pretty": "Vertex AI V1 API", + "product_documentation": "https://cloud.google.com/vertex-ai/docs/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research. Note that google-cloud-ai_platform-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-ai_platform instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/vertex-ai/docs/", + "ruby-cloud-service-override": "AiPlatform=AIPlatform", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/.rubocop.yml b/owl-bot-staging/google-cloud-ai_platform-v1/.rubocop.yml new file mode 100644 index 000000000000..437f598002d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-ai_platform-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-ai_platform-v1.rb" diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/.toys.rb b/owl-bot-staging/google-cloud-ai_platform-v1/.toys.rb new file mode 100644 index 000000000000..9a210f1427c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/.yardopts b/owl-bot-staging/google-cloud-ai_platform-v1/.yardopts new file mode 100644 index 000000000000..9bed2970282d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Vertex AI V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-ai_platform-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..3eccc0a9e0b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-ai_platform-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-ai_platform-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/ai_platform/v1" + +client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/ai_platform/v1" + +::Google::Cloud::AIPlatform::V1::DatasetService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-ai_platform-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/ai_platform/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-ai_platform-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/Gemfile b/owl-bot-staging/google-cloud-ai_platform-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/LICENSE.md b/owl-bot-staging/google-cloud-ai_platform-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/README.md b/owl-bot-staging/google-cloud-ai_platform-v1/README.md new file mode 100644 index 000000000000..9202af993225 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Vertex AI V1 API + +Train high-quality custom machine learning models with minimal machine learning expertise and effort. + +Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Vertex AI V1 API. Most users should consider using +the main client gem, +[google-cloud-ai_platform](https://rubygems.org/gems/google-cloud-ai_platform). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-ai_platform-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/ai_platform/v1" + +client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new +request = ::Google::Cloud::AIPlatform::V1::CreateDatasetRequest.new # (request fields as keyword arguments...) +response = client.create_dataset request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vertex-ai/docs/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/ai_platform/v1" +require "logger" + +client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-ai_platform`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-ai_platform-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-ai_platform`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-ai_platform-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/Rakefile b/owl-bot-staging/google-cloud-ai_platform-v1/Rakefile new file mode 100644 index 000000000000..d28d79cfdb1f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-ai_platform-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/ai_platform/v1/dataset_service/credentials" + ::Google::Cloud::AIPlatform::V1::DatasetService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-ai_platform-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-ai_platform-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-ai_platform-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-ai_platform-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-ai_platform-v1" + header "google-cloud-ai_platform-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-ai_platform-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-ai_platform-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-ai_platform-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-ai_platform-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-ai_platform-v1/gapic_metadata.json new file mode 100644 index 000000000000..f16c998d857b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/gapic_metadata.json @@ -0,0 +1,1927 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.aiplatform.v1", + "libraryPackage": "::Google::Cloud::AIPlatform::V1", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::DatasetService::Client", + "rpcs": { + "CreateDataset": { + "methods": [ + "create_dataset" + ] + }, + "GetDataset": { + "methods": [ + "get_dataset" + ] + }, + "UpdateDataset": { + "methods": [ + "update_dataset" + ] + }, + "ListDatasets": { + "methods": [ + "list_datasets" + ] + }, + "DeleteDataset": { + "methods": [ + "delete_dataset" + ] + }, + "ImportData": { + "methods": [ + "import_data" + ] + }, + "ExportData": { + "methods": [ + "export_data" + ] + }, + "CreateDatasetVersion": { + "methods": [ + "create_dataset_version" + ] + }, + "UpdateDatasetVersion": { + "methods": [ + "update_dataset_version" + ] + }, + "DeleteDatasetVersion": { + "methods": [ + "delete_dataset_version" + ] + }, + "GetDatasetVersion": { + "methods": [ + "get_dataset_version" + ] + }, + "ListDatasetVersions": { + "methods": [ + "list_dataset_versions" + ] + }, + "RestoreDatasetVersion": { + "methods": [ + "restore_dataset_version" + ] + }, + "ListDataItems": { + "methods": [ + "list_data_items" + ] + }, + "SearchDataItems": { + "methods": [ + "search_data_items" + ] + }, + "ListSavedQueries": { + "methods": [ + "list_saved_queries" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "delete_saved_query" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "get_annotation_spec" + ] + }, + "ListAnnotations": { + "methods": [ + "list_annotations" + ] + } + } + } + } + }, + "DeploymentResourcePoolService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client", + "rpcs": { + "CreateDeploymentResourcePool": { + "methods": [ + "create_deployment_resource_pool" + ] + }, + "GetDeploymentResourcePool": { + "methods": [ + "get_deployment_resource_pool" + ] + }, + "ListDeploymentResourcePools": { + "methods": [ + "list_deployment_resource_pools" + ] + }, + "UpdateDeploymentResourcePool": { + "methods": [ + "update_deployment_resource_pool" + ] + }, + "DeleteDeploymentResourcePool": { + "methods": [ + "delete_deployment_resource_pool" + ] + }, + "QueryDeployedModels": { + "methods": [ + "query_deployed_models" + ] + } + } + } + } + }, + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::EndpointService::Client", + "rpcs": { + "CreateEndpoint": { + "methods": [ + "create_endpoint" + ] + }, + "GetEndpoint": { + "methods": [ + "get_endpoint" + ] + }, + "ListEndpoints": { + "methods": [ + "list_endpoints" + ] + }, + "UpdateEndpoint": { + "methods": [ + "update_endpoint" + ] + }, + "UpdateEndpointLongRunning": { + "methods": [ + "update_endpoint_long_running" + ] + }, + "DeleteEndpoint": { + "methods": [ + "delete_endpoint" + ] + }, + "DeployModel": { + "methods": [ + "deploy_model" + ] + }, + "UndeployModel": { + "methods": [ + "undeploy_model" + ] + }, + "MutateDeployedModel": { + "methods": [ + "mutate_deployed_model" + ] + } + } + } + } + }, + "EvaluationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::EvaluationService::Client", + "rpcs": { + "EvaluateInstances": { + "methods": [ + "evaluate_instances" + ] + } + } + } + } + }, + "FeatureOnlineStoreAdminService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client", + "rpcs": { + "CreateFeatureOnlineStore": { + "methods": [ + "create_feature_online_store" + ] + }, + "GetFeatureOnlineStore": { + "methods": [ + "get_feature_online_store" + ] + }, + "ListFeatureOnlineStores": { + "methods": [ + "list_feature_online_stores" + ] + }, + "UpdateFeatureOnlineStore": { + "methods": [ + "update_feature_online_store" + ] + }, + "DeleteFeatureOnlineStore": { + "methods": [ + "delete_feature_online_store" + ] + }, + "CreateFeatureView": { + "methods": [ + "create_feature_view" + ] + }, + "GetFeatureView": { + "methods": [ + "get_feature_view" + ] + }, + "ListFeatureViews": { + "methods": [ + "list_feature_views" + ] + }, + "UpdateFeatureView": { + "methods": [ + "update_feature_view" + ] + }, + "DeleteFeatureView": { + "methods": [ + "delete_feature_view" + ] + }, + "SyncFeatureView": { + "methods": [ + "sync_feature_view" + ] + }, + "GetFeatureViewSync": { + "methods": [ + "get_feature_view_sync" + ] + }, + "ListFeatureViewSyncs": { + "methods": [ + "list_feature_view_syncs" + ] + } + } + } + } + }, + "FeaturestoreOnlineServingService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "read_feature_values" + ] + }, + "StreamingReadFeatureValues": { + "methods": [ + "streaming_read_feature_values" + ] + }, + "WriteFeatureValues": { + "methods": [ + "write_feature_values" + ] + } + } + } + } + }, + "FeatureOnlineStoreService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client", + "rpcs": { + "FetchFeatureValues": { + "methods": [ + "fetch_feature_values" + ] + }, + "SearchNearestEntities": { + "methods": [ + "search_nearest_entities" + ] + } + } + } + } + }, + "FeaturestoreService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client", + "rpcs": { + "CreateFeaturestore": { + "methods": [ + "create_featurestore" + ] + }, + "GetFeaturestore": { + "methods": [ + "get_featurestore" + ] + }, + "ListFeaturestores": { + "methods": [ + "list_featurestores" + ] + }, + "UpdateFeaturestore": { + "methods": [ + "update_featurestore" + ] + }, + "DeleteFeaturestore": { + "methods": [ + "delete_featurestore" + ] + }, + "CreateEntityType": { + "methods": [ + "create_entity_type" + ] + }, + "GetEntityType": { + "methods": [ + "get_entity_type" + ] + }, + "ListEntityTypes": { + "methods": [ + "list_entity_types" + ] + }, + "UpdateEntityType": { + "methods": [ + "update_entity_type" + ] + }, + "DeleteEntityType": { + "methods": [ + "delete_entity_type" + ] + }, + "CreateFeature": { + "methods": [ + "create_feature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batch_create_features" + ] + }, + "GetFeature": { + "methods": [ + "get_feature" + ] + }, + "ListFeatures": { + "methods": [ + "list_features" + ] + }, + "UpdateFeature": { + "methods": [ + "update_feature" + ] + }, + "DeleteFeature": { + "methods": [ + "delete_feature" + ] + }, + "ImportFeatureValues": { + "methods": [ + "import_feature_values" + ] + }, + "BatchReadFeatureValues": { + "methods": [ + "batch_read_feature_values" + ] + }, + "ExportFeatureValues": { + "methods": [ + "export_feature_values" + ] + }, + "DeleteFeatureValues": { + "methods": [ + "delete_feature_values" + ] + }, + "SearchFeatures": { + "methods": [ + "search_features" + ] + } + } + } + } + }, + "FeatureRegistryService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client", + "rpcs": { + "CreateFeatureGroup": { + "methods": [ + "create_feature_group" + ] + }, + "GetFeatureGroup": { + "methods": [ + "get_feature_group" + ] + }, + "ListFeatureGroups": { + "methods": [ + "list_feature_groups" + ] + }, + "UpdateFeatureGroup": { + "methods": [ + "update_feature_group" + ] + }, + "DeleteFeatureGroup": { + "methods": [ + "delete_feature_group" + ] + }, + "CreateFeature": { + "methods": [ + "create_feature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batch_create_features" + ] + }, + "GetFeature": { + "methods": [ + "get_feature" + ] + }, + "ListFeatures": { + "methods": [ + "list_features" + ] + }, + "UpdateFeature": { + "methods": [ + "update_feature" + ] + }, + "DeleteFeature": { + "methods": [ + "delete_feature" + ] + } + } + } + } + }, + "GenAiCacheService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client", + "rpcs": { + "CreateCachedContent": { + "methods": [ + "create_cached_content" + ] + }, + "GetCachedContent": { + "methods": [ + "get_cached_content" + ] + }, + "UpdateCachedContent": { + "methods": [ + "update_cached_content" + ] + }, + "DeleteCachedContent": { + "methods": [ + "delete_cached_content" + ] + }, + "ListCachedContents": { + "methods": [ + "list_cached_contents" + ] + } + } + } + } + }, + "GenAiTuningService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client", + "rpcs": { + "CreateTuningJob": { + "methods": [ + "create_tuning_job" + ] + }, + "GetTuningJob": { + "methods": [ + "get_tuning_job" + ] + }, + "ListTuningJobs": { + "methods": [ + "list_tuning_jobs" + ] + }, + "CancelTuningJob": { + "methods": [ + "cancel_tuning_job" + ] + }, + "RebaseTunedModel": { + "methods": [ + "rebase_tuned_model" + ] + } + } + } + } + }, + "IndexEndpointService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client", + "rpcs": { + "CreateIndexEndpoint": { + "methods": [ + "create_index_endpoint" + ] + }, + "GetIndexEndpoint": { + "methods": [ + "get_index_endpoint" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "list_index_endpoints" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "update_index_endpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "delete_index_endpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deploy_index" + ] + }, + "UndeployIndex": { + "methods": [ + "undeploy_index" + ] + }, + "MutateDeployedIndex": { + "methods": [ + "mutate_deployed_index" + ] + } + } + } + } + }, + "IndexService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::IndexService::Client", + "rpcs": { + "CreateIndex": { + "methods": [ + "create_index" + ] + }, + "GetIndex": { + "methods": [ + "get_index" + ] + }, + "ListIndexes": { + "methods": [ + "list_indexes" + ] + }, + "UpdateIndex": { + "methods": [ + "update_index" + ] + }, + "DeleteIndex": { + "methods": [ + "delete_index" + ] + }, + "UpsertDatapoints": { + "methods": [ + "upsert_datapoints" + ] + }, + "RemoveDatapoints": { + "methods": [ + "remove_datapoints" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::JobService::Client", + "rpcs": { + "CreateCustomJob": { + "methods": [ + "create_custom_job" + ] + }, + "GetCustomJob": { + "methods": [ + "get_custom_job" + ] + }, + "ListCustomJobs": { + "methods": [ + "list_custom_jobs" + ] + }, + "DeleteCustomJob": { + "methods": [ + "delete_custom_job" + ] + }, + "CancelCustomJob": { + "methods": [ + "cancel_custom_job" + ] + }, + "CreateDataLabelingJob": { + "methods": [ + "create_data_labeling_job" + ] + }, + "GetDataLabelingJob": { + "methods": [ + "get_data_labeling_job" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "list_data_labeling_jobs" + ] + }, + "DeleteDataLabelingJob": { + "methods": [ + "delete_data_labeling_job" + ] + }, + "CancelDataLabelingJob": { + "methods": [ + "cancel_data_labeling_job" + ] + }, + "CreateHyperparameterTuningJob": { + "methods": [ + "create_hyperparameter_tuning_job" + ] + }, + "GetHyperparameterTuningJob": { + "methods": [ + "get_hyperparameter_tuning_job" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "list_hyperparameter_tuning_jobs" + ] + }, + "DeleteHyperparameterTuningJob": { + "methods": [ + "delete_hyperparameter_tuning_job" + ] + }, + "CancelHyperparameterTuningJob": { + "methods": [ + "cancel_hyperparameter_tuning_job" + ] + }, + "CreateNasJob": { + "methods": [ + "create_nas_job" + ] + }, + "GetNasJob": { + "methods": [ + "get_nas_job" + ] + }, + "ListNasJobs": { + "methods": [ + "list_nas_jobs" + ] + }, + "DeleteNasJob": { + "methods": [ + "delete_nas_job" + ] + }, + "CancelNasJob": { + "methods": [ + "cancel_nas_job" + ] + }, + "GetNasTrialDetail": { + "methods": [ + "get_nas_trial_detail" + ] + }, + "ListNasTrialDetails": { + "methods": [ + "list_nas_trial_details" + ] + }, + "CreateBatchPredictionJob": { + "methods": [ + "create_batch_prediction_job" + ] + }, + "GetBatchPredictionJob": { + "methods": [ + "get_batch_prediction_job" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "list_batch_prediction_jobs" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "delete_batch_prediction_job" + ] + }, + "CancelBatchPredictionJob": { + "methods": [ + "cancel_batch_prediction_job" + ] + }, + "CreateModelDeploymentMonitoringJob": { + "methods": [ + "create_model_deployment_monitoring_job" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "search_model_deployment_monitoring_stats_anomalies" + ] + }, + "GetModelDeploymentMonitoringJob": { + "methods": [ + "get_model_deployment_monitoring_job" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "list_model_deployment_monitoring_jobs" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "update_model_deployment_monitoring_job" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "delete_model_deployment_monitoring_job" + ] + }, + "PauseModelDeploymentMonitoringJob": { + "methods": [ + "pause_model_deployment_monitoring_job" + ] + }, + "ResumeModelDeploymentMonitoringJob": { + "methods": [ + "resume_model_deployment_monitoring_job" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::PredictionService::Client", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "RawPredict": { + "methods": [ + "raw_predict" + ] + }, + "StreamRawPredict": { + "methods": [ + "stream_raw_predict" + ] + }, + "DirectPredict": { + "methods": [ + "direct_predict" + ] + }, + "DirectRawPredict": { + "methods": [ + "direct_raw_predict" + ] + }, + "StreamDirectPredict": { + "methods": [ + "stream_direct_predict" + ] + }, + "StreamDirectRawPredict": { + "methods": [ + "stream_direct_raw_predict" + ] + }, + "StreamingPredict": { + "methods": [ + "streaming_predict" + ] + }, + "ServerStreamingPredict": { + "methods": [ + "server_streaming_predict" + ] + }, + "StreamingRawPredict": { + "methods": [ + "streaming_raw_predict" + ] + }, + "Explain": { + "methods": [ + "explain" + ] + }, + "GenerateContent": { + "methods": [ + "generate_content" + ] + }, + "StreamGenerateContent": { + "methods": [ + "stream_generate_content" + ] + } + } + } + } + }, + "LlmUtilityService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client", + "rpcs": { + "CountTokens": { + "methods": [ + "count_tokens" + ] + }, + "ComputeTokens": { + "methods": [ + "compute_tokens" + ] + } + } + } + } + }, + "MatchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::MatchService::Client", + "rpcs": { + "FindNeighbors": { + "methods": [ + "find_neighbors" + ] + }, + "ReadIndexDatapoints": { + "methods": [ + "read_index_datapoints" + ] + } + } + } + } + }, + "MetadataService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::MetadataService::Client", + "rpcs": { + "CreateMetadataStore": { + "methods": [ + "create_metadata_store" + ] + }, + "GetMetadataStore": { + "methods": [ + "get_metadata_store" + ] + }, + "ListMetadataStores": { + "methods": [ + "list_metadata_stores" + ] + }, + "DeleteMetadataStore": { + "methods": [ + "delete_metadata_store" + ] + }, + "CreateArtifact": { + "methods": [ + "create_artifact" + ] + }, + "GetArtifact": { + "methods": [ + "get_artifact" + ] + }, + "ListArtifacts": { + "methods": [ + "list_artifacts" + ] + }, + "UpdateArtifact": { + "methods": [ + "update_artifact" + ] + }, + "DeleteArtifact": { + "methods": [ + "delete_artifact" + ] + }, + "PurgeArtifacts": { + "methods": [ + "purge_artifacts" + ] + }, + "CreateContext": { + "methods": [ + "create_context" + ] + }, + "GetContext": { + "methods": [ + "get_context" + ] + }, + "ListContexts": { + "methods": [ + "list_contexts" + ] + }, + "UpdateContext": { + "methods": [ + "update_context" + ] + }, + "DeleteContext": { + "methods": [ + "delete_context" + ] + }, + "PurgeContexts": { + "methods": [ + "purge_contexts" + ] + }, + "AddContextArtifactsAndExecutions": { + "methods": [ + "add_context_artifacts_and_executions" + ] + }, + "AddContextChildren": { + "methods": [ + "add_context_children" + ] + }, + "RemoveContextChildren": { + "methods": [ + "remove_context_children" + ] + }, + "QueryContextLineageSubgraph": { + "methods": [ + "query_context_lineage_subgraph" + ] + }, + "CreateExecution": { + "methods": [ + "create_execution" + ] + }, + "GetExecution": { + "methods": [ + "get_execution" + ] + }, + "ListExecutions": { + "methods": [ + "list_executions" + ] + }, + "UpdateExecution": { + "methods": [ + "update_execution" + ] + }, + "DeleteExecution": { + "methods": [ + "delete_execution" + ] + }, + "PurgeExecutions": { + "methods": [ + "purge_executions" + ] + }, + "AddExecutionEvents": { + "methods": [ + "add_execution_events" + ] + }, + "QueryExecutionInputsAndOutputs": { + "methods": [ + "query_execution_inputs_and_outputs" + ] + }, + "CreateMetadataSchema": { + "methods": [ + "create_metadata_schema" + ] + }, + "GetMetadataSchema": { + "methods": [ + "get_metadata_schema" + ] + }, + "ListMetadataSchemas": { + "methods": [ + "list_metadata_schemas" + ] + }, + "QueryArtifactLineageSubgraph": { + "methods": [ + "query_artifact_lineage_subgraph" + ] + } + } + } + } + }, + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::MigrationService::Client", + "rpcs": { + "SearchMigratableResources": { + "methods": [ + "search_migratable_resources" + ] + }, + "BatchMigrateResources": { + "methods": [ + "batch_migrate_resources" + ] + } + } + } + } + }, + "ModelGardenService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ModelGardenService::Client", + "rpcs": { + "GetPublisherModel": { + "methods": [ + "get_publisher_model" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ModelService::Client", + "rpcs": { + "UploadModel": { + "methods": [ + "upload_model" + ] + }, + "GetModel": { + "methods": [ + "get_model" + ] + }, + "ListModels": { + "methods": [ + "list_models" + ] + }, + "ListModelVersions": { + "methods": [ + "list_model_versions" + ] + }, + "UpdateModel": { + "methods": [ + "update_model" + ] + }, + "UpdateExplanationDataset": { + "methods": [ + "update_explanation_dataset" + ] + }, + "DeleteModel": { + "methods": [ + "delete_model" + ] + }, + "DeleteModelVersion": { + "methods": [ + "delete_model_version" + ] + }, + "MergeVersionAliases": { + "methods": [ + "merge_version_aliases" + ] + }, + "ExportModel": { + "methods": [ + "export_model" + ] + }, + "CopyModel": { + "methods": [ + "copy_model" + ] + }, + "ImportModelEvaluation": { + "methods": [ + "import_model_evaluation" + ] + }, + "BatchImportModelEvaluationSlices": { + "methods": [ + "batch_import_model_evaluation_slices" + ] + }, + "BatchImportEvaluatedAnnotations": { + "methods": [ + "batch_import_evaluated_annotations" + ] + }, + "GetModelEvaluation": { + "methods": [ + "get_model_evaluation" + ] + }, + "ListModelEvaluations": { + "methods": [ + "list_model_evaluations" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "get_model_evaluation_slice" + ] + }, + "ListModelEvaluationSlices": { + "methods": [ + "list_model_evaluation_slices" + ] + } + } + } + } + }, + "NotebookService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::NotebookService::Client", + "rpcs": { + "CreateNotebookRuntimeTemplate": { + "methods": [ + "create_notebook_runtime_template" + ] + }, + "GetNotebookRuntimeTemplate": { + "methods": [ + "get_notebook_runtime_template" + ] + }, + "ListNotebookRuntimeTemplates": { + "methods": [ + "list_notebook_runtime_templates" + ] + }, + "DeleteNotebookRuntimeTemplate": { + "methods": [ + "delete_notebook_runtime_template" + ] + }, + "UpdateNotebookRuntimeTemplate": { + "methods": [ + "update_notebook_runtime_template" + ] + }, + "AssignNotebookRuntime": { + "methods": [ + "assign_notebook_runtime" + ] + }, + "GetNotebookRuntime": { + "methods": [ + "get_notebook_runtime" + ] + }, + "ListNotebookRuntimes": { + "methods": [ + "list_notebook_runtimes" + ] + }, + "DeleteNotebookRuntime": { + "methods": [ + "delete_notebook_runtime" + ] + }, + "UpgradeNotebookRuntime": { + "methods": [ + "upgrade_notebook_runtime" + ] + }, + "StartNotebookRuntime": { + "methods": [ + "start_notebook_runtime" + ] + }, + "StopNotebookRuntime": { + "methods": [ + "stop_notebook_runtime" + ] + }, + "CreateNotebookExecutionJob": { + "methods": [ + "create_notebook_execution_job" + ] + }, + "GetNotebookExecutionJob": { + "methods": [ + "get_notebook_execution_job" + ] + }, + "ListNotebookExecutionJobs": { + "methods": [ + "list_notebook_execution_jobs" + ] + }, + "DeleteNotebookExecutionJob": { + "methods": [ + "delete_notebook_execution_job" + ] + } + } + } + } + }, + "PersistentResourceService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client", + "rpcs": { + "CreatePersistentResource": { + "methods": [ + "create_persistent_resource" + ] + }, + "GetPersistentResource": { + "methods": [ + "get_persistent_resource" + ] + }, + "ListPersistentResources": { + "methods": [ + "list_persistent_resources" + ] + }, + "DeletePersistentResource": { + "methods": [ + "delete_persistent_resource" + ] + }, + "UpdatePersistentResource": { + "methods": [ + "update_persistent_resource" + ] + }, + "RebootPersistentResource": { + "methods": [ + "reboot_persistent_resource" + ] + } + } + } + } + }, + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::PipelineService::Client", + "rpcs": { + "CreateTrainingPipeline": { + "methods": [ + "create_training_pipeline" + ] + }, + "GetTrainingPipeline": { + "methods": [ + "get_training_pipeline" + ] + }, + "ListTrainingPipelines": { + "methods": [ + "list_training_pipelines" + ] + }, + "DeleteTrainingPipeline": { + "methods": [ + "delete_training_pipeline" + ] + }, + "CancelTrainingPipeline": { + "methods": [ + "cancel_training_pipeline" + ] + }, + "CreatePipelineJob": { + "methods": [ + "create_pipeline_job" + ] + }, + "GetPipelineJob": { + "methods": [ + "get_pipeline_job" + ] + }, + "ListPipelineJobs": { + "methods": [ + "list_pipeline_jobs" + ] + }, + "DeletePipelineJob": { + "methods": [ + "delete_pipeline_job" + ] + }, + "BatchDeletePipelineJobs": { + "methods": [ + "batch_delete_pipeline_jobs" + ] + }, + "CancelPipelineJob": { + "methods": [ + "cancel_pipeline_job" + ] + }, + "BatchCancelPipelineJobs": { + "methods": [ + "batch_cancel_pipeline_jobs" + ] + } + } + } + } + }, + "ReasoningEngineExecutionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client", + "rpcs": { + "QueryReasoningEngine": { + "methods": [ + "query_reasoning_engine" + ] + }, + "StreamQueryReasoningEngine": { + "methods": [ + "stream_query_reasoning_engine" + ] + } + } + } + } + }, + "ReasoningEngineService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client", + "rpcs": { + "CreateReasoningEngine": { + "methods": [ + "create_reasoning_engine" + ] + }, + "GetReasoningEngine": { + "methods": [ + "get_reasoning_engine" + ] + }, + "ListReasoningEngines": { + "methods": [ + "list_reasoning_engines" + ] + }, + "UpdateReasoningEngine": { + "methods": [ + "update_reasoning_engine" + ] + }, + "DeleteReasoningEngine": { + "methods": [ + "delete_reasoning_engine" + ] + } + } + } + } + }, + "ScheduleService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ScheduleService::Client", + "rpcs": { + "CreateSchedule": { + "methods": [ + "create_schedule" + ] + }, + "DeleteSchedule": { + "methods": [ + "delete_schedule" + ] + }, + "GetSchedule": { + "methods": [ + "get_schedule" + ] + }, + "ListSchedules": { + "methods": [ + "list_schedules" + ] + }, + "PauseSchedule": { + "methods": [ + "pause_schedule" + ] + }, + "ResumeSchedule": { + "methods": [ + "resume_schedule" + ] + }, + "UpdateSchedule": { + "methods": [ + "update_schedule" + ] + } + } + } + } + }, + "SpecialistPoolService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client", + "rpcs": { + "CreateSpecialistPool": { + "methods": [ + "create_specialist_pool" + ] + }, + "GetSpecialistPool": { + "methods": [ + "get_specialist_pool" + ] + }, + "ListSpecialistPools": { + "methods": [ + "list_specialist_pools" + ] + }, + "DeleteSpecialistPool": { + "methods": [ + "delete_specialist_pool" + ] + }, + "UpdateSpecialistPool": { + "methods": [ + "update_specialist_pool" + ] + } + } + } + } + }, + "TensorboardService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::TensorboardService::Client", + "rpcs": { + "CreateTensorboard": { + "methods": [ + "create_tensorboard" + ] + }, + "GetTensorboard": { + "methods": [ + "get_tensorboard" + ] + }, + "UpdateTensorboard": { + "methods": [ + "update_tensorboard" + ] + }, + "ListTensorboards": { + "methods": [ + "list_tensorboards" + ] + }, + "DeleteTensorboard": { + "methods": [ + "delete_tensorboard" + ] + }, + "ReadTensorboardUsage": { + "methods": [ + "read_tensorboard_usage" + ] + }, + "ReadTensorboardSize": { + "methods": [ + "read_tensorboard_size" + ] + }, + "CreateTensorboardExperiment": { + "methods": [ + "create_tensorboard_experiment" + ] + }, + "GetTensorboardExperiment": { + "methods": [ + "get_tensorboard_experiment" + ] + }, + "UpdateTensorboardExperiment": { + "methods": [ + "update_tensorboard_experiment" + ] + }, + "ListTensorboardExperiments": { + "methods": [ + "list_tensorboard_experiments" + ] + }, + "DeleteTensorboardExperiment": { + "methods": [ + "delete_tensorboard_experiment" + ] + }, + "CreateTensorboardRun": { + "methods": [ + "create_tensorboard_run" + ] + }, + "BatchCreateTensorboardRuns": { + "methods": [ + "batch_create_tensorboard_runs" + ] + }, + "GetTensorboardRun": { + "methods": [ + "get_tensorboard_run" + ] + }, + "UpdateTensorboardRun": { + "methods": [ + "update_tensorboard_run" + ] + }, + "ListTensorboardRuns": { + "methods": [ + "list_tensorboard_runs" + ] + }, + "DeleteTensorboardRun": { + "methods": [ + "delete_tensorboard_run" + ] + }, + "BatchCreateTensorboardTimeSeries": { + "methods": [ + "batch_create_tensorboard_time_series" + ] + }, + "CreateTensorboardTimeSeries": { + "methods": [ + "create_tensorboard_time_series" + ] + }, + "GetTensorboardTimeSeries": { + "methods": [ + "get_tensorboard_time_series" + ] + }, + "UpdateTensorboardTimeSeries": { + "methods": [ + "update_tensorboard_time_series" + ] + }, + "ListTensorboardTimeSeries": { + "methods": [ + "list_tensorboard_time_series" + ] + }, + "DeleteTensorboardTimeSeries": { + "methods": [ + "delete_tensorboard_time_series" + ] + }, + "BatchReadTensorboardTimeSeriesData": { + "methods": [ + "batch_read_tensorboard_time_series_data" + ] + }, + "ReadTensorboardTimeSeriesData": { + "methods": [ + "read_tensorboard_time_series_data" + ] + }, + "ReadTensorboardBlobData": { + "methods": [ + "read_tensorboard_blob_data" + ] + }, + "WriteTensorboardExperimentData": { + "methods": [ + "write_tensorboard_experiment_data" + ] + }, + "WriteTensorboardRunData": { + "methods": [ + "write_tensorboard_run_data" + ] + }, + "ExportTensorboardTimeSeriesData": { + "methods": [ + "export_tensorboard_time_series_data" + ] + } + } + } + } + }, + "VertexRagDataService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client", + "rpcs": { + "CreateRagCorpus": { + "methods": [ + "create_rag_corpus" + ] + }, + "UpdateRagCorpus": { + "methods": [ + "update_rag_corpus" + ] + }, + "GetRagCorpus": { + "methods": [ + "get_rag_corpus" + ] + }, + "ListRagCorpora": { + "methods": [ + "list_rag_corpora" + ] + }, + "DeleteRagCorpus": { + "methods": [ + "delete_rag_corpus" + ] + }, + "UploadRagFile": { + "methods": [ + "upload_rag_file" + ] + }, + "ImportRagFiles": { + "methods": [ + "import_rag_files" + ] + }, + "GetRagFile": { + "methods": [ + "get_rag_file" + ] + }, + "ListRagFiles": { + "methods": [ + "list_rag_files" + ] + }, + "DeleteRagFile": { + "methods": [ + "delete_rag_file" + ] + } + } + } + } + }, + "VertexRagService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::VertexRagService::Client", + "rpcs": { + "RetrieveContexts": { + "methods": [ + "retrieve_contexts" + ] + }, + "AugmentPrompt": { + "methods": [ + "augment_prompt" + ] + }, + "CorroborateContent": { + "methods": [ + "corroborate_content" + ] + } + } + } + } + }, + "VizierService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::VizierService::Client", + "rpcs": { + "CreateStudy": { + "methods": [ + "create_study" + ] + }, + "GetStudy": { + "methods": [ + "get_study" + ] + }, + "ListStudies": { + "methods": [ + "list_studies" + ] + }, + "DeleteStudy": { + "methods": [ + "delete_study" + ] + }, + "LookupStudy": { + "methods": [ + "lookup_study" + ] + }, + "SuggestTrials": { + "methods": [ + "suggest_trials" + ] + }, + "CreateTrial": { + "methods": [ + "create_trial" + ] + }, + "GetTrial": { + "methods": [ + "get_trial" + ] + }, + "ListTrials": { + "methods": [ + "list_trials" + ] + }, + "AddTrialMeasurement": { + "methods": [ + "add_trial_measurement" + ] + }, + "CompleteTrial": { + "methods": [ + "complete_trial" + ] + }, + "DeleteTrial": { + "methods": [ + "delete_trial" + ] + }, + "CheckTrialEarlyStoppingState": { + "methods": [ + "check_trial_early_stopping_state" + ] + }, + "StopTrial": { + "methods": [ + "stop_trial" + ] + }, + "ListOptimalTrials": { + "methods": [ + "list_optimal_trials" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/google-cloud-ai_platform-v1.gemspec b/owl-bot-staging/google-cloud-ai_platform-v1/google-cloud-ai_platform-v1.gemspec new file mode 100644 index 000000000000..bf01f96ebf10 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/google-cloud-ai_platform-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/ai_platform/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-ai_platform-v1" + gem.version = Google::Cloud::AIPlatform::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research. Note that google-cloud-ai_platform-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-ai_platform instead. See the readme for more details." + gem.summary = "Train high-quality custom machine learning models with minimal machine learning expertise and effort." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.24.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google-cloud-ai_platform-v1.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google-cloud-ai_platform-v1.rb new file mode 100644 index 000000000000..b01ceb6844cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google-cloud-ai_platform-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/ai_platform/v1" diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb new file mode 100644 index 000000000000..d51df0285466 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/ai_platform/v1/dataset_service" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service" +require "google/cloud/ai_platform/v1/endpoint_service" +require "google/cloud/ai_platform/v1/evaluation_service" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service" +require "google/cloud/ai_platform/v1/feature_online_store_service" +require "google/cloud/ai_platform/v1/featurestore_service" +require "google/cloud/ai_platform/v1/feature_registry_service" +require "google/cloud/ai_platform/v1/gen_ai_cache_service" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service" +require "google/cloud/ai_platform/v1/index_endpoint_service" +require "google/cloud/ai_platform/v1/index_service" +require "google/cloud/ai_platform/v1/job_service" +require "google/cloud/ai_platform/v1/prediction_service" +require "google/cloud/ai_platform/v1/llm_utility_service" +require "google/cloud/ai_platform/v1/match_service" +require "google/cloud/ai_platform/v1/metadata_service" +require "google/cloud/ai_platform/v1/migration_service" +require "google/cloud/ai_platform/v1/model_garden_service" +require "google/cloud/ai_platform/v1/model_service" +require "google/cloud/ai_platform/v1/notebook_service" +require "google/cloud/ai_platform/v1/persistent_resource_service" +require "google/cloud/ai_platform/v1/pipeline_service" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" +require "google/cloud/ai_platform/v1/reasoning_engine_service" +require "google/cloud/ai_platform/v1/schedule_service" +require "google/cloud/ai_platform/v1/specialist_pool_service" +require "google/cloud/ai_platform/v1/tensorboard_service" +require "google/cloud/ai_platform/v1/vertex_rag_data_service" +require "google/cloud/ai_platform/v1/vertex_rag_service" +require "google/cloud/ai_platform/v1/vizier_service" +require "google/cloud/ai_platform/v1/version" + +module Google + module Cloud + module AIPlatform + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/ai_platform/v1" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/ai_platform/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/bindings_override.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/bindings_override.rb new file mode 100644 index 000000000000..0715c283bb01 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/bindings_override.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module AIPlatform + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/ai_platform/v1/rest" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform"] + 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 = Configuration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/ui/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/ui/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.cloud.aiplatform.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.aiplatform.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service.rb new file mode 100644 index 000000000000..1f1e261114ad --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/dataset_service/credentials" +require "google/cloud/ai_platform/v1/dataset_service/paths" +require "google/cloud/ai_platform/v1/dataset_service/operations" +require "google/cloud/ai_platform/v1/dataset_service/client" +require "google/cloud/ai_platform/v1/dataset_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that manages Vertex AI Dataset and its child resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/dataset_service" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/dataset_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + module DatasetService + end + end + end + end +end + +helper_path = ::File.join __dir__, "dataset_service", "helpers.rb" +require "google/cloud/ai_platform/v1/dataset_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/client.rb new file mode 100644 index 000000000000..af6d7586df36 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/client.rb @@ -0,0 +1,2455 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/dataset_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + ## + # Client for the DatasetService service. + # + # The service that manages Vertex AI Dataset and its child resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dataset_service_stub + + ## + # Configure the DatasetService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::DatasetService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DatasetService clients + # ::Google::Cloud::AIPlatform::V1::DatasetService::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 DatasetService 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::DatasetService::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 + @dataset_service_stub.universe_domain + end + + ## + # Create a new DatasetService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DatasetService 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/dataset_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 + + @dataset_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::DatasetService::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 + ) + + @dataset_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 = @dataset_service_stub.endpoint + config.universe_domain = @dataset_service_stub.universe_domain + config.logger = @dataset_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 = @dataset_service_stub.endpoint + config.universe_domain = @dataset_service_stub.universe_domain + config.logger = @dataset_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetService::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 + @dataset_service_stub.logger + end + + # Service calls + + ## + # Creates a Dataset. + # + # @overload create_dataset(request, options = nil) + # Pass arguments to `create_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDatasetRequest, ::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_dataset(parent: nil, dataset: nil) + # Pass arguments to `create_dataset` 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 Dataset in. + # Format: `projects/{project}/locations/{location}` + # @param dataset [::Google::Cloud::AIPlatform::V1::Dataset, ::Hash] + # Required. The Dataset 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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDatasetRequest.new + # + # # Call the create_dataset method. + # result = client.create_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :create_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset. + # + # @overload get_dataset(request, options = nil) + # Pass arguments to `get_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDatasetRequest, ::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_dataset(name: nil, read_mask: nil) + # Pass arguments to `get_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Dataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDatasetRequest.new + # + # # Call the get_dataset method. + # result = client.get_dataset request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + # p result + # + def get_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :get_dataset, 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 + + ## + # Updates a Dataset. + # + # @overload update_dataset(request, options = nil) + # Pass arguments to `update_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest, ::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_dataset(dataset: nil, update_mask: nil) + # Pass arguments to `update_dataset` 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 dataset [::Google::Cloud::AIPlatform::V1::Dataset, ::Hash] + # Required. The Dataset which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + # * `description` + # * `labels` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Dataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDatasetRequest.new + # + # # Call the update_dataset method. + # result = client.update_dataset request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + # p result + # + def update_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest + + # 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_dataset.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.dataset&.name + header_params["dataset.name"] = request.dataset.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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :update_dataset, 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 Datasets in a Location. + # + # @overload list_datasets(request, options = nil) + # Pass arguments to `list_datasets` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDatasetsRequest, ::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_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_datasets` 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 name of the Dataset's parent resource. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `display_name`: supports = and != + # * `metadata_schema_uri`: supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Dataset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Dataset>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDatasetsRequest.new + # + # # Call the list_datasets method. + # result = client.list_datasets 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::Dataset. + # p item + # end + # + def list_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDatasetsRequest + + # 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_datasets.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_datasets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :list_datasets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :list_datasets, 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 + + ## + # Deletes a Dataset. + # + # @overload delete_dataset(request, options = nil) + # Pass arguments to `delete_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest, ::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_dataset(name: nil) + # Pass arguments to `delete_dataset` 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 Dataset to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDatasetRequest.new + # + # # Call the delete_dataset method. + # result = client.delete_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :delete_dataset, 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 + + ## + # Imports data into a Dataset. + # + # @overload import_data(request, options = nil) + # Pass arguments to `import_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportDataRequest, ::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 import_data(name: nil, import_configs: nil) + # Pass arguments to `import_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param import_configs [::Array<::Google::Cloud::AIPlatform::V1::ImportDataConfig, ::Hash>] + # Required. The desired input locations. The contents of all input locations + # will be imported in one batch. + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportDataRequest.new + # + # # Call the import_data method. + # result = client.import_data 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 import_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportDataRequest + + # 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.import_data.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.import_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :import_data, 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 + + ## + # Exports data from a Dataset. + # + # @overload export_data(request, options = nil) + # Pass arguments to `export_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportDataRequest, ::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 export_data(name: nil, export_config: nil) + # Pass arguments to `export_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param export_config [::Google::Cloud::AIPlatform::V1::ExportDataConfig, ::Hash] + # Required. The desired output location. + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportDataRequest.new + # + # # Call the export_data method. + # result = client.export_data 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 export_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportDataRequest + + # 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.export_data.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.export_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :export_data, 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 + + ## + # Create a version from a Dataset. + # + # @overload create_dataset_version(request, options = nil) + # Pass arguments to `create_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest, ::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_dataset_version(parent: nil, dataset_version: nil) + # Pass arguments to `create_dataset_version` 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 name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param dataset_version [::Google::Cloud::AIPlatform::V1::DatasetVersion, ::Hash] + # Required. The version to be created. The same CMEK policies with the + # original Dataset will be applied the dataset version. So here we don't need + # to specify the EncryptionSpecType here. + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest.new + # + # # Call the create_dataset_version method. + # result = client.create_dataset_version 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_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :create_dataset_version, 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 + + ## + # Updates a DatasetVersion. + # + # @overload update_dataset_version(request, options = nil) + # Pass arguments to `update_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest, ::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_dataset_version(dataset_version: nil, update_mask: nil) + # Pass arguments to `update_dataset_version` 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 dataset_version [::Google::Cloud::AIPlatform::V1::DatasetVersion, ::Hash] + # Required. The DatasetVersion which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest.new + # + # # Call the update_dataset_version method. + # result = client.update_dataset_version request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DatasetVersion. + # p result + # + def update_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest + + # 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_dataset_version.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.dataset_version&.name + header_params["dataset_version.name"] = request.dataset_version.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_dataset_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :update_dataset_version, 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 a Dataset version. + # + # @overload delete_dataset_version(request, options = nil) + # Pass arguments to `delete_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest, ::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_dataset_version(name: nil) + # Pass arguments to `delete_dataset_version` 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 Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest.new + # + # # Call the delete_dataset_version method. + # result = client.delete_dataset_version 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_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :delete_dataset_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset version. + # + # @overload get_dataset_version(request, options = nil) + # Pass arguments to `get_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest, ::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_dataset_version(name: nil, read_mask: nil) + # Pass arguments to `get_dataset_version` 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 Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest.new + # + # # Call the get_dataset_version method. + # result = client.get_dataset_version request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DatasetVersion. + # p result + # + def get_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :get_dataset_version, 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 DatasetVersions in a Dataset. + # + # @overload list_dataset_versions(request, options = nil) + # Pass arguments to `list_dataset_versions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest, ::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_dataset_versions(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_dataset_versions` 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 Dataset to list DatasetVersions from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param filter [::String] + # Optional. The standard list filter. + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DatasetVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DatasetVersion>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest.new + # + # # Call the list_dataset_versions method. + # result = client.list_dataset_versions 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::DatasetVersion. + # p item + # end + # + def list_dataset_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest + + # 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_dataset_versions.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_dataset_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_dataset_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :list_dataset_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :list_dataset_versions, 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 + + ## + # Restores a dataset version. + # + # @overload restore_dataset_version(request, options = nil) + # Pass arguments to `restore_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest, ::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 restore_dataset_version(name: nil) + # Pass arguments to `restore_dataset_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DatasetVersion resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest.new + # + # # Call the restore_dataset_version method. + # result = client.restore_dataset_version 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 restore_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest + + # 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.restore_dataset_version.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.restore_dataset_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :restore_dataset_version, 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 DataItems in a Dataset. + # + # @overload list_data_items(request, options = nil) + # Pass arguments to `list_data_items` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDataItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDataItemsRequest, ::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_data_items(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_data_items` 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 Dataset to list DataItems from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItem>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDataItemsRequest.new + # + # # Call the list_data_items method. + # result = client.list_data_items 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::DataItem. + # p item + # end + # + def list_data_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDataItemsRequest + + # 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_data_items.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_data_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :list_data_items, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :list_data_items, 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 + + ## + # Searches DataItems in a Dataset. + # + # @overload search_data_items(request, options = nil) + # Pass arguments to `search_data_items` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest, ::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 search_data_items(order_by_data_item: nil, order_by_annotation: nil, dataset: nil, saved_query: nil, data_labeling_job: nil, data_item_filter: nil, annotations_filter: nil, annotation_filters: nil, field_mask: nil, annotations_limit: nil, page_size: nil, order_by: nil, page_token: nil) + # Pass arguments to `search_data_items` 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 order_by_data_item [::String] + # A comma-separated list of data item fields to order by, sorted in + # ascending order. Use "desc" after a field name for descending. + # @param order_by_annotation [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest::OrderByAnnotation, ::Hash] + # Expression that allows ranking results based on annotation's property. + # @param dataset [::String] + # Required. The resource name of the Dataset from which to search DataItems. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param saved_query [::String] + # The resource name of a SavedQuery(annotation set in UI). + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # All of the search will be done in the context of this SavedQuery. + # @param data_labeling_job [::String] + # The resource name of a DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # If this field is set, all of the search will be done in the context of + # this DataLabelingJob. + # @param data_item_filter [::String] + # An expression for filtering the DataItem that will be returned. + # + # * `data_item_id` - for = or !=. + # * `labeled` - for = or !=. + # * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + # have at least one annotation with annotation_spec_id = + # `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + # + # For example: + # + # * `data_item=1` + # * `has_annotation(5)` + # @param annotations_filter [::String] + # An expression for filtering the Annotations that will be returned per + # DataItem. + # * `annotation_spec_id` - for = or !=. + # @param annotation_filters [::Array<::String>] + # An expression that specifies what Annotations will be returned per + # DataItem. Annotations satisfied either of the conditions will be returned. + # * `annotation_spec_id` - for = or !=. + # Must specify `saved_query_id=` - saved query id that annotations should + # belong to. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields of + # {::Google::Cloud::AIPlatform::V1::DataItemView DataItemView} to read. + # @param annotations_limit [::Integer] + # If set, only up to this many of Annotations will be returned per + # DataItemView. The maximum value is 1000. If not set, the maximum value will + # be used. + # @param page_size [::Integer] + # Requested page size. Server may return fewer results than requested. + # Default and maximum page size is 100. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @param page_token [::String] + # A token identifying a page of results for the server to return + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse#next_page_token SearchDataItemsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#search_data_items DatasetService.SearchDataItems} + # call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItemView>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItemView>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchDataItemsRequest.new + # + # # Call the search_data_items method. + # result = client.search_data_items 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::DataItemView. + # p item + # end + # + def search_data_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest + + # 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.search_data_items.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.dataset + header_params["dataset"] = request.dataset + 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.search_data_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_data_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :search_data_items, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :search_data_items, 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 + + ## + # Lists SavedQueries in a Dataset. + # + # @overload list_saved_queries(request, options = nil) + # Pass arguments to `list_saved_queries` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest, ::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_saved_queries(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_saved_queries` 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 Dataset to list SavedQueries from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest.new + # + # # Call the list_saved_queries method. + # result = client.list_saved_queries 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::SavedQuery. + # p item + # end + # + def list_saved_queries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest + + # 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_saved_queries.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_saved_queries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_saved_queries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :list_saved_queries, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :list_saved_queries, 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 + + ## + # Deletes a SavedQuery. + # + # @overload delete_saved_query(request, options = nil) + # Pass arguments to `delete_saved_query` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest, ::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_saved_query(name: nil) + # Pass arguments to `delete_saved_query` 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 SavedQuery to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest.new + # + # # Call the delete_saved_query method. + # result = client.delete_saved_query 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_saved_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest + + # 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_saved_query.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_saved_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_saved_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :delete_saved_query, 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 an AnnotationSpec. + # + # @overload get_annotation_spec(request, options = nil) + # Pass arguments to `get_annotation_spec` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest, ::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_annotation_spec(name: nil, read_mask: nil) + # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the AnnotationSpec resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AnnotationSpec] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AnnotationSpec] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest.new + # + # # Call the get_annotation_spec method. + # result = client.get_annotation_spec request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AnnotationSpec. + # p result + # + def get_annotation_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest + + # 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_annotation_spec.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_annotation_spec.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_annotation_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :get_annotation_spec, 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 Annotations belongs to a dataitem + # This RPC is only available in InternalDatasetService. It is only used for + # exporting conversation data to CCAI Insights. + # + # @overload list_annotations(request, options = nil) + # Pass arguments to `list_annotations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest, ::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_annotations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_annotations` 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 DataItem to list Annotations from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Annotation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Annotation>] + # + # @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::DatasetService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListAnnotationsRequest.new + # + # # Call the list_annotations method. + # result = client.list_annotations 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::Annotation. + # p item + # end + # + def list_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest + + # 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_annotations.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_annotations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.call_rpc :list_annotations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @dataset_service_stub, :list_annotations, 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 + + ## + # Configuration class for the DatasetService API. + # + # This class represents the configuration for DatasetService, + # 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::DatasetService::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_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::DatasetService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_dataset.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DatasetService 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_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset + ## + # RPC-specific configuration for `get_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset + ## + # RPC-specific configuration for `update_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset + ## + # RPC-specific configuration for `list_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datasets + ## + # RPC-specific configuration for `delete_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset + ## + # RPC-specific configuration for `import_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_data + ## + # RPC-specific configuration for `export_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_data + ## + # RPC-specific configuration for `create_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset_version + ## + # RPC-specific configuration for `update_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_version + ## + # RPC-specific configuration for `delete_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset_version + ## + # RPC-specific configuration for `get_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_version + ## + # RPC-specific configuration for `list_dataset_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dataset_versions + ## + # RPC-specific configuration for `restore_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_dataset_version + ## + # RPC-specific configuration for `list_data_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_items + ## + # RPC-specific configuration for `search_data_items` + # @return [::Gapic::Config::Method] + # + attr_reader :search_data_items + ## + # RPC-specific configuration for `list_saved_queries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_saved_queries + ## + # RPC-specific configuration for `delete_saved_query` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_saved_query + ## + # RPC-specific configuration for `get_annotation_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation_spec + ## + # RPC-specific configuration for `list_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_annotations + + # @private + def initialize parent_rpcs = nil + create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset + @create_dataset = ::Gapic::Config::Method.new create_dataset_config + get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset + @get_dataset = ::Gapic::Config::Method.new get_dataset_config + update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset + @update_dataset = ::Gapic::Config::Method.new update_dataset_config + list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets + @list_datasets = ::Gapic::Config::Method.new list_datasets_config + delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset + @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config + import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data + @import_data = ::Gapic::Config::Method.new import_data_config + export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data + @export_data = ::Gapic::Config::Method.new export_data_config + create_dataset_version_config = parent_rpcs.create_dataset_version if parent_rpcs.respond_to? :create_dataset_version + @create_dataset_version = ::Gapic::Config::Method.new create_dataset_version_config + update_dataset_version_config = parent_rpcs.update_dataset_version if parent_rpcs.respond_to? :update_dataset_version + @update_dataset_version = ::Gapic::Config::Method.new update_dataset_version_config + delete_dataset_version_config = parent_rpcs.delete_dataset_version if parent_rpcs.respond_to? :delete_dataset_version + @delete_dataset_version = ::Gapic::Config::Method.new delete_dataset_version_config + get_dataset_version_config = parent_rpcs.get_dataset_version if parent_rpcs.respond_to? :get_dataset_version + @get_dataset_version = ::Gapic::Config::Method.new get_dataset_version_config + list_dataset_versions_config = parent_rpcs.list_dataset_versions if parent_rpcs.respond_to? :list_dataset_versions + @list_dataset_versions = ::Gapic::Config::Method.new list_dataset_versions_config + restore_dataset_version_config = parent_rpcs.restore_dataset_version if parent_rpcs.respond_to? :restore_dataset_version + @restore_dataset_version = ::Gapic::Config::Method.new restore_dataset_version_config + list_data_items_config = parent_rpcs.list_data_items if parent_rpcs.respond_to? :list_data_items + @list_data_items = ::Gapic::Config::Method.new list_data_items_config + search_data_items_config = parent_rpcs.search_data_items if parent_rpcs.respond_to? :search_data_items + @search_data_items = ::Gapic::Config::Method.new search_data_items_config + list_saved_queries_config = parent_rpcs.list_saved_queries if parent_rpcs.respond_to? :list_saved_queries + @list_saved_queries = ::Gapic::Config::Method.new list_saved_queries_config + delete_saved_query_config = parent_rpcs.delete_saved_query if parent_rpcs.respond_to? :delete_saved_query + @delete_saved_query = ::Gapic::Config::Method.new delete_saved_query_config + get_annotation_spec_config = parent_rpcs.get_annotation_spec if parent_rpcs.respond_to? :get_annotation_spec + @get_annotation_spec = ::Gapic::Config::Method.new get_annotation_spec_config + list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations + @list_annotations = ::Gapic::Config::Method.new list_annotations_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/credentials.rb new file mode 100644 index 000000000000..eb06a34023c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + # Credentials for the DatasetService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb new file mode 100644 index 000000000000..e96c7ef1d685 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + # 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 DatasetService 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 DatasetService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/paths.rb new file mode 100644 index 000000000000..d10f18a450b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/paths.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + # Path helper methods for the DatasetService API. + module Paths + ## + # Create a fully-qualified AnnotationSpec resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param annotation_spec [String] + # + # @return [::String] + def annotation_spec_path project:, location:, dataset:, annotation_spec: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/annotationSpecs/#{annotation_spec}" + end + + ## + # Create a fully-qualified DataItem resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param data_item [String] + # + # @return [::String] + def data_item_path project:, location:, dataset:, data_item: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/dataItems/#{data_item}" + end + + ## + # Create a fully-qualified Dataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # + # @return [::String] + def dataset_path project:, location:, dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}" + end + + ## + # Create a fully-qualified DatasetVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param dataset_version [String] + # + # @return [::String] + def dataset_version_path project:, location:, dataset:, dataset_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/datasetVersions/#{dataset_version}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified SavedQuery resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param saved_query [String] + # + # @return [::String] + def saved_query_path project:, location:, dataset:, saved_query: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/savedQueries/#{saved_query}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest.rb new file mode 100644 index 000000000000..a88990cf18af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/dataset_service/credentials" +require "google/cloud/ai_platform/v1/dataset_service/paths" +require "google/cloud/ai_platform/v1/dataset_service/rest/operations" +require "google/cloud/ai_platform/v1/dataset_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that manages Vertex AI Dataset and its child resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/dataset_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + module DatasetService + # 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/dataset_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb new file mode 100644 index 000000000000..2acd863973cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb @@ -0,0 +1,2305 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/dataset_service_pb" +require "google/cloud/ai_platform/v1/dataset_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + module Rest + ## + # REST client for the DatasetService service. + # + # The service that manages Vertex AI Dataset and its child resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :dataset_service_stub + + ## + # Configure the DatasetService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DatasetService clients + # ::Google::Cloud::AIPlatform::V1::DatasetService::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 DatasetService 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::DatasetService::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 + @dataset_service_stub.universe_domain + end + + ## + # Create a new DatasetService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DatasetService 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::DatasetService::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 + + @dataset_service_stub = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @dataset_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 = @dataset_service_stub.endpoint + config.universe_domain = @dataset_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @dataset_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 = @dataset_service_stub.endpoint + config.universe_domain = @dataset_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @dataset_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetService::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 + @dataset_service_stub.logger + end + + # Service calls + + ## + # Creates a Dataset. + # + # @overload create_dataset(request, options = nil) + # Pass arguments to `create_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDatasetRequest, ::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_dataset(parent: nil, dataset: nil) + # Pass arguments to `create_dataset` 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 Dataset in. + # Format: `projects/{project}/locations/{location}` + # @param dataset [::Google::Cloud::AIPlatform::V1::Dataset, ::Hash] + # Required. The Dataset 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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDatasetRequest.new + # + # # Call the create_dataset method. + # result = client.create_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.create_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset. + # + # @overload get_dataset(request, options = nil) + # Pass arguments to `get_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDatasetRequest, ::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_dataset(name: nil, read_mask: nil) + # Pass arguments to `get_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDatasetRequest.new + # + # # Call the get_dataset method. + # result = client.get_dataset request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + # p result + # + def get_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.get_dataset 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 + + ## + # Updates a Dataset. + # + # @overload update_dataset(request, options = nil) + # Pass arguments to `update_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest, ::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_dataset(dataset: nil, update_mask: nil) + # Pass arguments to `update_dataset` 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 dataset [::Google::Cloud::AIPlatform::V1::Dataset, ::Hash] + # Required. The Dataset which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + # * `description` + # * `labels` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDatasetRequest.new + # + # # Call the update_dataset method. + # result = client.update_dataset request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + # p result + # + def update_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.update_dataset 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 Datasets in a Location. + # + # @overload list_datasets(request, options = nil) + # Pass arguments to `list_datasets` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDatasetsRequest, ::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_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_datasets` 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 name of the Dataset's parent resource. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `display_name`: supports = and != + # * `metadata_schema_uri`: supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Dataset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Dataset>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDatasetsRequest.new + # + # # Call the list_datasets method. + # result = client.list_datasets 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::Dataset. + # p item + # end + # + def list_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDatasetsRequest + + # 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_datasets.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_datasets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.list_datasets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :list_datasets, "datasets", 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 + + ## + # Deletes a Dataset. + # + # @overload delete_dataset(request, options = nil) + # Pass arguments to `delete_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest, ::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_dataset(name: nil) + # Pass arguments to `delete_dataset` 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 Dataset to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDatasetRequest.new + # + # # Call the delete_dataset method. + # result = client.delete_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest + + # 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_dataset.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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.delete_dataset 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 + + ## + # Imports data into a Dataset. + # + # @overload import_data(request, options = nil) + # Pass arguments to `import_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportDataRequest, ::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 import_data(name: nil, import_configs: nil) + # Pass arguments to `import_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param import_configs [::Array<::Google::Cloud::AIPlatform::V1::ImportDataConfig, ::Hash>] + # Required. The desired input locations. The contents of all input locations + # will be imported in one batch. + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportDataRequest.new + # + # # Call the import_data method. + # result = client.import_data 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 import_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportDataRequest + + # 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.import_data.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.import_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.import_data 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 + + ## + # Exports data from a Dataset. + # + # @overload export_data(request, options = nil) + # Pass arguments to `export_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportDataRequest, ::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 export_data(name: nil, export_config: nil) + # Pass arguments to `export_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param export_config [::Google::Cloud::AIPlatform::V1::ExportDataConfig, ::Hash] + # Required. The desired output location. + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportDataRequest.new + # + # # Call the export_data method. + # result = client.export_data 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 export_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportDataRequest + + # 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.export_data.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.export_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.export_data 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 + + ## + # Create a version from a Dataset. + # + # @overload create_dataset_version(request, options = nil) + # Pass arguments to `create_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest, ::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_dataset_version(parent: nil, dataset_version: nil) + # Pass arguments to `create_dataset_version` 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 name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param dataset_version [::Google::Cloud::AIPlatform::V1::DatasetVersion, ::Hash] + # Required. The version to be created. The same CMEK policies with the + # original Dataset will be applied the dataset version. So here we don't need + # to specify the EncryptionSpecType here. + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest.new + # + # # Call the create_dataset_version method. + # result = client.create_dataset_version 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_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.create_dataset_version 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 + + ## + # Updates a DatasetVersion. + # + # @overload update_dataset_version(request, options = nil) + # Pass arguments to `update_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest, ::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_dataset_version(dataset_version: nil, update_mask: nil) + # Pass arguments to `update_dataset_version` 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 dataset_version [::Google::Cloud::AIPlatform::V1::DatasetVersion, ::Hash] + # Required. The DatasetVersion which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest.new + # + # # Call the update_dataset_version method. + # result = client.update_dataset_version request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DatasetVersion. + # p result + # + def update_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.update_dataset_version 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 a Dataset version. + # + # @overload delete_dataset_version(request, options = nil) + # Pass arguments to `delete_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest, ::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_dataset_version(name: nil) + # Pass arguments to `delete_dataset_version` 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 Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest.new + # + # # Call the delete_dataset_version method. + # result = client.delete_dataset_version 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_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.delete_dataset_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset version. + # + # @overload get_dataset_version(request, options = nil) + # Pass arguments to `get_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest, ::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_dataset_version(name: nil, read_mask: nil) + # Pass arguments to `get_dataset_version` 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 Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest.new + # + # # Call the get_dataset_version method. + # result = client.get_dataset_version request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DatasetVersion. + # p result + # + def get_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest + + # 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_dataset_version.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_dataset_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.get_dataset_version 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 DatasetVersions in a Dataset. + # + # @overload list_dataset_versions(request, options = nil) + # Pass arguments to `list_dataset_versions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest, ::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_dataset_versions(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_dataset_versions` 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 Dataset to list DatasetVersions from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param filter [::String] + # Optional. The standard list filter. + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DatasetVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DatasetVersion>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest.new + # + # # Call the list_dataset_versions method. + # result = client.list_dataset_versions 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::DatasetVersion. + # p item + # end + # + def list_dataset_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest + + # 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_dataset_versions.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_dataset_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_dataset_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.list_dataset_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :list_dataset_versions, "dataset_versions", 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 + + ## + # Restores a dataset version. + # + # @overload restore_dataset_version(request, options = nil) + # Pass arguments to `restore_dataset_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest, ::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 restore_dataset_version(name: nil) + # Pass arguments to `restore_dataset_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DatasetVersion resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest.new + # + # # Call the restore_dataset_version method. + # result = client.restore_dataset_version 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 restore_dataset_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest + + # 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.restore_dataset_version.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.restore_dataset_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_dataset_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.restore_dataset_version 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 DataItems in a Dataset. + # + # @overload list_data_items(request, options = nil) + # Pass arguments to `list_data_items` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDataItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDataItemsRequest, ::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_data_items(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_data_items` 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 Dataset to list DataItems from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItem>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDataItemsRequest.new + # + # # Call the list_data_items method. + # result = client.list_data_items 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::DataItem. + # p item + # end + # + def list_data_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDataItemsRequest + + # 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_data_items.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_data_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.list_data_items request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :list_data_items, "data_items", 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 + + ## + # Searches DataItems in a Dataset. + # + # @overload search_data_items(request, options = nil) + # Pass arguments to `search_data_items` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest, ::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 search_data_items(order_by_data_item: nil, order_by_annotation: nil, dataset: nil, saved_query: nil, data_labeling_job: nil, data_item_filter: nil, annotations_filter: nil, annotation_filters: nil, field_mask: nil, annotations_limit: nil, page_size: nil, order_by: nil, page_token: nil) + # Pass arguments to `search_data_items` 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 order_by_data_item [::String] + # A comma-separated list of data item fields to order by, sorted in + # ascending order. Use "desc" after a field name for descending. + # @param order_by_annotation [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest::OrderByAnnotation, ::Hash] + # Expression that allows ranking results based on annotation's property. + # @param dataset [::String] + # Required. The resource name of the Dataset from which to search DataItems. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @param saved_query [::String] + # The resource name of a SavedQuery(annotation set in UI). + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # All of the search will be done in the context of this SavedQuery. + # @param data_labeling_job [::String] + # The resource name of a DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # If this field is set, all of the search will be done in the context of + # this DataLabelingJob. + # @param data_item_filter [::String] + # An expression for filtering the DataItem that will be returned. + # + # * `data_item_id` - for = or !=. + # * `labeled` - for = or !=. + # * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + # have at least one annotation with annotation_spec_id = + # `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + # + # For example: + # + # * `data_item=1` + # * `has_annotation(5)` + # @param annotations_filter [::String] + # An expression for filtering the Annotations that will be returned per + # DataItem. + # * `annotation_spec_id` - for = or !=. + # @param annotation_filters [::Array<::String>] + # An expression that specifies what Annotations will be returned per + # DataItem. Annotations satisfied either of the conditions will be returned. + # * `annotation_spec_id` - for = or !=. + # Must specify `saved_query_id=` - saved query id that annotations should + # belong to. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields of + # {::Google::Cloud::AIPlatform::V1::DataItemView DataItemView} to read. + # @param annotations_limit [::Integer] + # If set, only up to this many of Annotations will be returned per + # DataItemView. The maximum value is 1000. If not set, the maximum value will + # be used. + # @param page_size [::Integer] + # Requested page size. Server may return fewer results than requested. + # Default and maximum page size is 100. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @param page_token [::String] + # A token identifying a page of results for the server to return + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse#next_page_token SearchDataItemsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client#search_data_items DatasetService.SearchDataItems} + # call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItemView>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataItemView>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchDataItemsRequest.new + # + # # Call the search_data_items method. + # result = client.search_data_items 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::DataItemView. + # p item + # end + # + def search_data_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest + + # 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.search_data_items.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.search_data_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_data_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.search_data_items request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :search_data_items, "data_item_views", 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 + + ## + # Lists SavedQueries in a Dataset. + # + # @overload list_saved_queries(request, options = nil) + # Pass arguments to `list_saved_queries` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest, ::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_saved_queries(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_saved_queries` 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 Dataset to list SavedQueries from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest.new + # + # # Call the list_saved_queries method. + # result = client.list_saved_queries 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::SavedQuery. + # p item + # end + # + def list_saved_queries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest + + # 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_saved_queries.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_saved_queries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_saved_queries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.list_saved_queries request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :list_saved_queries, "saved_queries", 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 + + ## + # Deletes a SavedQuery. + # + # @overload delete_saved_query(request, options = nil) + # Pass arguments to `delete_saved_query` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest, ::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_saved_query(name: nil) + # Pass arguments to `delete_saved_query` 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 SavedQuery to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest.new + # + # # Call the delete_saved_query method. + # result = client.delete_saved_query 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_saved_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest + + # 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_saved_query.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_saved_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_saved_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.delete_saved_query 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 an AnnotationSpec. + # + # @overload get_annotation_spec(request, options = nil) + # Pass arguments to `get_annotation_spec` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest, ::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_annotation_spec(name: nil, read_mask: nil) + # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the AnnotationSpec resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AnnotationSpec] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AnnotationSpec] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest.new + # + # # Call the get_annotation_spec method. + # result = client.get_annotation_spec request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AnnotationSpec. + # p result + # + def get_annotation_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest + + # 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_annotation_spec.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_annotation_spec.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_annotation_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.get_annotation_spec 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 Annotations belongs to a dataitem + # This RPC is only available in InternalDatasetService. It is only used for + # exporting conversation data to CCAI Insights. + # + # @overload list_annotations(request, options = nil) + # Pass arguments to `list_annotations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest, ::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_annotations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_annotations` 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 DataItem to list Annotations from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + # @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 read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Annotation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Annotation>] + # + # @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::DatasetService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListAnnotationsRequest.new + # + # # Call the list_annotations method. + # result = client.list_annotations 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::Annotation. + # p item + # end + # + def list_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest + + # 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_annotations.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_annotations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @dataset_service_stub.list_annotations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @dataset_service_stub, :list_annotations, "annotations", 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 + + ## + # Configuration class for the DatasetService REST API. + # + # This class represents the configuration for DatasetService 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::DatasetService::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_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_dataset.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DatasetService 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_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset + ## + # RPC-specific configuration for `get_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset + ## + # RPC-specific configuration for `update_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset + ## + # RPC-specific configuration for `list_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datasets + ## + # RPC-specific configuration for `delete_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset + ## + # RPC-specific configuration for `import_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_data + ## + # RPC-specific configuration for `export_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_data + ## + # RPC-specific configuration for `create_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset_version + ## + # RPC-specific configuration for `update_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_version + ## + # RPC-specific configuration for `delete_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset_version + ## + # RPC-specific configuration for `get_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_version + ## + # RPC-specific configuration for `list_dataset_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dataset_versions + ## + # RPC-specific configuration for `restore_dataset_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_dataset_version + ## + # RPC-specific configuration for `list_data_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_items + ## + # RPC-specific configuration for `search_data_items` + # @return [::Gapic::Config::Method] + # + attr_reader :search_data_items + ## + # RPC-specific configuration for `list_saved_queries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_saved_queries + ## + # RPC-specific configuration for `delete_saved_query` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_saved_query + ## + # RPC-specific configuration for `get_annotation_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation_spec + ## + # RPC-specific configuration for `list_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_annotations + + # @private + def initialize parent_rpcs = nil + create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset + @create_dataset = ::Gapic::Config::Method.new create_dataset_config + get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset + @get_dataset = ::Gapic::Config::Method.new get_dataset_config + update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset + @update_dataset = ::Gapic::Config::Method.new update_dataset_config + list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets + @list_datasets = ::Gapic::Config::Method.new list_datasets_config + delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset + @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config + import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data + @import_data = ::Gapic::Config::Method.new import_data_config + export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data + @export_data = ::Gapic::Config::Method.new export_data_config + create_dataset_version_config = parent_rpcs.create_dataset_version if parent_rpcs.respond_to? :create_dataset_version + @create_dataset_version = ::Gapic::Config::Method.new create_dataset_version_config + update_dataset_version_config = parent_rpcs.update_dataset_version if parent_rpcs.respond_to? :update_dataset_version + @update_dataset_version = ::Gapic::Config::Method.new update_dataset_version_config + delete_dataset_version_config = parent_rpcs.delete_dataset_version if parent_rpcs.respond_to? :delete_dataset_version + @delete_dataset_version = ::Gapic::Config::Method.new delete_dataset_version_config + get_dataset_version_config = parent_rpcs.get_dataset_version if parent_rpcs.respond_to? :get_dataset_version + @get_dataset_version = ::Gapic::Config::Method.new get_dataset_version_config + list_dataset_versions_config = parent_rpcs.list_dataset_versions if parent_rpcs.respond_to? :list_dataset_versions + @list_dataset_versions = ::Gapic::Config::Method.new list_dataset_versions_config + restore_dataset_version_config = parent_rpcs.restore_dataset_version if parent_rpcs.respond_to? :restore_dataset_version + @restore_dataset_version = ::Gapic::Config::Method.new restore_dataset_version_config + list_data_items_config = parent_rpcs.list_data_items if parent_rpcs.respond_to? :list_data_items + @list_data_items = ::Gapic::Config::Method.new list_data_items_config + search_data_items_config = parent_rpcs.search_data_items if parent_rpcs.respond_to? :search_data_items + @search_data_items = ::Gapic::Config::Method.new search_data_items_config + list_saved_queries_config = parent_rpcs.list_saved_queries if parent_rpcs.respond_to? :list_saved_queries + @list_saved_queries = ::Gapic::Config::Method.new list_saved_queries_config + delete_saved_query_config = parent_rpcs.delete_saved_query if parent_rpcs.respond_to? :delete_saved_query + @delete_saved_query = ::Gapic::Config::Method.new delete_saved_query_config + get_annotation_spec_config = parent_rpcs.get_annotation_spec if parent_rpcs.respond_to? :get_annotation_spec + @get_annotation_spec = ::Gapic::Config::Method.new get_annotation_spec_config + list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations + @list_annotations = ::Gapic::Config::Method.new list_annotations_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb new file mode 100644 index 000000000000..e906924e745f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + 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 DatasetService 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 DatasetService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb new file mode 100644 index 000000000000..b7d7d51001eb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb @@ -0,0 +1,1323 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/dataset_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + module Rest + ## + # REST service stub for the DatasetService 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_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDatasetRequest] + # 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_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_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_dataset", + 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_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDatasetRequest] + # 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::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # A result object deserialized from the server's reply + def get_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_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_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Dataset.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_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest] + # 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::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # A result object deserialized from the server's reply + def update_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_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_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Dataset.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_datasets REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDatasetsRequest] + # 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::ListDatasetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListDatasetsResponse] + # A result object deserialized from the server's reply + def list_datasets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_datasets_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_datasets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListDatasetsResponse.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_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest] + # 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_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_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_dataset", + 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 import_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportDataRequest] + # 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 import_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_data_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: "import_data", + 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 export_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportDataRequest] + # 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 export_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_data_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: "export_data", + 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 create_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest] + # 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_dataset_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_version_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_dataset_version", + 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 update_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest] + # 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::DatasetVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # A result object deserialized from the server's reply + def update_dataset_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_version_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_dataset_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DatasetVersion.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_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest] + # 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_dataset_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_version_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_dataset_version", + 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_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest] + # 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::DatasetVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # A result object deserialized from the server's reply + def get_dataset_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_version_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_dataset_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DatasetVersion.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_dataset_versions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest] + # 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::ListDatasetVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListDatasetVersionsResponse] + # A result object deserialized from the server's reply + def list_dataset_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_dataset_versions_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_dataset_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListDatasetVersionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restore_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest] + # 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 restore_dataset_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_dataset_version_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: "restore_dataset_version", + 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_data_items REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDataItemsRequest] + # 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::ListDataItemsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListDataItemsResponse] + # A result object deserialized from the server's reply + def list_data_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_items_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_data_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListDataItemsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_data_items REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest] + # 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::SearchDataItemsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse] + # A result object deserialized from the server's reply + def search_data_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_data_items_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: "search_data_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse.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_saved_queries REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest] + # 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::ListSavedQueriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListSavedQueriesResponse] + # A result object deserialized from the server's reply + def list_saved_queries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_saved_queries_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_saved_queries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListSavedQueriesResponse.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_saved_query REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest] + # 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_saved_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_saved_query_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_saved_query", + 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_annotation_spec REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest] + # 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::AnnotationSpec] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AnnotationSpec] + # A result object deserialized from the server's reply + def get_annotation_spec request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_spec_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_annotation_spec", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AnnotationSpec.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_annotations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest] + # 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::ListAnnotationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListAnnotationsResponse] + # A result object deserialized from the server's reply + def list_annotations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_annotations_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_annotations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListAnnotationsResponse.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_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/datasets", + body: "dataset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/datasets", + body: "dataset", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dataset.name}", + body: "dataset", + matches: [ + ["dataset.name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dataset.name}", + body: "dataset", + matches: [ + ["dataset.name", %r{^datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_datasets REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDatasetsRequest] + # 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_datasets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/datasets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/datasets", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:import", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest] + # 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_dataset_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/datasetVersions", + body: "dataset_version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/datasetVersions", + body: "dataset_version", + matches: [ + ["parent", %r{^datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest] + # 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_dataset_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dataset_version.name}", + body: "dataset_version", + matches: [ + ["dataset_version.name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dataset_version.name}", + body: "dataset_version", + matches: [ + ["dataset_version.name", %r{^datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest] + # 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_dataset_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest] + # 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_dataset_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_dataset_versions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest] + # 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_dataset_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/datasetVersions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/datasetVersions", + matches: [ + ["parent", %r{^datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_dataset_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_dataset_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:restore", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:restore", + matches: [ + ["name", %r{^datasets/[^/]+/datasetVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_items REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDataItemsRequest] + # 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_data_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dataItems", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_data_items REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_data_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{dataset}:searchDataItems", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_saved_queries REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest] + # 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_saved_queries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/savedQueries", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_saved_query REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest] + # 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_saved_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_annotation_spec REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest] + # 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_annotation_spec_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_annotations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest] + # 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_annotations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/annotations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb new file mode 100644 index 000000000000..9a09003fadc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/paths" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/operations" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/client" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service that manages the DeploymentResourcePool resource. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/deployment_resource_pool_service" + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new + # + module DeploymentResourcePoolService + end + end + end + end +end + +helper_path = ::File.join __dir__, "deployment_resource_pool_service", "helpers.rb" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb new file mode 100644 index 000000000000..47cb8de6b619 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb @@ -0,0 +1,1039 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/deployment_resource_pool_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + ## + # Client for the DeploymentResourcePoolService service. + # + # A service that manages the DeploymentResourcePool resource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :deployment_resource_pool_service_stub + + ## + # Configure the DeploymentResourcePoolService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DeploymentResourcePoolService clients + # ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::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 DeploymentResourcePoolService 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::DeploymentResourcePoolService::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 + @deployment_resource_pool_service_stub.universe_domain + end + + ## + # Create a new DeploymentResourcePoolService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DeploymentResourcePoolService 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/deployment_resource_pool_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 + + @deployment_resource_pool_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::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 + ) + + @deployment_resource_pool_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 = @deployment_resource_pool_service_stub.endpoint + config.universe_domain = @deployment_resource_pool_service_stub.universe_domain + config.logger = @deployment_resource_pool_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 = @deployment_resource_pool_service_stub.endpoint + config.universe_domain = @deployment_resource_pool_service_stub.universe_domain + config.logger = @deployment_resource_pool_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::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 + @deployment_resource_pool_service_stub.logger + end + + # Service calls + + ## + # Create a DeploymentResourcePool. + # + # @overload create_deployment_resource_pool(request, options = nil) + # Pass arguments to `create_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest, ::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_deployment_resource_pool(parent: nil, deployment_resource_pool: nil, deployment_resource_pool_id: nil) + # Pass arguments to `create_deployment_resource_pool` 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 parent location resource where this DeploymentResourcePool + # will be created. Format: `projects/{project}/locations/{location}` + # @param deployment_resource_pool [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool, ::Hash] + # Required. The DeploymentResourcePool to create. + # @param deployment_resource_pool_id [::String] + # Required. The ID to use for the DeploymentResourcePool, which + # will become the final component of the DeploymentResourcePool's resource + # name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + # + # @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::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest.new + # + # # Call the create_deployment_resource_pool method. + # result = client.create_deployment_resource_pool 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_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :create_deployment_resource_pool, 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 + + ## + # Get a DeploymentResourcePool. + # + # @overload get_deployment_resource_pool(request, options = nil) + # Pass arguments to `get_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest, ::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_deployment_resource_pool(name: nil) + # Pass arguments to `get_deployment_resource_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DeploymentResourcePool to retrieve. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # + # @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::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest.new + # + # # Call the get_deployment_resource_pool method. + # result = client.get_deployment_resource_pool request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DeploymentResourcePool. + # p result + # + def get_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :get_deployment_resource_pool, 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 + + ## + # List DeploymentResourcePools in a location. + # + # @overload list_deployment_resource_pools(request, options = nil) + # Pass arguments to `list_deployment_resource_pools` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest, ::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_deployment_resource_pools(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployment_resource_pools` 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 parent Location which owns this collection of + # DeploymentResourcePools. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of DeploymentResourcePools to return. The service may + # return fewer than this value. + # @param page_token [::String] + # A page token, received from a previous `ListDeploymentResourcePools` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDeploymentResourcePools` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>] + # + # @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::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest.new + # + # # Call the list_deployment_resource_pools method. + # result = client.list_deployment_resource_pools 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::DeploymentResourcePool. + # p item + # end + # + def list_deployment_resource_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest + + # 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_deployment_resource_pools.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_deployment_resource_pools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_deployment_resource_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :list_deployment_resource_pools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @deployment_resource_pool_service_stub, :list_deployment_resource_pools, 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 + + ## + # Update a DeploymentResourcePool. + # + # @overload update_deployment_resource_pool(request, options = nil) + # Pass arguments to `update_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest, ::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_deployment_resource_pool(deployment_resource_pool: nil, update_mask: nil) + # Pass arguments to `update_deployment_resource_pool` 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 deployment_resource_pool [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool, ::Hash] + # Required. The DeploymentResourcePool to update. + # + # The DeploymentResourcePool's `name` field is used to identify the + # DeploymentResourcePool to update. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest.new + # + # # Call the update_deployment_resource_pool method. + # result = client.update_deployment_resource_pool request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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.deployment_resource_pool&.name + header_params["deployment_resource_pool.name"] = request.deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :update_deployment_resource_pool, 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 + + ## + # Delete a DeploymentResourcePool. + # + # @overload delete_deployment_resource_pool(request, options = nil) + # Pass arguments to `delete_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest, ::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_deployment_resource_pool(name: nil) + # Pass arguments to `delete_deployment_resource_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DeploymentResourcePool to delete. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # + # @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::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest.new + # + # # Call the delete_deployment_resource_pool method. + # result = client.delete_deployment_resource_pool 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_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :delete_deployment_resource_pool, 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 + + ## + # List DeployedModels that have been deployed on this DeploymentResourcePool. + # + # @overload query_deployed_models(request, options = nil) + # Pass arguments to `query_deployed_models` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_deployed_models(deployment_resource_pool: nil, page_size: nil, page_token: nil) + # Pass arguments to `query_deployed_models` 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 deployment_resource_pool [::String] + # Required. The name of the target DeploymentResourcePool to query. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @param page_size [::Integer] + # The maximum number of DeployedModels to return. The service may return + # fewer than this value. + # @param page_token [::String] + # A page token, received from a previous `QueryDeployedModels` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `QueryDeployedModels` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeployedModel>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeployedModel>] + # + # @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::DeploymentResourcePoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest.new + # + # # Call the query_deployed_models method. + # result = client.query_deployed_models 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::DeployedModel. + # p item + # end + # + def query_deployed_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_deployed_models.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.deployment_resource_pool + header_params["deployment_resource_pool"] = request.deployment_resource_pool + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_deployed_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_deployed_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.call_rpc :query_deployed_models, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @deployment_resource_pool_service_stub, :query_deployed_models, 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 + + ## + # Configuration class for the DeploymentResourcePoolService API. + # + # This class represents the configuration for DeploymentResourcePoolService, + # 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::DeploymentResourcePoolService::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_deployment_resource_pool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_deployment_resource_pool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_deployment_resource_pool.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DeploymentResourcePoolService 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_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_deployment_resource_pool + ## + # RPC-specific configuration for `get_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment_resource_pool + ## + # RPC-specific configuration for `list_deployment_resource_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployment_resource_pools + ## + # RPC-specific configuration for `update_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_deployment_resource_pool + ## + # RPC-specific configuration for `delete_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_deployment_resource_pool + ## + # RPC-specific configuration for `query_deployed_models` + # @return [::Gapic::Config::Method] + # + attr_reader :query_deployed_models + + # @private + def initialize parent_rpcs = nil + create_deployment_resource_pool_config = parent_rpcs.create_deployment_resource_pool if parent_rpcs.respond_to? :create_deployment_resource_pool + @create_deployment_resource_pool = ::Gapic::Config::Method.new create_deployment_resource_pool_config + get_deployment_resource_pool_config = parent_rpcs.get_deployment_resource_pool if parent_rpcs.respond_to? :get_deployment_resource_pool + @get_deployment_resource_pool = ::Gapic::Config::Method.new get_deployment_resource_pool_config + list_deployment_resource_pools_config = parent_rpcs.list_deployment_resource_pools if parent_rpcs.respond_to? :list_deployment_resource_pools + @list_deployment_resource_pools = ::Gapic::Config::Method.new list_deployment_resource_pools_config + update_deployment_resource_pool_config = parent_rpcs.update_deployment_resource_pool if parent_rpcs.respond_to? :update_deployment_resource_pool + @update_deployment_resource_pool = ::Gapic::Config::Method.new update_deployment_resource_pool_config + delete_deployment_resource_pool_config = parent_rpcs.delete_deployment_resource_pool if parent_rpcs.respond_to? :delete_deployment_resource_pool + @delete_deployment_resource_pool = ::Gapic::Config::Method.new delete_deployment_resource_pool_config + query_deployed_models_config = parent_rpcs.query_deployed_models if parent_rpcs.respond_to? :query_deployed_models + @query_deployed_models = ::Gapic::Config::Method.new query_deployed_models_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb new file mode 100644 index 000000000000..70129a0be042 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + # Credentials for the DeploymentResourcePoolService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb new file mode 100644 index 000000000000..daedf614939a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + # 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 DeploymentResourcePoolService 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 DeploymentResourcePoolService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb new file mode 100644 index 000000000000..3d03aff60eb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + # Path helper methods for the DeploymentResourcePoolService API. + module Paths + ## + # Create a fully-qualified DeploymentResourcePool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # + # @param project [String] + # @param location [String] + # @param deployment_resource_pool [String] + # + # @return [::String] + def deployment_resource_pool_path project:, location:, deployment_resource_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/deploymentResourcePools/#{deployment_resource_pool}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest.rb new file mode 100644 index 000000000000..d628e9528eff --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/paths" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service that manages the DeploymentResourcePool resource. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new + # + module DeploymentResourcePoolService + # 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/deployment_resource_pool_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb new file mode 100644 index 000000000000..74fd6dab3123 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb @@ -0,0 +1,978 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/deployment_resource_pool_service_pb" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + module Rest + ## + # REST client for the DeploymentResourcePoolService service. + # + # A service that manages the DeploymentResourcePool resource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :deployment_resource_pool_service_stub + + ## + # Configure the DeploymentResourcePoolService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DeploymentResourcePoolService clients + # ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::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 DeploymentResourcePoolService 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::DeploymentResourcePoolService::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 + @deployment_resource_pool_service_stub.universe_domain + end + + ## + # Create a new DeploymentResourcePoolService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DeploymentResourcePoolService 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::DeploymentResourcePoolService::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 + + @deployment_resource_pool_service_stub = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @deployment_resource_pool_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 = @deployment_resource_pool_service_stub.endpoint + config.universe_domain = @deployment_resource_pool_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @deployment_resource_pool_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 = @deployment_resource_pool_service_stub.endpoint + config.universe_domain = @deployment_resource_pool_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @deployment_resource_pool_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::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 + @deployment_resource_pool_service_stub.logger + end + + # Service calls + + ## + # Create a DeploymentResourcePool. + # + # @overload create_deployment_resource_pool(request, options = nil) + # Pass arguments to `create_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest, ::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_deployment_resource_pool(parent: nil, deployment_resource_pool: nil, deployment_resource_pool_id: nil) + # Pass arguments to `create_deployment_resource_pool` 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 parent location resource where this DeploymentResourcePool + # will be created. Format: `projects/{project}/locations/{location}` + # @param deployment_resource_pool [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool, ::Hash] + # Required. The DeploymentResourcePool to create. + # @param deployment_resource_pool_id [::String] + # Required. The ID to use for the DeploymentResourcePool, which + # will become the final component of the DeploymentResourcePool's resource + # name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + # @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::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest.new + # + # # Call the create_deployment_resource_pool method. + # result = client.create_deployment_resource_pool 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_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.create_deployment_resource_pool 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 + + ## + # Get a DeploymentResourcePool. + # + # @overload get_deployment_resource_pool(request, options = nil) + # Pass arguments to `get_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest, ::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_deployment_resource_pool(name: nil) + # Pass arguments to `get_deployment_resource_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DeploymentResourcePool to retrieve. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # + # @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::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest.new + # + # # Call the get_deployment_resource_pool method. + # result = client.get_deployment_resource_pool request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DeploymentResourcePool. + # p result + # + def get_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.get_deployment_resource_pool 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 + + ## + # List DeploymentResourcePools in a location. + # + # @overload list_deployment_resource_pools(request, options = nil) + # Pass arguments to `list_deployment_resource_pools` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest, ::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_deployment_resource_pools(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployment_resource_pools` 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 parent Location which owns this collection of + # DeploymentResourcePools. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of DeploymentResourcePools to return. The service may + # return fewer than this value. + # @param page_token [::String] + # A page token, received from a previous `ListDeploymentResourcePools` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDeploymentResourcePools` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>] + # + # @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::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest.new + # + # # Call the list_deployment_resource_pools method. + # result = client.list_deployment_resource_pools 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::DeploymentResourcePool. + # p item + # end + # + def list_deployment_resource_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest + + # 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_deployment_resource_pools.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_deployment_resource_pools.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_deployment_resource_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.list_deployment_resource_pools request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @deployment_resource_pool_service_stub, :list_deployment_resource_pools, "deployment_resource_pools", 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 + + ## + # Update a DeploymentResourcePool. + # + # @overload update_deployment_resource_pool(request, options = nil) + # Pass arguments to `update_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest, ::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_deployment_resource_pool(deployment_resource_pool: nil, update_mask: nil) + # Pass arguments to `update_deployment_resource_pool` 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 deployment_resource_pool [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool, ::Hash] + # Required. The DeploymentResourcePool to update. + # + # The DeploymentResourcePool's `name` field is used to identify the + # DeploymentResourcePool to update. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest.new + # + # # Call the update_deployment_resource_pool method. + # result = client.update_deployment_resource_pool request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.update_deployment_resource_pool 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 + + ## + # Delete a DeploymentResourcePool. + # + # @overload delete_deployment_resource_pool(request, options = nil) + # Pass arguments to `delete_deployment_resource_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest, ::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_deployment_resource_pool(name: nil) + # Pass arguments to `delete_deployment_resource_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DeploymentResourcePool to delete. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @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::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest.new + # + # # Call the delete_deployment_resource_pool method. + # result = client.delete_deployment_resource_pool 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_deployment_resource_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest + + # 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_deployment_resource_pool.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_deployment_resource_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_deployment_resource_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.delete_deployment_resource_pool 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 + + ## + # List DeployedModels that have been deployed on this DeploymentResourcePool. + # + # @overload query_deployed_models(request, options = nil) + # Pass arguments to `query_deployed_models` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_deployed_models(deployment_resource_pool: nil, page_size: nil, page_token: nil) + # Pass arguments to `query_deployed_models` 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 deployment_resource_pool [::String] + # Required. The name of the target DeploymentResourcePool to query. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @param page_size [::Integer] + # The maximum number of DeployedModels to return. The service may return + # fewer than this value. + # @param page_token [::String] + # A page token, received from a previous `QueryDeployedModels` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `QueryDeployedModels` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsResponse] + # + # @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::DeploymentResourcePoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest.new + # + # # Call the query_deployed_models method. + # result = client.query_deployed_models 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::DeployedModel. + # p item + # end + # + def query_deployed_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_deployed_models.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_deployed_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_deployed_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @deployment_resource_pool_service_stub.query_deployed_models 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 DeploymentResourcePoolService REST API. + # + # This class represents the configuration for DeploymentResourcePoolService 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::DeploymentResourcePoolService::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_deployment_resource_pool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_deployment_resource_pool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_deployment_resource_pool.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DeploymentResourcePoolService 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_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_deployment_resource_pool + ## + # RPC-specific configuration for `get_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment_resource_pool + ## + # RPC-specific configuration for `list_deployment_resource_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployment_resource_pools + ## + # RPC-specific configuration for `update_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_deployment_resource_pool + ## + # RPC-specific configuration for `delete_deployment_resource_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_deployment_resource_pool + ## + # RPC-specific configuration for `query_deployed_models` + # @return [::Gapic::Config::Method] + # + attr_reader :query_deployed_models + + # @private + def initialize parent_rpcs = nil + create_deployment_resource_pool_config = parent_rpcs.create_deployment_resource_pool if parent_rpcs.respond_to? :create_deployment_resource_pool + @create_deployment_resource_pool = ::Gapic::Config::Method.new create_deployment_resource_pool_config + get_deployment_resource_pool_config = parent_rpcs.get_deployment_resource_pool if parent_rpcs.respond_to? :get_deployment_resource_pool + @get_deployment_resource_pool = ::Gapic::Config::Method.new get_deployment_resource_pool_config + list_deployment_resource_pools_config = parent_rpcs.list_deployment_resource_pools if parent_rpcs.respond_to? :list_deployment_resource_pools + @list_deployment_resource_pools = ::Gapic::Config::Method.new list_deployment_resource_pools_config + update_deployment_resource_pool_config = parent_rpcs.update_deployment_resource_pool if parent_rpcs.respond_to? :update_deployment_resource_pool + @update_deployment_resource_pool = ::Gapic::Config::Method.new update_deployment_resource_pool_config + delete_deployment_resource_pool_config = parent_rpcs.delete_deployment_resource_pool if parent_rpcs.respond_to? :delete_deployment_resource_pool + @delete_deployment_resource_pool = ::Gapic::Config::Method.new delete_deployment_resource_pool_config + query_deployed_models_config = parent_rpcs.query_deployed_models if parent_rpcs.respond_to? :query_deployed_models + @query_deployed_models = ::Gapic::Config::Method.new query_deployed_models_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb new file mode 100644 index 000000000000..0b5c44f9703d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + 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 DeploymentResourcePoolService 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 DeploymentResourcePoolService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb new file mode 100644 index 000000000000..0477d03856fb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/deployment_resource_pool_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + module Rest + ## + # REST service stub for the DeploymentResourcePoolService 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_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest] + # 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_deployment_resource_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_deployment_resource_pool_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_deployment_resource_pool", + 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_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest] + # 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::DeploymentResourcePool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # A result object deserialized from the server's reply + def get_deployment_resource_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_resource_pool_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_deployment_resource_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePool.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_deployment_resource_pools REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest] + # 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::ListDeploymentResourcePoolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsResponse] + # A result object deserialized from the server's reply + def list_deployment_resource_pools request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_deployment_resource_pools_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_deployment_resource_pools", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsResponse.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_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_deployment_resource_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_deployment_resource_pool_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_deployment_resource_pool", + 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_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest] + # 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_deployment_resource_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_deployment_resource_pool_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_deployment_resource_pool", + 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 query_deployed_models REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest] + # 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::QueryDeployedModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsResponse] + # A result object deserialized from the server's reply + def query_deployed_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_deployed_models_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_deployed_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsResponse.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_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest] + # 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_deployment_resource_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/deploymentResourcePools", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest] + # 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_deployment_resource_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_deployment_resource_pools REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest] + # 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_deployment_resource_pools_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/deploymentResourcePools", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest] + # 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_deployment_resource_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{deployment_resource_pool.name}", + body: "deployment_resource_pool", + matches: [ + ["deployment_resource_pool.name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_deployment_resource_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest] + # 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_deployment_resource_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the query_deployed_models REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_deployed_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{deployment_resource_pool}:queryDeployedModels", + matches: [ + ["deployment_resource_pool", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service.rb new file mode 100644 index 000000000000..b4a85995e37c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/endpoint_service/credentials" +require "google/cloud/ai_platform/v1/endpoint_service/paths" +require "google/cloud/ai_platform/v1/endpoint_service/operations" +require "google/cloud/ai_platform/v1/endpoint_service/client" +require "google/cloud/ai_platform/v1/endpoint_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Endpoints. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/endpoint_service" + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/endpoint_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.new + # + module EndpointService + end + end + end + end +end + +helper_path = ::File.join __dir__, "endpoint_service", "helpers.rb" +require "google/cloud/ai_platform/v1/endpoint_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb new file mode 100644 index 000000000000..3cc6fc3f356e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb @@ -0,0 +1,1417 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/endpoint_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + ## + # Client for the EndpointService service. + # + # A service for managing Vertex AI's Endpoints. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :endpoint_service_stub + + ## + # Configure the EndpointService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::EndpointService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EndpointService clients + # ::Google::Cloud::AIPlatform::V1::EndpointService::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 EndpointService 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::EndpointService::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 + @endpoint_service_stub.universe_domain + end + + ## + # Create a new EndpointService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EndpointService 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/endpoint_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 + + @endpoint_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::EndpointService::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 + ) + + @endpoint_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 = @endpoint_service_stub.endpoint + config.universe_domain = @endpoint_service_stub.universe_domain + config.logger = @endpoint_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 = @endpoint_service_stub.endpoint + config.universe_domain = @endpoint_service_stub.universe_domain + config.logger = @endpoint_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::EndpointService::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 + @endpoint_service_stub.logger + end + + # Service calls + + ## + # Creates an Endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateEndpointRequest, ::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_endpoint(parent: nil, endpoint: nil, endpoint_id: nil) + # Pass arguments to `create_endpoint` 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 Endpoint in. + # Format: `projects/{project}/locations/{location}` + # @param endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint to create. + # @param endpoint_id [::String] + # Immutable. The ID to use for endpoint, which will become the final + # component of the endpoint resource name. + # If not provided, Vertex AI will generate a value for this ID. + # + # If the first character is a letter, this value may be up to 63 characters, + # and valid characters are `[a-z0-9-]`. The last character must be a letter + # or number. + # + # If the first character is a number, this value may be up to 9 characters, + # and valid characters are `[0-9]` with no leading zeros. + # + # When using HTTP/JSON, this field is populated + # based on a query string argument, such as `?endpoint_id=12345`. This is the + # fallback for fields that are not included in either the URI or the body. + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint 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_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :create_endpoint, 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 an Endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetEndpointRequest, ::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_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Endpoint resource. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :get_endpoint, 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 Endpoints in a Location. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEndpointsRequest, ::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_endpoints(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_endpoints` 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 from which to list the + # Endpoints. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint + # ID, i.e. the last segment of the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#name resource name}. + # * `display_name` supports `=` and `!=`. + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:*` or `labels:key` - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports `=`. + # + # Some examples: + # + # * `endpoint=1` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListEndpointsResponse#next_page_token ListEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#list_endpoints EndpointService.ListEndpoints} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Endpoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Endpoint>] + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints 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::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEndpointsRequest + + # 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_endpoints.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_endpoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @endpoint_service_stub, :list_endpoints, 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 an Endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest, ::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_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` 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 endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest + + # 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_endpoint.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.endpoint&.name + header_params["endpoint.name"] = request.endpoint.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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :update_endpoint, 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 + + ## + # Updates an Endpoint with a long running operation. + # + # @overload update_endpoint_long_running(request, options = nil) + # Pass arguments to `update_endpoint_long_running` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest, ::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_endpoint_long_running(endpoint: nil) + # Pass arguments to `update_endpoint_long_running` 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 endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint which replaces the resource on the server. Currently + # we only support updating the `client_connection_config` field, all the + # other fields' update will be blocked. + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest.new + # + # # Call the update_endpoint_long_running method. + # result = client.update_endpoint_long_running request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_endpoint_long_running request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest + + # 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_endpoint_long_running.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.endpoint&.name + header_params["endpoint.name"] = request.endpoint.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_endpoint_long_running.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_endpoint_long_running.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :update_endpoint_long_running, 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 an Endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest, ::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_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Endpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint 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_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :delete_endpoint, 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 + + ## + # Deploys a Model into this Endpoint, creating a DeployedModel within it. + # + # @overload deploy_model(request, options = nil) + # Pass arguments to `deploy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeployModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeployModelRequest, ::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 deploy_model(endpoint: nil, deployed_model: nil, traffic_split: nil) + # Pass arguments to `deploy_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource into which to deploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model [::Google::Cloud::AIPlatform::V1::DeployedModel, ::Hash] + # Required. The DeployedModel to be created within the Endpoint. Note that + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split} + # must be updated for the DeployedModel to start receiving traffic, either as + # part of this call, or via + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint EndpointService.UpdateEndpoint}. + # @param traffic_split [::Hash{::String => ::Integer}] + # A map from a DeployedModel's ID to the percentage of this Endpoint's + # traffic that should be forwarded to that DeployedModel. + # + # If this field is non-empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. To refer to the ID of the just being deployed Model, a + # "0" should be used, and the actual ID of the new DeployedModel will be + # filled in its place by this method. The traffic percentage values must add + # up to 100. + # + # If this field is empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} is not + # updated. + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeployModelRequest.new + # + # # Call the deploy_model method. + # result = client.deploy_model 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 deploy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeployModelRequest + + # 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.deploy_model.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.endpoint + header_params["endpoint"] = request.endpoint + 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.deploy_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :deploy_model, 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 + + ## + # Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + # freeing all resources it's using. + # + # @overload undeploy_model(request, options = nil) + # Pass arguments to `undeploy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UndeployModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UndeployModelRequest, ::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 undeploy_model(endpoint: nil, deployed_model_id: nil, traffic_split: nil) + # Pass arguments to `undeploy_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource from which to undeploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model_id [::String] + # Required. The ID of the DeployedModel to be undeployed from the Endpoint. + # @param traffic_split [::Hash{::String => ::Integer}] + # If this field is provided, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. If last DeployedModel is being undeployed from the + # Endpoint, the [Endpoint.traffic_split] will always end up empty when this + # call returns. A DeployedModel will be successfully undeployed only if it + # doesn't have any traffic assigned to it when this method executes, or if + # this field unassigns any traffic to it. + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UndeployModelRequest.new + # + # # Call the undeploy_model method. + # result = client.undeploy_model 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 undeploy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UndeployModelRequest + + # 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.undeploy_model.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.endpoint + header_params["endpoint"] = request.endpoint + 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.undeploy_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :undeploy_model, 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 + + ## + # Updates an existing deployed model. Updatable fields include + # `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + # `disable_container_logging` (v1 only), and `enable_container_logging` + # (v1beta1 only). + # + # @overload mutate_deployed_model(request, options = nil) + # Pass arguments to `mutate_deployed_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest, ::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 mutate_deployed_model(endpoint: nil, deployed_model: nil, update_mask: nil) + # Pass arguments to `mutate_deployed_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource into which to mutate a + # DeployedModel. Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model [::Google::Cloud::AIPlatform::V1::DeployedModel, ::Hash] + # Required. The DeployedModel to be mutated within the Endpoint. Only the + # following fields can be mutated: + # + # * `min_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * `max_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * {::Google::Cloud::AIPlatform::V1::DedicatedResources#autoscaling_metric_specs autoscaling_metric_specs} + # * `disable_container_logging` (v1 only) + # * `enable_container_logging` (v1beta1 only) + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @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::EndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest.new + # + # # Call the mutate_deployed_model method. + # result = client.mutate_deployed_model 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 mutate_deployed_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest + + # 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.mutate_deployed_model.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.endpoint + header_params["endpoint"] = request.endpoint + 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.mutate_deployed_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_deployed_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.call_rpc :mutate_deployed_model, 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 EndpointService API. + # + # This class represents the configuration for EndpointService, + # 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::EndpointService::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_endpoint to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::EndpointService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_endpoint.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_endpoint.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the EndpointService 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_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `update_endpoint_long_running` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint_long_running + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `deploy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_model + ## + # RPC-specific configuration for `undeploy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_model + ## + # RPC-specific configuration for `mutate_deployed_model` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_deployed_model + + # @private + def initialize parent_rpcs = nil + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + update_endpoint_long_running_config = parent_rpcs.update_endpoint_long_running if parent_rpcs.respond_to? :update_endpoint_long_running + @update_endpoint_long_running = ::Gapic::Config::Method.new update_endpoint_long_running_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + deploy_model_config = parent_rpcs.deploy_model if parent_rpcs.respond_to? :deploy_model + @deploy_model = ::Gapic::Config::Method.new deploy_model_config + undeploy_model_config = parent_rpcs.undeploy_model if parent_rpcs.respond_to? :undeploy_model + @undeploy_model = ::Gapic::Config::Method.new undeploy_model_config + mutate_deployed_model_config = parent_rpcs.mutate_deployed_model if parent_rpcs.respond_to? :mutate_deployed_model + @mutate_deployed_model = ::Gapic::Config::Method.new mutate_deployed_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/credentials.rb new file mode 100644 index 000000000000..8f4a437276b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + # Credentials for the EndpointService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb new file mode 100644 index 000000000000..bbb21ad9cd17 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + # 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 EndpointService 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 EndpointService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb new file mode 100644 index 000000000000..fca798379e38 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + # Path helper methods for the EndpointService API. + module Paths + ## + # Create a fully-qualified DeploymentResourcePool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # + # @param project [String] + # @param location [String] + # @param deployment_resource_pool [String] + # + # @return [::String] + def deployment_resource_pool_path project:, location:, deployment_resource_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/deploymentResourcePools/#{deployment_resource_pool}" + end + + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified ModelDeploymentMonitoringJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @param project [String] + # @param location [String] + # @param model_deployment_monitoring_job [String] + # + # @return [::String] + def model_deployment_monitoring_job_path project:, location:, model_deployment_monitoring_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/modelDeploymentMonitoringJobs/#{model_deployment_monitoring_job}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest.rb new file mode 100644 index 000000000000..bd0e962410a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/endpoint_service/credentials" +require "google/cloud/ai_platform/v1/endpoint_service/paths" +require "google/cloud/ai_platform/v1/endpoint_service/rest/operations" +require "google/cloud/ai_platform/v1/endpoint_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Endpoints. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/endpoint_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.new + # + module EndpointService + # 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/endpoint_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb new file mode 100644 index 000000000000..3ad297a302e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb @@ -0,0 +1,1337 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/endpoint_service_pb" +require "google/cloud/ai_platform/v1/endpoint_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + module Rest + ## + # REST client for the EndpointService service. + # + # A service for managing Vertex AI's Endpoints. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :endpoint_service_stub + + ## + # Configure the EndpointService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EndpointService clients + # ::Google::Cloud::AIPlatform::V1::EndpointService::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 EndpointService 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::EndpointService::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 + @endpoint_service_stub.universe_domain + end + + ## + # Create a new EndpointService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EndpointService 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::EndpointService::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 + + @endpoint_service_stub = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @endpoint_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 = @endpoint_service_stub.endpoint + config.universe_domain = @endpoint_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @endpoint_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 = @endpoint_service_stub.endpoint + config.universe_domain = @endpoint_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @endpoint_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::EndpointService::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 + @endpoint_service_stub.logger + end + + # Service calls + + ## + # Creates an Endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateEndpointRequest, ::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_endpoint(parent: nil, endpoint: nil, endpoint_id: nil) + # Pass arguments to `create_endpoint` 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 Endpoint in. + # Format: `projects/{project}/locations/{location}` + # @param endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint to create. + # @param endpoint_id [::String] + # Immutable. The ID to use for endpoint, which will become the final + # component of the endpoint resource name. + # If not provided, Vertex AI will generate a value for this ID. + # + # If the first character is a letter, this value may be up to 63 characters, + # and valid characters are `[a-z0-9-]`. The last character must be a letter + # or number. + # + # If the first character is a number, this value may be up to 9 characters, + # and valid characters are `[0-9]` with no leading zeros. + # + # When using HTTP/JSON, this field is populated + # based on a query string argument, such as `?endpoint_id=12345`. This is the + # fallback for fields that are not included in either the URI or the body. + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint 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_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.create_endpoint 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 an Endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetEndpointRequest, ::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_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Endpoint resource. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.get_endpoint 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 Endpoints in a Location. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEndpointsRequest, ::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_endpoints(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_endpoints` 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 from which to list the + # Endpoints. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint + # ID, i.e. the last segment of the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#name resource name}. + # * `display_name` supports `=` and `!=`. + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:*` or `labels:key` - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports `=`. + # + # Some examples: + # + # * `endpoint=1` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListEndpointsResponse#next_page_token ListEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client#list_endpoints EndpointService.ListEndpoints} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Endpoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Endpoint>] + # + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints 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::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEndpointsRequest + + # 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_endpoints.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_endpoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.list_endpoints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @endpoint_service_stub, :list_endpoints, "endpoints", 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 an Endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest, ::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_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` 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 endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.update_endpoint 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 + + ## + # Updates an Endpoint with a long running operation. + # + # @overload update_endpoint_long_running(request, options = nil) + # Pass arguments to `update_endpoint_long_running` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest, ::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_endpoint_long_running(endpoint: nil) + # Pass arguments to `update_endpoint_long_running` 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 endpoint [::Google::Cloud::AIPlatform::V1::Endpoint, ::Hash] + # Required. The Endpoint which replaces the resource on the server. Currently + # we only support updating the `client_connection_config` field, all the + # other fields' update will be blocked. + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest.new + # + # # Call the update_endpoint_long_running method. + # result = client.update_endpoint_long_running request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_endpoint_long_running request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest + + # 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_endpoint_long_running.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_endpoint_long_running.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_endpoint_long_running.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.update_endpoint_long_running 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 an Endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest, ::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_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Endpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint 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_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest + + # 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_endpoint.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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.delete_endpoint 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 + + ## + # Deploys a Model into this Endpoint, creating a DeployedModel within it. + # + # @overload deploy_model(request, options = nil) + # Pass arguments to `deploy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeployModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeployModelRequest, ::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 deploy_model(endpoint: nil, deployed_model: nil, traffic_split: nil) + # Pass arguments to `deploy_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource into which to deploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model [::Google::Cloud::AIPlatform::V1::DeployedModel, ::Hash] + # Required. The DeployedModel to be created within the Endpoint. Note that + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split} + # must be updated for the DeployedModel to start receiving traffic, either as + # part of this call, or via + # {::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client#update_endpoint EndpointService.UpdateEndpoint}. + # @param traffic_split [::Hash{::String => ::Integer}] + # A map from a DeployedModel's ID to the percentage of this Endpoint's + # traffic that should be forwarded to that DeployedModel. + # + # If this field is non-empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. To refer to the ID of the just being deployed Model, a + # "0" should be used, and the actual ID of the new DeployedModel will be + # filled in its place by this method. The traffic percentage values must add + # up to 100. + # + # If this field is empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} is not + # updated. + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeployModelRequest.new + # + # # Call the deploy_model method. + # result = client.deploy_model 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 deploy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeployModelRequest + + # 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.deploy_model.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.deploy_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.deploy_model 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 + + ## + # Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + # freeing all resources it's using. + # + # @overload undeploy_model(request, options = nil) + # Pass arguments to `undeploy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UndeployModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UndeployModelRequest, ::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 undeploy_model(endpoint: nil, deployed_model_id: nil, traffic_split: nil) + # Pass arguments to `undeploy_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource from which to undeploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model_id [::String] + # Required. The ID of the DeployedModel to be undeployed from the Endpoint. + # @param traffic_split [::Hash{::String => ::Integer}] + # If this field is provided, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. If last DeployedModel is being undeployed from the + # Endpoint, the [Endpoint.traffic_split] will always end up empty when this + # call returns. A DeployedModel will be successfully undeployed only if it + # doesn't have any traffic assigned to it when this method executes, or if + # this field unassigns any traffic to it. + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UndeployModelRequest.new + # + # # Call the undeploy_model method. + # result = client.undeploy_model 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 undeploy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UndeployModelRequest + + # 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.undeploy_model.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.undeploy_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.undeploy_model 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 + + ## + # Updates an existing deployed model. Updatable fields include + # `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + # `disable_container_logging` (v1 only), and `enable_container_logging` + # (v1beta1 only). + # + # @overload mutate_deployed_model(request, options = nil) + # Pass arguments to `mutate_deployed_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest, ::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 mutate_deployed_model(endpoint: nil, deployed_model: nil, update_mask: nil) + # Pass arguments to `mutate_deployed_model` 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 endpoint [::String] + # Required. The name of the Endpoint resource into which to mutate a + # DeployedModel. Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param deployed_model [::Google::Cloud::AIPlatform::V1::DeployedModel, ::Hash] + # Required. The DeployedModel to be mutated within the Endpoint. Only the + # following fields can be mutated: + # + # * `min_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * `max_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * {::Google::Cloud::AIPlatform::V1::DedicatedResources#autoscaling_metric_specs autoscaling_metric_specs} + # * `disable_container_logging` (v1 only) + # * `enable_container_logging` (v1beta1 only) + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @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::EndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest.new + # + # # Call the mutate_deployed_model method. + # result = client.mutate_deployed_model 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 mutate_deployed_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest + + # 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.mutate_deployed_model.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.mutate_deployed_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mutate_deployed_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @endpoint_service_stub.mutate_deployed_model 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 EndpointService REST API. + # + # This class represents the configuration for EndpointService 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::EndpointService::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_endpoint to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_endpoint.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_endpoint.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the EndpointService 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_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `update_endpoint_long_running` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint_long_running + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `deploy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_model + ## + # RPC-specific configuration for `undeploy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_model + ## + # RPC-specific configuration for `mutate_deployed_model` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_deployed_model + + # @private + def initialize parent_rpcs = nil + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + update_endpoint_long_running_config = parent_rpcs.update_endpoint_long_running if parent_rpcs.respond_to? :update_endpoint_long_running + @update_endpoint_long_running = ::Gapic::Config::Method.new update_endpoint_long_running_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + deploy_model_config = parent_rpcs.deploy_model if parent_rpcs.respond_to? :deploy_model + @deploy_model = ::Gapic::Config::Method.new deploy_model_config + undeploy_model_config = parent_rpcs.undeploy_model if parent_rpcs.respond_to? :undeploy_model + @undeploy_model = ::Gapic::Config::Method.new undeploy_model_config + mutate_deployed_model_config = parent_rpcs.mutate_deployed_model if parent_rpcs.respond_to? :mutate_deployed_model + @mutate_deployed_model = ::Gapic::Config::Method.new mutate_deployed_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb new file mode 100644 index 000000000000..2e9e0a7f0865 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + 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 EndpointService 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 EndpointService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb new file mode 100644 index 000000000000..8df194a8222b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb @@ -0,0 +1,636 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/endpoint_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + module Rest + ## + # REST service stub for the EndpointService 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_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateEndpointRequest] + # 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_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_endpoint_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_endpoint", + 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_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetEndpointRequest] + # 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::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # A result object deserialized from the server's reply + def get_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_endpoint_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Endpoint.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_endpoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEndpointsRequest] + # 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::ListEndpointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListEndpointsResponse] + # A result object deserialized from the server's reply + def list_endpoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_endpoints_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_endpoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListEndpointsResponse.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_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest] + # 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::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # A result object deserialized from the server's reply + def update_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Endpoint.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_endpoint_long_running REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_endpoint_long_running request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_long_running_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_endpoint_long_running", + 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_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest] + # 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_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_endpoint_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_endpoint", + 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 deploy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeployModelRequest] + # 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 deploy_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_model_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: "deploy_model", + 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 undeploy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UndeployModelRequest] + # 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 undeploy_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_model_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: "undeploy_model", + 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 mutate_deployed_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest] + # 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 mutate_deployed_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mutate_deployed_model_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: "mutate_deployed_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/endpoints", + body: "endpoint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_endpoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEndpointsRequest] + # 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_endpoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/endpoints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{endpoint.name}", + body: "endpoint", + matches: [ + ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_endpoint_long_running REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest] + # 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_endpoint_long_running_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint.name}:update", + body: "*", + matches: [ + ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeployModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:deployModel", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UndeployModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:undeployModel", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mutate_deployed_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mutate_deployed_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:mutateDeployedModel", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service.rb new file mode 100644 index 000000000000..6a09f44bf750 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/evaluation_service/credentials" +require "google/cloud/ai_platform/v1/evaluation_service/paths" +require "google/cloud/ai_platform/v1/evaluation_service/client" +require "google/cloud/ai_platform/v1/evaluation_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Vertex AI Online Evaluation Service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/evaluation_service" + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/evaluation_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.new + # + module EvaluationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "evaluation_service", "helpers.rb" +require "google/cloud/ai_platform/v1/evaluation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb new file mode 100644 index 000000000000..267a0644ef37 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb @@ -0,0 +1,540 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/evaluation_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + ## + # Client for the EvaluationService service. + # + # Vertex AI Online Evaluation Service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :evaluation_service_stub + + ## + # Configure the EvaluationService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::EvaluationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EvaluationService clients + # ::Google::Cloud::AIPlatform::V1::EvaluationService::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 EvaluationService 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::EvaluationService::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 + @evaluation_service_stub.universe_domain + end + + ## + # Create a new EvaluationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EvaluationService 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/evaluation_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 + + @evaluation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::EvaluationService::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 + ) + + @evaluation_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 = @evaluation_service_stub.endpoint + config.universe_domain = @evaluation_service_stub.universe_domain + config.logger = @evaluation_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 = @evaluation_service_stub.endpoint + config.universe_domain = @evaluation_service_stub.universe_domain + config.logger = @evaluation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @evaluation_service_stub.logger + end + + # Service calls + + ## + # Evaluates instances based on a given metric. + # + # @overload evaluate_instances(request, options = nil) + # Pass arguments to `evaluate_instances` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest, ::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 evaluate_instances(exact_match_input: nil, bleu_input: nil, rouge_input: nil, fluency_input: nil, coherence_input: nil, safety_input: nil, groundedness_input: nil, fulfillment_input: nil, summarization_quality_input: nil, pairwise_summarization_quality_input: nil, summarization_helpfulness_input: nil, summarization_verbosity_input: nil, question_answering_quality_input: nil, pairwise_question_answering_quality_input: nil, question_answering_relevance_input: nil, question_answering_helpfulness_input: nil, question_answering_correctness_input: nil, pointwise_metric_input: nil, pairwise_metric_input: nil, tool_call_valid_input: nil, tool_name_match_input: nil, tool_parameter_key_match_input: nil, tool_parameter_kv_match_input: nil, comet_input: nil, metricx_input: nil, location: nil) + # Pass arguments to `evaluate_instances` 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 exact_match_input [::Google::Cloud::AIPlatform::V1::ExactMatchInput, ::Hash] + # Auto metric instances. + # Instances and metric spec for exact match metric. + # @param bleu_input [::Google::Cloud::AIPlatform::V1::BleuInput, ::Hash] + # Instances and metric spec for bleu metric. + # @param rouge_input [::Google::Cloud::AIPlatform::V1::RougeInput, ::Hash] + # Instances and metric spec for rouge metric. + # @param fluency_input [::Google::Cloud::AIPlatform::V1::FluencyInput, ::Hash] + # LLM-based metric instance. + # General text generation metrics, applicable to other categories. + # Input for fluency metric. + # @param coherence_input [::Google::Cloud::AIPlatform::V1::CoherenceInput, ::Hash] + # Input for coherence metric. + # @param safety_input [::Google::Cloud::AIPlatform::V1::SafetyInput, ::Hash] + # Input for safety metric. + # @param groundedness_input [::Google::Cloud::AIPlatform::V1::GroundednessInput, ::Hash] + # Input for groundedness metric. + # @param fulfillment_input [::Google::Cloud::AIPlatform::V1::FulfillmentInput, ::Hash] + # Input for fulfillment metric. + # @param summarization_quality_input [::Google::Cloud::AIPlatform::V1::SummarizationQualityInput, ::Hash] + # Input for summarization quality metric. + # @param pairwise_summarization_quality_input [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualityInput, ::Hash] + # Input for pairwise summarization quality metric. + # @param summarization_helpfulness_input [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessInput, ::Hash] + # Input for summarization helpfulness metric. + # @param summarization_verbosity_input [::Google::Cloud::AIPlatform::V1::SummarizationVerbosityInput, ::Hash] + # Input for summarization verbosity metric. + # @param question_answering_quality_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualityInput, ::Hash] + # Input for question answering quality metric. + # @param pairwise_question_answering_quality_input [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualityInput, ::Hash] + # Input for pairwise question answering quality metric. + # @param question_answering_relevance_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceInput, ::Hash] + # Input for question answering relevance metric. + # @param question_answering_helpfulness_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessInput, ::Hash] + # Input for question answering helpfulness + # metric. + # @param question_answering_correctness_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessInput, ::Hash] + # Input for question answering correctness + # metric. + # @param pointwise_metric_input [::Google::Cloud::AIPlatform::V1::PointwiseMetricInput, ::Hash] + # Input for pointwise metric. + # @param pairwise_metric_input [::Google::Cloud::AIPlatform::V1::PairwiseMetricInput, ::Hash] + # Input for pairwise metric. + # @param tool_call_valid_input [::Google::Cloud::AIPlatform::V1::ToolCallValidInput, ::Hash] + # Tool call metric instances. + # Input for tool call valid metric. + # @param tool_name_match_input [::Google::Cloud::AIPlatform::V1::ToolNameMatchInput, ::Hash] + # Input for tool name match metric. + # @param tool_parameter_key_match_input [::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchInput, ::Hash] + # Input for tool parameter key match metric. + # @param tool_parameter_kv_match_input [::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchInput, ::Hash] + # Input for tool parameter key value match metric. + # @param comet_input [::Google::Cloud::AIPlatform::V1::CometInput, ::Hash] + # Translation metrics. + # Input for Comet metric. + # @param metricx_input [::Google::Cloud::AIPlatform::V1::MetricxInput, ::Hash] + # Input for Metricx metric. + # @param location [::String] + # Required. The resource name of the Location to evaluate the instances. + # Format: `projects/{project}/locations/{location}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse] + # + # @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::EvaluationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest.new + # + # # Call the evaluate_instances method. + # result = client.evaluate_instances request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse. + # p result + # + def evaluate_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest + + # 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.evaluate_instances.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.location + header_params["location"] = request.location + 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.evaluate_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.evaluate_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @evaluation_service_stub.call_rpc :evaluate_instances, 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 EvaluationService API. + # + # This class represents the configuration for EvaluationService, + # 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::EvaluationService::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 + # # evaluate_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::EvaluationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.evaluate_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.evaluate_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the EvaluationService 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 `evaluate_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :evaluate_instances + + # @private + def initialize parent_rpcs = nil + evaluate_instances_config = parent_rpcs.evaluate_instances if parent_rpcs.respond_to? :evaluate_instances + @evaluate_instances = ::Gapic::Config::Method.new evaluate_instances_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/credentials.rb new file mode 100644 index 000000000000..c55f04237564 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + # Credentials for the EvaluationService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/paths.rb new file mode 100644 index 000000000000..8a39ff26918d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + # Path helper methods for the EvaluationService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest.rb new file mode 100644 index 000000000000..91ffb4635db4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/evaluation_service/credentials" +require "google/cloud/ai_platform/v1/evaluation_service/paths" +require "google/cloud/ai_platform/v1/evaluation_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Vertex AI Online Evaluation Service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/evaluation_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.new + # + module EvaluationService + # 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/evaluation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb new file mode 100644 index 000000000000..3c46424437ab --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb @@ -0,0 +1,516 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/evaluation_service_pb" +require "google/cloud/ai_platform/v1/evaluation_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + module Rest + ## + # REST client for the EvaluationService service. + # + # Vertex AI Online Evaluation Service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :evaluation_service_stub + + ## + # Configure the EvaluationService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EvaluationService clients + # ::Google::Cloud::AIPlatform::V1::EvaluationService::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 EvaluationService 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::EvaluationService::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 + @evaluation_service_stub.universe_domain + end + + ## + # Create a new EvaluationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EvaluationService 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 + + @evaluation_service_stub = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @evaluation_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 = @evaluation_service_stub.endpoint + config.universe_domain = @evaluation_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @evaluation_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 = @evaluation_service_stub.endpoint + config.universe_domain = @evaluation_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @evaluation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @evaluation_service_stub.logger + end + + # Service calls + + ## + # Evaluates instances based on a given metric. + # + # @overload evaluate_instances(request, options = nil) + # Pass arguments to `evaluate_instances` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest, ::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 evaluate_instances(exact_match_input: nil, bleu_input: nil, rouge_input: nil, fluency_input: nil, coherence_input: nil, safety_input: nil, groundedness_input: nil, fulfillment_input: nil, summarization_quality_input: nil, pairwise_summarization_quality_input: nil, summarization_helpfulness_input: nil, summarization_verbosity_input: nil, question_answering_quality_input: nil, pairwise_question_answering_quality_input: nil, question_answering_relevance_input: nil, question_answering_helpfulness_input: nil, question_answering_correctness_input: nil, pointwise_metric_input: nil, pairwise_metric_input: nil, tool_call_valid_input: nil, tool_name_match_input: nil, tool_parameter_key_match_input: nil, tool_parameter_kv_match_input: nil, comet_input: nil, metricx_input: nil, location: nil) + # Pass arguments to `evaluate_instances` 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 exact_match_input [::Google::Cloud::AIPlatform::V1::ExactMatchInput, ::Hash] + # Auto metric instances. + # Instances and metric spec for exact match metric. + # @param bleu_input [::Google::Cloud::AIPlatform::V1::BleuInput, ::Hash] + # Instances and metric spec for bleu metric. + # @param rouge_input [::Google::Cloud::AIPlatform::V1::RougeInput, ::Hash] + # Instances and metric spec for rouge metric. + # @param fluency_input [::Google::Cloud::AIPlatform::V1::FluencyInput, ::Hash] + # LLM-based metric instance. + # General text generation metrics, applicable to other categories. + # Input for fluency metric. + # @param coherence_input [::Google::Cloud::AIPlatform::V1::CoherenceInput, ::Hash] + # Input for coherence metric. + # @param safety_input [::Google::Cloud::AIPlatform::V1::SafetyInput, ::Hash] + # Input for safety metric. + # @param groundedness_input [::Google::Cloud::AIPlatform::V1::GroundednessInput, ::Hash] + # Input for groundedness metric. + # @param fulfillment_input [::Google::Cloud::AIPlatform::V1::FulfillmentInput, ::Hash] + # Input for fulfillment metric. + # @param summarization_quality_input [::Google::Cloud::AIPlatform::V1::SummarizationQualityInput, ::Hash] + # Input for summarization quality metric. + # @param pairwise_summarization_quality_input [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualityInput, ::Hash] + # Input for pairwise summarization quality metric. + # @param summarization_helpfulness_input [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessInput, ::Hash] + # Input for summarization helpfulness metric. + # @param summarization_verbosity_input [::Google::Cloud::AIPlatform::V1::SummarizationVerbosityInput, ::Hash] + # Input for summarization verbosity metric. + # @param question_answering_quality_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualityInput, ::Hash] + # Input for question answering quality metric. + # @param pairwise_question_answering_quality_input [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualityInput, ::Hash] + # Input for pairwise question answering quality metric. + # @param question_answering_relevance_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceInput, ::Hash] + # Input for question answering relevance metric. + # @param question_answering_helpfulness_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessInput, ::Hash] + # Input for question answering helpfulness + # metric. + # @param question_answering_correctness_input [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessInput, ::Hash] + # Input for question answering correctness + # metric. + # @param pointwise_metric_input [::Google::Cloud::AIPlatform::V1::PointwiseMetricInput, ::Hash] + # Input for pointwise metric. + # @param pairwise_metric_input [::Google::Cloud::AIPlatform::V1::PairwiseMetricInput, ::Hash] + # Input for pairwise metric. + # @param tool_call_valid_input [::Google::Cloud::AIPlatform::V1::ToolCallValidInput, ::Hash] + # Tool call metric instances. + # Input for tool call valid metric. + # @param tool_name_match_input [::Google::Cloud::AIPlatform::V1::ToolNameMatchInput, ::Hash] + # Input for tool name match metric. + # @param tool_parameter_key_match_input [::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchInput, ::Hash] + # Input for tool parameter key match metric. + # @param tool_parameter_kv_match_input [::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchInput, ::Hash] + # Input for tool parameter key value match metric. + # @param comet_input [::Google::Cloud::AIPlatform::V1::CometInput, ::Hash] + # Translation metrics. + # Input for Comet metric. + # @param metricx_input [::Google::Cloud::AIPlatform::V1::MetricxInput, ::Hash] + # Input for Metricx metric. + # @param location [::String] + # Required. The resource name of the Location to evaluate the instances. + # Format: `projects/{project}/locations/{location}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse] + # + # @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::EvaluationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest.new + # + # # Call the evaluate_instances method. + # result = client.evaluate_instances request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse. + # p result + # + def evaluate_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest + + # 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.evaluate_instances.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.evaluate_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.evaluate_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @evaluation_service_stub.evaluate_instances 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 EvaluationService REST API. + # + # This class represents the configuration for EvaluationService 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::EvaluationService::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 + # # evaluate_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.evaluate_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.evaluate_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the EvaluationService 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 `evaluate_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :evaluate_instances + + # @private + def initialize parent_rpcs = nil + evaluate_instances_config = parent_rpcs.evaluate_instances if parent_rpcs.respond_to? :evaluate_instances + @evaluate_instances = ::Gapic::Config::Method.new evaluate_instances_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb new file mode 100644 index 000000000000..d51d8a7454b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/evaluation_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + module Rest + ## + # REST service stub for the EvaluationService 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 evaluate_instances REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest] + # 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::EvaluateInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse] + # A result object deserialized from the server's reply + def evaluate_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_evaluate_instances_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: "evaluate_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse.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 evaluate_instances REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_evaluate_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{location}:evaluateInstances", + body: "*", + matches: [ + ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb new file mode 100644 index 000000000000..44b4c059636f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/paths" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/operations" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/client" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/feature_online_store_admin_service" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.new + # + module FeatureOnlineStoreAdminService + end + end + end + end +end + +helper_path = ::File.join __dir__, "feature_online_store_admin_service", "helpers.rb" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb new file mode 100644 index 000000000000..f0aeb3b75621 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb @@ -0,0 +1,1873 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_online_store_admin_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + ## + # Client for the FeatureOnlineStoreAdminService service. + # + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_online_store_admin_service_stub + + ## + # Configure the FeatureOnlineStoreAdminService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureOnlineStoreAdminService clients + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::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 FeatureOnlineStoreAdminService 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::FeatureOnlineStoreAdminService::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 + @feature_online_store_admin_service_stub.universe_domain + end + + ## + # Create a new FeatureOnlineStoreAdminService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureOnlineStoreAdminService 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/feature_online_store_admin_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 + + @feature_online_store_admin_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::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 + ) + + @feature_online_store_admin_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 = @feature_online_store_admin_service_stub.endpoint + config.universe_domain = @feature_online_store_admin_service_stub.universe_domain + config.logger = @feature_online_store_admin_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 = @feature_online_store_admin_service_stub.endpoint + config.universe_domain = @feature_online_store_admin_service_stub.universe_domain + config.logger = @feature_online_store_admin_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::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 + @feature_online_store_admin_service_stub.logger + end + + # Service calls + + ## + # Creates a new FeatureOnlineStore in a given project and location. + # + # @overload create_feature_online_store(request, options = nil) + # Pass arguments to `create_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest, ::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_feature_online_store(parent: nil, feature_online_store: nil, feature_online_store_id: nil) + # Pass arguments to `create_feature_online_store` 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 FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @param feature_online_store [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore, ::Hash] + # Required. The FeatureOnlineStore to create. + # @param feature_online_store_id [::String] + # Required. The ID to use for this FeatureOnlineStore, which will become the + # final component of the FeatureOnlineStore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest.new + # + # # Call the create_feature_online_store method. + # result = client.create_feature_online_store 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_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :create_feature_online_store, 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 a single FeatureOnlineStore. + # + # @overload get_feature_online_store(request, options = nil) + # Pass arguments to `get_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest, ::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_feature_online_store(name: nil) + # Pass arguments to `get_feature_online_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureOnlineStore resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest.new + # + # # Call the get_feature_online_store method. + # result = client.get_feature_online_store request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureOnlineStore. + # p result + # + def get_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :get_feature_online_store, 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 FeatureOnlineStores in a given project and location. + # + # @overload list_feature_online_stores(request, options = nil) + # Pass arguments to `list_feature_online_stores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest, ::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_feature_online_stores(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_online_stores` 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 FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the FeatureOnlineStores that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureOnlineStores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureOnlineStores with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of FeatureOnlineStores to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureOnlineStores will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureOnlineStore>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureOnlineStore>] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest.new + # + # # Call the list_feature_online_stores method. + # result = client.list_feature_online_stores 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::FeatureOnlineStore. + # p item + # end + # + def list_feature_online_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest + + # 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_feature_online_stores.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_feature_online_stores.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_feature_online_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :list_feature_online_stores, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_online_stores, 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 parameters of a single FeatureOnlineStore. + # + # @overload update_feature_online_store(request, options = nil) + # Pass arguments to `update_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest, ::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_feature_online_store(feature_online_store: nil, update_mask: nil) + # Pass arguments to `update_feature_online_store` 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 feature_online_store [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore, ::Hash] + # Required. The FeatureOnlineStore's `name` field is used to identify the + # FeatureOnlineStore to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureOnlineStore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `bigtable` + # * `bigtable.auto_scaling` + # * `bigtable.enable_multi_region_replica` + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest.new + # + # # Call the update_feature_online_store method. + # result = client.update_feature_online_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest + + # 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_feature_online_store.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.feature_online_store&.name + header_params["feature_online_store.name"] = request.feature_online_store.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_feature_online_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :update_feature_online_store, 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 single FeatureOnlineStore. The FeatureOnlineStore must not + # contain any FeatureViews. + # + # @overload delete_feature_online_store(request, options = nil) + # Pass arguments to `delete_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest, ::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_feature_online_store(name: nil, force: nil) + # Pass arguments to `delete_feature_online_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureOnlineStore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param force [::Boolean] + # If set to true, any FeatureViews and Features for this FeatureOnlineStore + # will also be deleted. (Otherwise, the request will only work if the + # FeatureOnlineStore has no FeatureViews.) + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest.new + # + # # Call the delete_feature_online_store method. + # result = client.delete_feature_online_store 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_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :delete_feature_online_store, 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 + + ## + # Creates a new FeatureView in a given FeatureOnlineStore. + # + # @overload create_feature_view(request, options = nil) + # Pass arguments to `create_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest, ::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_feature_view(parent: nil, feature_view: nil, feature_view_id: nil, run_sync_immediately: nil) + # Pass arguments to `create_feature_view` 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 FeatureOnlineStore to create + # FeatureViews. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param feature_view [::Google::Cloud::AIPlatform::V1::FeatureView, ::Hash] + # Required. The FeatureView to create. + # @param feature_view_id [::String] + # Required. The ID to use for the FeatureView, which will become the final + # component of the FeatureView's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a FeatureOnlineStore. + # @param run_sync_immediately [::Boolean] + # Immutable. If set to true, one on demand sync will be run immediately, + # regardless whether the + # {::Google::Cloud::AIPlatform::V1::FeatureView#sync_config FeatureView.sync_config} + # is configured or not. + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest.new + # + # # Call the create_feature_view method. + # result = client.create_feature_view 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_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :create_feature_view, 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 a single FeatureView. + # + # @overload get_feature_view(request, options = nil) + # Pass arguments to `get_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest, ::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_feature_view(name: nil) + # Pass arguments to `get_feature_view` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureView resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::FeatureView] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureView] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureViewRequest.new + # + # # Call the get_feature_view method. + # result = client.get_feature_view request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureView. + # p result + # + def get_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :get_feature_view, 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 FeatureViews in a given FeatureOnlineStore. + # + # @overload list_feature_views(request, options = nil) + # Pass arguments to `list_feature_views` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest, ::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_feature_views(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_views` 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 FeatureOnlineStore to list FeatureViews. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param filter [::String] + # Lists the FeatureViews that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViews + # created or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> FeatureViews having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any FeatureView which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of FeatureViews to return. The service may return fewer + # than this value. If unspecified, at most 1000 FeatureViews will be + # returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `feature_view_id` + # * `create_time` + # * `update_time` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureView>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureView>] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest.new + # + # # Call the list_feature_views method. + # result = client.list_feature_views 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::FeatureView. + # p item + # end + # + def list_feature_views request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest + + # 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_feature_views.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_feature_views.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_feature_views.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :list_feature_views, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_views, 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 parameters of a single FeatureView. + # + # @overload update_feature_view(request, options = nil) + # Pass arguments to `update_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest, ::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_feature_view(feature_view: nil, update_mask: nil) + # Pass arguments to `update_feature_view` 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 feature_view [::Google::Cloud::AIPlatform::V1::FeatureView, ::Hash] + # Required. The FeatureView's `name` field is used to identify the + # FeatureView to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureView resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `service_agent_type` + # * `big_query_source` + # * `big_query_source.uri` + # * `big_query_source.entity_id_columns` + # * `feature_registry_source` + # * `feature_registry_source.feature_groups` + # * `sync_config` + # * `sync_config.cron` + # * `optimized_config.automatic_resources` + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest.new + # + # # Call the update_feature_view method. + # result = client.update_feature_view request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest + + # 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_feature_view.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.feature_view&.name + header_params["feature_view.name"] = request.feature_view.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_feature_view.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :update_feature_view, 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 single FeatureView. + # + # @overload delete_feature_view(request, options = nil) + # Pass arguments to `delete_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest, ::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_feature_view(name: nil) + # Pass arguments to `delete_feature_view` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureView to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest.new + # + # # Call the delete_feature_view method. + # result = client.delete_feature_view 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_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :delete_feature_view, 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 + + ## + # Triggers on-demand sync for the FeatureView. + # + # @overload sync_feature_view(request, options = nil) + # Pass arguments to `sync_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest, ::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 sync_feature_view(feature_view: nil) + # Pass arguments to `sync_feature_view` 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 feature_view [::String] + # Required. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest.new + # + # # Call the sync_feature_view method. + # result = client.sync_feature_view request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse. + # p result + # + def sync_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest + + # 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.sync_feature_view.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.feature_view + header_params["feature_view"] = request.feature_view + 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.sync_feature_view.timeout, + metadata: metadata, + retry_policy: @config.rpcs.sync_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :sync_feature_view, 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 + + ## + # Gets details of a single FeatureViewSync. + # + # @overload get_feature_view_sync(request, options = nil) + # Pass arguments to `get_feature_view_sync` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest, ::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_feature_view_sync(name: nil) + # Pass arguments to `get_feature_view_sync` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureViewSync resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Aiplatform::V1::FeatureViewSync] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Aiplatform::V1::FeatureViewSync] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest.new + # + # # Call the get_feature_view_sync method. + # result = client.get_feature_view_sync request + # + # # The returned object is of type Google::Cloud::Aiplatform::V1::FeatureViewSync. + # p result + # + def get_feature_view_sync request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest + + # 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_feature_view_sync.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_feature_view_sync.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature_view_sync.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :get_feature_view_sync, 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 FeatureViewSyncs in a given FeatureView. + # + # @overload list_feature_view_syncs(request, options = nil) + # Pass arguments to `list_feature_view_syncs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest, ::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_feature_view_syncs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_view_syncs` 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 FeatureView to list FeatureViewSyncs. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @param filter [::String] + # Lists the FeatureViewSyncs that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViewSyncs + # created after 2020-01-31T15:30:00.000000Z. + # @param page_size [::Integer] + # The maximum number of FeatureViewSyncs to return. The service may return + # fewer than this value. If unspecified, at most 1000 FeatureViewSyncs will + # be returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Aiplatform::V1::FeatureViewSync>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Aiplatform::V1::FeatureViewSync>] + # + # @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::FeatureOnlineStoreAdminService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest.new + # + # # Call the list_feature_view_syncs method. + # result = client.list_feature_view_syncs 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::FeatureViewSync. + # p item + # end + # + def list_feature_view_syncs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest + + # 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_feature_view_syncs.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_feature_view_syncs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_feature_view_syncs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.call_rpc :list_feature_view_syncs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_view_syncs, 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 + + ## + # Configuration class for the FeatureOnlineStoreAdminService API. + # + # This class represents the configuration for FeatureOnlineStoreAdminService, + # 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::FeatureOnlineStoreAdminService::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_feature_online_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_online_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_online_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeatureOnlineStoreAdminService 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_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_online_store + ## + # RPC-specific configuration for `get_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_online_store + ## + # RPC-specific configuration for `list_feature_online_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_online_stores + ## + # RPC-specific configuration for `update_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_online_store + ## + # RPC-specific configuration for `delete_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_online_store + ## + # RPC-specific configuration for `create_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_view + ## + # RPC-specific configuration for `get_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_view + ## + # RPC-specific configuration for `list_feature_views` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_views + ## + # RPC-specific configuration for `update_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_view + ## + # RPC-specific configuration for `delete_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_view + ## + # RPC-specific configuration for `sync_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :sync_feature_view + ## + # RPC-specific configuration for `get_feature_view_sync` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_view_sync + ## + # RPC-specific configuration for `list_feature_view_syncs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_view_syncs + + # @private + def initialize parent_rpcs = nil + create_feature_online_store_config = parent_rpcs.create_feature_online_store if parent_rpcs.respond_to? :create_feature_online_store + @create_feature_online_store = ::Gapic::Config::Method.new create_feature_online_store_config + get_feature_online_store_config = parent_rpcs.get_feature_online_store if parent_rpcs.respond_to? :get_feature_online_store + @get_feature_online_store = ::Gapic::Config::Method.new get_feature_online_store_config + list_feature_online_stores_config = parent_rpcs.list_feature_online_stores if parent_rpcs.respond_to? :list_feature_online_stores + @list_feature_online_stores = ::Gapic::Config::Method.new list_feature_online_stores_config + update_feature_online_store_config = parent_rpcs.update_feature_online_store if parent_rpcs.respond_to? :update_feature_online_store + @update_feature_online_store = ::Gapic::Config::Method.new update_feature_online_store_config + delete_feature_online_store_config = parent_rpcs.delete_feature_online_store if parent_rpcs.respond_to? :delete_feature_online_store + @delete_feature_online_store = ::Gapic::Config::Method.new delete_feature_online_store_config + create_feature_view_config = parent_rpcs.create_feature_view if parent_rpcs.respond_to? :create_feature_view + @create_feature_view = ::Gapic::Config::Method.new create_feature_view_config + get_feature_view_config = parent_rpcs.get_feature_view if parent_rpcs.respond_to? :get_feature_view + @get_feature_view = ::Gapic::Config::Method.new get_feature_view_config + list_feature_views_config = parent_rpcs.list_feature_views if parent_rpcs.respond_to? :list_feature_views + @list_feature_views = ::Gapic::Config::Method.new list_feature_views_config + update_feature_view_config = parent_rpcs.update_feature_view if parent_rpcs.respond_to? :update_feature_view + @update_feature_view = ::Gapic::Config::Method.new update_feature_view_config + delete_feature_view_config = parent_rpcs.delete_feature_view if parent_rpcs.respond_to? :delete_feature_view + @delete_feature_view = ::Gapic::Config::Method.new delete_feature_view_config + sync_feature_view_config = parent_rpcs.sync_feature_view if parent_rpcs.respond_to? :sync_feature_view + @sync_feature_view = ::Gapic::Config::Method.new sync_feature_view_config + get_feature_view_sync_config = parent_rpcs.get_feature_view_sync if parent_rpcs.respond_to? :get_feature_view_sync + @get_feature_view_sync = ::Gapic::Config::Method.new get_feature_view_sync_config + list_feature_view_syncs_config = parent_rpcs.list_feature_view_syncs if parent_rpcs.respond_to? :list_feature_view_syncs + @list_feature_view_syncs = ::Gapic::Config::Method.new list_feature_view_syncs_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials.rb new file mode 100644 index 000000000000..7e7fac103549 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + # Credentials for the FeatureOnlineStoreAdminService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb new file mode 100644 index 000000000000..92276c6ef8f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + # 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 FeatureOnlineStoreAdminService 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 FeatureOnlineStoreAdminService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/paths.rb new file mode 100644 index 000000000000..1434293d530f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/paths.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + # Path helper methods for the FeatureOnlineStoreAdminService API. + module Paths + ## + # Create a fully-qualified FeatureOnlineStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # + # @param project [String] + # @param location [String] + # @param feature_online_store [String] + # + # @return [::String] + def feature_online_store_path project:, location:, feature_online_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureOnlineStores/#{feature_online_store}" + end + + ## + # Create a fully-qualified FeatureView resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # + # @param project [String] + # @param location [String] + # @param feature_online_store [String] + # @param feature_view [String] + # + # @return [::String] + def feature_view_path project:, location:, feature_online_store:, feature_view: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "feature_online_store cannot contain /" if feature_online_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureOnlineStores/#{feature_online_store}/featureViews/#{feature_view}" + end + + ## + # Create a fully-qualified FeatureViewSync resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync` + # + # @param project [String] + # @param location [String] + # @param feature_online_store [String] + # @param feature_view [String] + # + # @return [::String] + def feature_view_sync_path project:, location:, feature_online_store:, feature_view: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "feature_online_store cannot contain /" if feature_online_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureOnlineStores/#{feature_online_store}/featureViews/#{feature_view}/featureViewSyncs/feature_view_sync" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest.rb new file mode 100644 index 000000000000..07b9a4e621f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/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/feature_online_store_admin_service/credentials" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/paths" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.new + # + module FeatureOnlineStoreAdminService + # 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/feature_online_store_admin_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb new file mode 100644 index 000000000000..166e3dbb1bc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb @@ -0,0 +1,1765 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_online_store_admin_service_pb" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + module Rest + ## + # REST client for the FeatureOnlineStoreAdminService service. + # + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_online_store_admin_service_stub + + ## + # Configure the FeatureOnlineStoreAdminService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureOnlineStoreAdminService clients + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::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 FeatureOnlineStoreAdminService 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::FeatureOnlineStoreAdminService::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 + @feature_online_store_admin_service_stub.universe_domain + end + + ## + # Create a new FeatureOnlineStoreAdminService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureOnlineStoreAdminService 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::FeatureOnlineStoreAdminService::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 + + @feature_online_store_admin_service_stub = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @feature_online_store_admin_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 = @feature_online_store_admin_service_stub.endpoint + config.universe_domain = @feature_online_store_admin_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_online_store_admin_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 = @feature_online_store_admin_service_stub.endpoint + config.universe_domain = @feature_online_store_admin_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_online_store_admin_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::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 + @feature_online_store_admin_service_stub.logger + end + + # Service calls + + ## + # Creates a new FeatureOnlineStore in a given project and location. + # + # @overload create_feature_online_store(request, options = nil) + # Pass arguments to `create_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest, ::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_feature_online_store(parent: nil, feature_online_store: nil, feature_online_store_id: nil) + # Pass arguments to `create_feature_online_store` 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 FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @param feature_online_store [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore, ::Hash] + # Required. The FeatureOnlineStore to create. + # @param feature_online_store_id [::String] + # Required. The ID to use for this FeatureOnlineStore, which will become the + # final component of the FeatureOnlineStore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest.new + # + # # Call the create_feature_online_store method. + # result = client.create_feature_online_store 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_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.create_feature_online_store 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 a single FeatureOnlineStore. + # + # @overload get_feature_online_store(request, options = nil) + # Pass arguments to `get_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest, ::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_feature_online_store(name: nil) + # Pass arguments to `get_feature_online_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureOnlineStore resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest.new + # + # # Call the get_feature_online_store method. + # result = client.get_feature_online_store request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureOnlineStore. + # p result + # + def get_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.get_feature_online_store 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 FeatureOnlineStores in a given project and location. + # + # @overload list_feature_online_stores(request, options = nil) + # Pass arguments to `list_feature_online_stores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest, ::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_feature_online_stores(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_online_stores` 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 FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the FeatureOnlineStores that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureOnlineStores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureOnlineStores with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of FeatureOnlineStores to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureOnlineStores will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureOnlineStore>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureOnlineStore>] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest.new + # + # # Call the list_feature_online_stores method. + # result = client.list_feature_online_stores 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::FeatureOnlineStore. + # p item + # end + # + def list_feature_online_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest + + # 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_feature_online_stores.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_feature_online_stores.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_feature_online_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.list_feature_online_stores request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_online_stores, "feature_online_stores", 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 parameters of a single FeatureOnlineStore. + # + # @overload update_feature_online_store(request, options = nil) + # Pass arguments to `update_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest, ::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_feature_online_store(feature_online_store: nil, update_mask: nil) + # Pass arguments to `update_feature_online_store` 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 feature_online_store [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore, ::Hash] + # Required. The FeatureOnlineStore's `name` field is used to identify the + # FeatureOnlineStore to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureOnlineStore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `bigtable` + # * `bigtable.auto_scaling` + # * `bigtable.enable_multi_region_replica` + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest.new + # + # # Call the update_feature_online_store method. + # result = client.update_feature_online_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.update_feature_online_store 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 single FeatureOnlineStore. The FeatureOnlineStore must not + # contain any FeatureViews. + # + # @overload delete_feature_online_store(request, options = nil) + # Pass arguments to `delete_feature_online_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest, ::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_feature_online_store(name: nil, force: nil) + # Pass arguments to `delete_feature_online_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureOnlineStore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param force [::Boolean] + # If set to true, any FeatureViews and Features for this FeatureOnlineStore + # will also be deleted. (Otherwise, the request will only work if the + # FeatureOnlineStore has no FeatureViews.) + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest.new + # + # # Call the delete_feature_online_store method. + # result = client.delete_feature_online_store 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_feature_online_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest + + # 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_feature_online_store.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_feature_online_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature_online_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.delete_feature_online_store 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 + + ## + # Creates a new FeatureView in a given FeatureOnlineStore. + # + # @overload create_feature_view(request, options = nil) + # Pass arguments to `create_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest, ::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_feature_view(parent: nil, feature_view: nil, feature_view_id: nil, run_sync_immediately: nil) + # Pass arguments to `create_feature_view` 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 FeatureOnlineStore to create + # FeatureViews. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param feature_view [::Google::Cloud::AIPlatform::V1::FeatureView, ::Hash] + # Required. The FeatureView to create. + # @param feature_view_id [::String] + # Required. The ID to use for the FeatureView, which will become the final + # component of the FeatureView's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a FeatureOnlineStore. + # @param run_sync_immediately [::Boolean] + # Immutable. If set to true, one on demand sync will be run immediately, + # regardless whether the + # {::Google::Cloud::AIPlatform::V1::FeatureView#sync_config FeatureView.sync_config} + # is configured or not. + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest.new + # + # # Call the create_feature_view method. + # result = client.create_feature_view 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_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.create_feature_view 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 a single FeatureView. + # + # @overload get_feature_view(request, options = nil) + # Pass arguments to `get_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest, ::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_feature_view(name: nil) + # Pass arguments to `get_feature_view` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureView resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::FeatureView] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureView] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureViewRequest.new + # + # # Call the get_feature_view method. + # result = client.get_feature_view request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureView. + # p result + # + def get_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.get_feature_view 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 FeatureViews in a given FeatureOnlineStore. + # + # @overload list_feature_views(request, options = nil) + # Pass arguments to `list_feature_views` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest, ::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_feature_views(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_views` 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 FeatureOnlineStore to list FeatureViews. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @param filter [::String] + # Lists the FeatureViews that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViews + # created or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> FeatureViews having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any FeatureView which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of FeatureViews to return. The service may return fewer + # than this value. If unspecified, at most 1000 FeatureViews will be + # returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `feature_view_id` + # * `create_time` + # * `update_time` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureView>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureView>] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest.new + # + # # Call the list_feature_views method. + # result = client.list_feature_views 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::FeatureView. + # p item + # end + # + def list_feature_views request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest + + # 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_feature_views.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_feature_views.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_feature_views.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.list_feature_views request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_views, "feature_views", 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 parameters of a single FeatureView. + # + # @overload update_feature_view(request, options = nil) + # Pass arguments to `update_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest, ::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_feature_view(feature_view: nil, update_mask: nil) + # Pass arguments to `update_feature_view` 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 feature_view [::Google::Cloud::AIPlatform::V1::FeatureView, ::Hash] + # Required. The FeatureView's `name` field is used to identify the + # FeatureView to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureView resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `service_agent_type` + # * `big_query_source` + # * `big_query_source.uri` + # * `big_query_source.entity_id_columns` + # * `feature_registry_source` + # * `feature_registry_source.feature_groups` + # * `sync_config` + # * `sync_config.cron` + # * `optimized_config.automatic_resources` + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest.new + # + # # Call the update_feature_view method. + # result = client.update_feature_view request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.update_feature_view 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 single FeatureView. + # + # @overload delete_feature_view(request, options = nil) + # Pass arguments to `delete_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest, ::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_feature_view(name: nil) + # Pass arguments to `delete_feature_view` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureView to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest.new + # + # # Call the delete_feature_view method. + # result = client.delete_feature_view 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_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest + + # 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_feature_view.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_feature_view.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.delete_feature_view 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 + + ## + # Triggers on-demand sync for the FeatureView. + # + # @overload sync_feature_view(request, options = nil) + # Pass arguments to `sync_feature_view` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest, ::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 sync_feature_view(feature_view: nil) + # Pass arguments to `sync_feature_view` 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 feature_view [::String] + # Required. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest.new + # + # # Call the sync_feature_view method. + # result = client.sync_feature_view request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse. + # p result + # + def sync_feature_view request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest + + # 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.sync_feature_view.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.sync_feature_view.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.sync_feature_view.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.sync_feature_view 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 + + ## + # Gets details of a single FeatureViewSync. + # + # @overload get_feature_view_sync(request, options = nil) + # Pass arguments to `get_feature_view_sync` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest, ::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_feature_view_sync(name: nil) + # Pass arguments to `get_feature_view_sync` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureViewSync resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Aiplatform::V1::FeatureViewSync] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Aiplatform::V1::FeatureViewSync] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest.new + # + # # Call the get_feature_view_sync method. + # result = client.get_feature_view_sync request + # + # # The returned object is of type Google::Cloud::Aiplatform::V1::FeatureViewSync. + # p result + # + def get_feature_view_sync request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest + + # 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_feature_view_sync.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_feature_view_sync.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature_view_sync.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.get_feature_view_sync 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 FeatureViewSyncs in a given FeatureView. + # + # @overload list_feature_view_syncs(request, options = nil) + # Pass arguments to `list_feature_view_syncs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest, ::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_feature_view_syncs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_view_syncs` 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 FeatureView to list FeatureViewSyncs. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @param filter [::String] + # Lists the FeatureViewSyncs that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViewSyncs + # created after 2020-01-31T15:30:00.000000Z. + # @param page_size [::Integer] + # The maximum number of FeatureViewSyncs to return. The service may return + # fewer than this value. If unspecified, at most 1000 FeatureViewSyncs will + # be returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Aiplatform::V1::FeatureViewSync>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Aiplatform::V1::FeatureViewSync>] + # + # @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::FeatureOnlineStoreAdminService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest.new + # + # # Call the list_feature_view_syncs method. + # result = client.list_feature_view_syncs 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::FeatureViewSync. + # p item + # end + # + def list_feature_view_syncs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest + + # 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_feature_view_syncs.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_feature_view_syncs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_feature_view_syncs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_admin_service_stub.list_feature_view_syncs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feature_online_store_admin_service_stub, :list_feature_view_syncs, "feature_view_syncs", 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 + + ## + # Configuration class for the FeatureOnlineStoreAdminService REST API. + # + # This class represents the configuration for FeatureOnlineStoreAdminService 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::FeatureOnlineStoreAdminService::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_feature_online_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_online_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_online_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeatureOnlineStoreAdminService 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_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_online_store + ## + # RPC-specific configuration for `get_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_online_store + ## + # RPC-specific configuration for `list_feature_online_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_online_stores + ## + # RPC-specific configuration for `update_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_online_store + ## + # RPC-specific configuration for `delete_feature_online_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_online_store + ## + # RPC-specific configuration for `create_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_view + ## + # RPC-specific configuration for `get_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_view + ## + # RPC-specific configuration for `list_feature_views` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_views + ## + # RPC-specific configuration for `update_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_view + ## + # RPC-specific configuration for `delete_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_view + ## + # RPC-specific configuration for `sync_feature_view` + # @return [::Gapic::Config::Method] + # + attr_reader :sync_feature_view + ## + # RPC-specific configuration for `get_feature_view_sync` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_view_sync + ## + # RPC-specific configuration for `list_feature_view_syncs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_view_syncs + + # @private + def initialize parent_rpcs = nil + create_feature_online_store_config = parent_rpcs.create_feature_online_store if parent_rpcs.respond_to? :create_feature_online_store + @create_feature_online_store = ::Gapic::Config::Method.new create_feature_online_store_config + get_feature_online_store_config = parent_rpcs.get_feature_online_store if parent_rpcs.respond_to? :get_feature_online_store + @get_feature_online_store = ::Gapic::Config::Method.new get_feature_online_store_config + list_feature_online_stores_config = parent_rpcs.list_feature_online_stores if parent_rpcs.respond_to? :list_feature_online_stores + @list_feature_online_stores = ::Gapic::Config::Method.new list_feature_online_stores_config + update_feature_online_store_config = parent_rpcs.update_feature_online_store if parent_rpcs.respond_to? :update_feature_online_store + @update_feature_online_store = ::Gapic::Config::Method.new update_feature_online_store_config + delete_feature_online_store_config = parent_rpcs.delete_feature_online_store if parent_rpcs.respond_to? :delete_feature_online_store + @delete_feature_online_store = ::Gapic::Config::Method.new delete_feature_online_store_config + create_feature_view_config = parent_rpcs.create_feature_view if parent_rpcs.respond_to? :create_feature_view + @create_feature_view = ::Gapic::Config::Method.new create_feature_view_config + get_feature_view_config = parent_rpcs.get_feature_view if parent_rpcs.respond_to? :get_feature_view + @get_feature_view = ::Gapic::Config::Method.new get_feature_view_config + list_feature_views_config = parent_rpcs.list_feature_views if parent_rpcs.respond_to? :list_feature_views + @list_feature_views = ::Gapic::Config::Method.new list_feature_views_config + update_feature_view_config = parent_rpcs.update_feature_view if parent_rpcs.respond_to? :update_feature_view + @update_feature_view = ::Gapic::Config::Method.new update_feature_view_config + delete_feature_view_config = parent_rpcs.delete_feature_view if parent_rpcs.respond_to? :delete_feature_view + @delete_feature_view = ::Gapic::Config::Method.new delete_feature_view_config + sync_feature_view_config = parent_rpcs.sync_feature_view if parent_rpcs.respond_to? :sync_feature_view + @sync_feature_view = ::Gapic::Config::Method.new sync_feature_view_config + get_feature_view_sync_config = parent_rpcs.get_feature_view_sync if parent_rpcs.respond_to? :get_feature_view_sync + @get_feature_view_sync = ::Gapic::Config::Method.new get_feature_view_sync_config + list_feature_view_syncs_config = parent_rpcs.list_feature_view_syncs if parent_rpcs.respond_to? :list_feature_view_syncs + @list_feature_view_syncs = ::Gapic::Config::Method.new list_feature_view_syncs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb new file mode 100644 index 000000000000..205f22ddb789 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + 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 FeatureOnlineStoreAdminService 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 FeatureOnlineStoreAdminService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb new file mode 100644 index 000000000000..31d64d9a6438 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb @@ -0,0 +1,879 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/feature_online_store_admin_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + module Rest + ## + # REST service stub for the FeatureOnlineStoreAdminService 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_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest] + # 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_feature_online_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_feature_online_store_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_feature_online_store", + 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_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest] + # 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::FeatureOnlineStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # A result object deserialized from the server's reply + def get_feature_online_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_online_store_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_feature_online_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStore.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_feature_online_stores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest] + # 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::ListFeatureOnlineStoresResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresResponse] + # A result object deserialized from the server's reply + def list_feature_online_stores request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_feature_online_stores_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_feature_online_stores", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresResponse.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_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_feature_online_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_feature_online_store_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_feature_online_store", + 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_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest] + # 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_feature_online_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_online_store_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_feature_online_store", + 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 create_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest] + # 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_feature_view request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_feature_view_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_feature_view", + 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_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest] + # 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::FeatureView] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureView] + # A result object deserialized from the server's reply + def get_feature_view request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_view_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_feature_view", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::FeatureView.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_feature_views REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest] + # 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::ListFeatureViewsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeatureViewsResponse] + # A result object deserialized from the server's reply + def list_feature_views request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_feature_views_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_feature_views", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeatureViewsResponse.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_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_feature_view request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_feature_view_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_feature_view", + 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_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest] + # 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_feature_view request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_view_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_feature_view", + 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 sync_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest] + # 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::SyncFeatureViewResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse] + # A result object deserialized from the server's reply + def sync_feature_view request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_sync_feature_view_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: "sync_feature_view", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse.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_feature_view_sync REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest] + # 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::FeatureViewSync] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Aiplatform::V1::FeatureViewSync] + # A result object deserialized from the server's reply + def get_feature_view_sync request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_view_sync_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_feature_view_sync", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Aiplatform::V1::FeatureViewSync.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_feature_view_syncs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest] + # 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::ListFeatureViewSyncsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsResponse] + # A result object deserialized from the server's reply + def list_feature_view_syncs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_feature_view_syncs_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_feature_view_syncs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsResponse.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_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest] + # 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_feature_online_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/featureOnlineStores", + body: "feature_online_store", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest] + # 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_feature_online_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_feature_online_stores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest] + # 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_feature_online_stores_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featureOnlineStores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest] + # 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_feature_online_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{feature_online_store.name}", + body: "feature_online_store", + matches: [ + ["feature_online_store.name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature_online_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest] + # 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_feature_online_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest] + # 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_feature_view_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/featureViews", + body: "feature_view", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest] + # 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_feature_view_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_feature_views REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest] + # 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_feature_views_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featureViews", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest] + # 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_feature_view_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{feature_view.name}", + body: "feature_view", + matches: [ + ["feature_view.name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest] + # 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_feature_view_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the sync_feature_view REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_sync_feature_view_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{feature_view}:sync", + body: "*", + matches: [ + ["feature_view", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature_view_sync REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest] + # 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_feature_view_sync_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/featureViewSyncs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_feature_view_syncs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest] + # 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_feature_view_syncs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featureViewSyncs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb new file mode 100644 index 000000000000..aa008c968b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/feature_online_store_service/credentials" +require "google/cloud/ai_platform/v1/feature_online_store_service/paths" +require "google/cloud/ai_platform/v1/feature_online_store_service/client" +require "google/cloud/ai_platform/v1/feature_online_store_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for fetching feature values from the online store. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/feature_online_store_service" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/feature_online_store_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.new + # + module FeatureOnlineStoreService + end + end + end + end +end + +helper_path = ::File.join __dir__, "feature_online_store_service", "helpers.rb" +require "google/cloud/ai_platform/v1/feature_online_store_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb new file mode 100644 index 000000000000..ada96c59674f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb @@ -0,0 +1,591 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_online_store_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + ## + # Client for the FeatureOnlineStoreService service. + # + # A service for fetching feature values from the online store. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_online_store_service_stub + + ## + # Configure the FeatureOnlineStoreService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureOnlineStoreService clients + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::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 FeatureOnlineStoreService 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::FeatureOnlineStoreService::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 + @feature_online_store_service_stub.universe_domain + end + + ## + # Create a new FeatureOnlineStoreService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureOnlineStoreService 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/feature_online_store_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 + + @feature_online_store_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::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 + ) + + @feature_online_store_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 = @feature_online_store_service_stub.endpoint + config.universe_domain = @feature_online_store_service_stub.universe_domain + config.logger = @feature_online_store_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 = @feature_online_store_service_stub.endpoint + config.universe_domain = @feature_online_store_service_stub.universe_domain + config.logger = @feature_online_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @feature_online_store_service_stub.logger + end + + # Service calls + + ## + # Fetch feature values under a FeatureView. + # + # @overload fetch_feature_values(request, options = nil) + # Pass arguments to `fetch_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest, ::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 fetch_feature_values(feature_view: nil, data_key: nil, data_format: nil) + # Pass arguments to `fetch_feature_values` 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 feature_view [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @param data_key [::Google::Cloud::AIPlatform::V1::FeatureViewDataKey, ::Hash] + # Optional. The request key to fetch feature values for. + # @param data_format [::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat] + # Optional. Response data format. If not set, + # {::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat::KEY_VALUE FeatureViewDataFormat.KEY_VALUE} + # will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # + # @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::FeatureOnlineStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest.new + # + # # Call the fetch_feature_values method. + # result = client.fetch_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse. + # p result + # + def fetch_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest + + # 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.fetch_feature_values.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.feature_view + header_params["feature_view"] = request.feature_view + 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.fetch_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_service_stub.call_rpc :fetch_feature_values, 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 + + ## + # Search the nearest entities under a FeatureView. + # Search only works for indexable feature view; if a feature view isn't + # indexable, returns Invalid argument response. + # + # @overload search_nearest_entities(request, options = nil) + # Pass arguments to `search_nearest_entities` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest, ::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 search_nearest_entities(feature_view: nil, query: nil, return_full_entity: nil) + # Pass arguments to `search_nearest_entities` 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 feature_view [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @param query [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery, ::Hash] + # Required. The query. + # @param return_full_entity [::Boolean] + # Optional. If set to true, the full entities (including all vector values + # and metadata) of the nearest neighbors are returned; otherwise only entity + # id of the nearest neighbors will be returned. Note that returning full + # entities will significantly increase the latency and cost of the query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse] + # + # @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::FeatureOnlineStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest.new + # + # # Call the search_nearest_entities method. + # result = client.search_nearest_entities request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse. + # p result + # + def search_nearest_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest + + # 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.search_nearest_entities.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.feature_view + header_params["feature_view"] = request.feature_view + 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.search_nearest_entities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_nearest_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_service_stub.call_rpc :search_nearest_entities, 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 FeatureOnlineStoreService API. + # + # This class represents the configuration for FeatureOnlineStoreService, + # 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::FeatureOnlineStoreService::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 + # # fetch_feature_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.fetch_feature_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.fetch_feature_values.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeatureOnlineStoreService 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 `fetch_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_feature_values + ## + # RPC-specific configuration for `search_nearest_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :search_nearest_entities + + # @private + def initialize parent_rpcs = nil + fetch_feature_values_config = parent_rpcs.fetch_feature_values if parent_rpcs.respond_to? :fetch_feature_values + @fetch_feature_values = ::Gapic::Config::Method.new fetch_feature_values_config + search_nearest_entities_config = parent_rpcs.search_nearest_entities if parent_rpcs.respond_to? :search_nearest_entities + @search_nearest_entities = ::Gapic::Config::Method.new search_nearest_entities_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/credentials.rb new file mode 100644 index 000000000000..5b1e6beefa72 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + # Credentials for the FeatureOnlineStoreService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/paths.rb new file mode 100644 index 000000000000..943667d30952 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/paths.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + # Path helper methods for the FeatureOnlineStoreService API. + module Paths + ## + # Create a fully-qualified FeatureView resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # + # @param project [String] + # @param location [String] + # @param feature_online_store [String] + # @param feature_view [String] + # + # @return [::String] + def feature_view_path project:, location:, feature_online_store:, feature_view: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "feature_online_store cannot contain /" if feature_online_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureOnlineStores/#{feature_online_store}/featureViews/#{feature_view}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest.rb new file mode 100644 index 000000000000..9bbc76f85d25 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/feature_online_store_service/credentials" +require "google/cloud/ai_platform/v1/feature_online_store_service/paths" +require "google/cloud/ai_platform/v1/feature_online_store_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for fetching feature values from the online store. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/feature_online_store_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.new + # + module FeatureOnlineStoreService + # 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/feature_online_store_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb new file mode 100644 index 000000000000..73eccb21d3a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb @@ -0,0 +1,560 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_online_store_service_pb" +require "google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + module Rest + ## + # REST client for the FeatureOnlineStoreService service. + # + # A service for fetching feature values from the online store. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_online_store_service_stub + + ## + # Configure the FeatureOnlineStoreService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureOnlineStoreService clients + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::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 FeatureOnlineStoreService 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::FeatureOnlineStoreService::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 + @feature_online_store_service_stub.universe_domain + end + + ## + # Create a new FeatureOnlineStoreService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureOnlineStoreService 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 + + @feature_online_store_service_stub = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @feature_online_store_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 = @feature_online_store_service_stub.endpoint + config.universe_domain = @feature_online_store_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_online_store_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 = @feature_online_store_service_stub.endpoint + config.universe_domain = @feature_online_store_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_online_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @feature_online_store_service_stub.logger + end + + # Service calls + + ## + # Fetch feature values under a FeatureView. + # + # @overload fetch_feature_values(request, options = nil) + # Pass arguments to `fetch_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest, ::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 fetch_feature_values(feature_view: nil, data_key: nil, data_format: nil) + # Pass arguments to `fetch_feature_values` 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 feature_view [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @param data_key [::Google::Cloud::AIPlatform::V1::FeatureViewDataKey, ::Hash] + # Optional. The request key to fetch feature values for. + # @param data_format [::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat] + # Optional. Response data format. If not set, + # {::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat::KEY_VALUE FeatureViewDataFormat.KEY_VALUE} + # will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # + # @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::FeatureOnlineStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest.new + # + # # Call the fetch_feature_values method. + # result = client.fetch_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse. + # p result + # + def fetch_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest + + # 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.fetch_feature_values.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.fetch_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_service_stub.fetch_feature_values 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 + + ## + # Search the nearest entities under a FeatureView. + # Search only works for indexable feature view; if a feature view isn't + # indexable, returns Invalid argument response. + # + # @overload search_nearest_entities(request, options = nil) + # Pass arguments to `search_nearest_entities` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest, ::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 search_nearest_entities(feature_view: nil, query: nil, return_full_entity: nil) + # Pass arguments to `search_nearest_entities` 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 feature_view [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @param query [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery, ::Hash] + # Required. The query. + # @param return_full_entity [::Boolean] + # Optional. If set to true, the full entities (including all vector values + # and metadata) of the nearest neighbors are returned; otherwise only entity + # id of the nearest neighbors will be returned. Note that returning full + # entities will significantly increase the latency and cost of the query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse] + # + # @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::FeatureOnlineStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest.new + # + # # Call the search_nearest_entities method. + # result = client.search_nearest_entities request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse. + # p result + # + def search_nearest_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest + + # 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.search_nearest_entities.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.search_nearest_entities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_nearest_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_online_store_service_stub.search_nearest_entities 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 FeatureOnlineStoreService REST API. + # + # This class represents the configuration for FeatureOnlineStoreService 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::FeatureOnlineStoreService::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 + # # fetch_feature_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.fetch_feature_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.fetch_feature_values.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeatureOnlineStoreService 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 `fetch_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_feature_values + ## + # RPC-specific configuration for `search_nearest_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :search_nearest_entities + + # @private + def initialize parent_rpcs = nil + fetch_feature_values_config = parent_rpcs.fetch_feature_values if parent_rpcs.respond_to? :fetch_feature_values + @fetch_feature_values = ::Gapic::Config::Method.new fetch_feature_values_config + search_nearest_entities_config = parent_rpcs.search_nearest_entities if parent_rpcs.respond_to? :search_nearest_entities + @search_nearest_entities = ::Gapic::Config::Method.new search_nearest_entities_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb new file mode 100644 index 000000000000..722e8d33373d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/feature_online_store_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + module Rest + ## + # REST service stub for the FeatureOnlineStoreService 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 fetch_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest] + # 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::FetchFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # A result object deserialized from the server's reply + def fetch_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_feature_values_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: "fetch_feature_values", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_nearest_entities REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest] + # 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::SearchNearestEntitiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse] + # A result object deserialized from the server's reply + def search_nearest_entities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_nearest_entities_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: "search_nearest_entities", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse.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 fetch_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{feature_view}:fetchFeatureValues", + body: "*", + matches: [ + ["feature_view", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_nearest_entities REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_nearest_entities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{feature_view}:searchNearestEntities", + body: "*", + matches: [ + ["feature_view", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service.rb new file mode 100644 index 000000000000..6253fcb67382 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/feature_registry_service/credentials" +require "google/cloud/ai_platform/v1/feature_registry_service/paths" +require "google/cloud/ai_platform/v1/feature_registry_service/operations" +require "google/cloud/ai_platform/v1/feature_registry_service/client" +require "google/cloud/ai_platform/v1/feature_registry_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for + # FeatureRegistry. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/feature_registry_service" + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/feature_registry_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.new + # + module FeatureRegistryService + end + end + end + end +end + +helper_path = ::File.join __dir__, "feature_registry_service", "helpers.rb" +require "google/cloud/ai_platform/v1/feature_registry_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb new file mode 100644 index 000000000000..e46d90494bc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb @@ -0,0 +1,1677 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_registry_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + ## + # Client for the FeatureRegistryService service. + # + # The service that handles CRUD and List for resources for + # FeatureRegistry. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_registry_service_stub + + ## + # Configure the FeatureRegistryService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureRegistryService clients + # ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::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 FeatureRegistryService 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::FeatureRegistryService::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 + @feature_registry_service_stub.universe_domain + end + + ## + # Create a new FeatureRegistryService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureRegistryService 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/feature_registry_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 + + @feature_registry_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::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 + ) + + @feature_registry_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 = @feature_registry_service_stub.endpoint + config.universe_domain = @feature_registry_service_stub.universe_domain + config.logger = @feature_registry_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 = @feature_registry_service_stub.endpoint + config.universe_domain = @feature_registry_service_stub.universe_domain + config.logger = @feature_registry_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureRegistryService::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 + @feature_registry_service_stub.logger + end + + # Service calls + + ## + # Creates a new FeatureGroup in a given project and location. + # + # @overload create_feature_group(request, options = nil) + # Pass arguments to `create_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest, ::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_feature_group(parent: nil, feature_group: nil, feature_group_id: nil) + # Pass arguments to `create_feature_group` 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 FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @param feature_group [::Google::Cloud::AIPlatform::V1::FeatureGroup, ::Hash] + # Required. The FeatureGroup to create. + # @param feature_group_id [::String] + # Required. The ID to use for this FeatureGroup, which will become the final + # component of the FeatureGroup's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest.new + # + # # Call the create_feature_group method. + # result = client.create_feature_group 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_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :create_feature_group, 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 a single FeatureGroup. + # + # @overload get_feature_group(request, options = nil) + # Pass arguments to `get_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest, ::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_feature_group(name: nil) + # Pass arguments to `get_feature_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureGroup resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest.new + # + # # Call the get_feature_group method. + # result = client.get_feature_group request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureGroup. + # p result + # + def get_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :get_feature_group, 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 FeatureGroups in a given project and location. + # + # @overload list_feature_groups(request, options = nil) + # Pass arguments to `list_feature_groups` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest, ::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_feature_groups(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_groups` 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 FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the FeatureGroups that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureGroups created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureGroups with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of FeatureGroups to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureGroups will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureGroup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureGroup>] + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest.new + # + # # Call the list_feature_groups method. + # result = client.list_feature_groups 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::FeatureGroup. + # p item + # end + # + def list_feature_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest + + # 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_feature_groups.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_feature_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_feature_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :list_feature_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feature_registry_service_stub, :list_feature_groups, 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 parameters of a single FeatureGroup. + # + # @overload update_feature_group(request, options = nil) + # Pass arguments to `update_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest, ::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_feature_group(feature_group: nil, update_mask: nil) + # Pass arguments to `update_feature_group` 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 feature_group [::Google::Cloud::AIPlatform::V1::FeatureGroup, ::Hash] + # Required. The FeatureGroup's `name` field is used to identify the + # FeatureGroup to be updated. Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureGroup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `big_query` + # * `big_query.entity_id_columns` + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest.new + # + # # Call the update_feature_group method. + # result = client.update_feature_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest + + # 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_feature_group.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.feature_group&.name + header_params["feature_group.name"] = request.feature_group.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_feature_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :update_feature_group, 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 single FeatureGroup. + # + # @overload delete_feature_group(request, options = nil) + # Pass arguments to `delete_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest, ::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_feature_group(name: nil, force: nil) + # Pass arguments to `delete_feature_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureGroup to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param force [::Boolean] + # If set to true, any Features under this FeatureGroup + # will also be deleted. (Otherwise, the request will only work if the + # FeatureGroup has no Features.) + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest.new + # + # # Call the delete_feature_group method. + # result = client.delete_feature_group 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_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :delete_feature_group, 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 + + ## + # Creates a new Feature in a given FeatureGroup. + # + # @overload create_feature(request, options = nil) + # Pass arguments to `create_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::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_feature(parent: nil, feature: nil, feature_id: nil) + # Pass arguments to `create_feature` 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 EntityType or FeatureGroup to create a + # Feature. Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature to create. + # @param feature_id [::String] + # Required. The ID to use for the Feature, which will become the final + # component of the Feature's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within an EntityType/FeatureGroup. + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new + # + # # Call the create_feature method. + # result = client.create_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :create_feature, 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 + + ## + # Creates a batch of Features in a given FeatureGroup. + # + # @overload batch_create_features(request, options = nil) + # Pass arguments to `batch_create_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::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 batch_create_features(parent: nil, requests: nil) + # Pass arguments to `batch_create_features` 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 EntityType/FeatureGroup to create the + # batch of Features under. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Hash>] + # Required. The request message specifying the Features to create. All + # Features must be created under the same parent EntityType / FeatureGroup. + # The `parent` field in each child request message can be omitted. If + # `parent` is set in a child request, then the value must match the `parent` + # value in this request message. + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new + # + # # Call the batch_create_features method. + # result = client.batch_create_features 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 batch_create_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest + + # 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.batch_create_features.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.batch_create_features.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :batch_create_features, 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 a single Feature. + # + # @overload get_feature(request, options = nil) + # Pass arguments to `get_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `get_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Feature resource. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new + # + # # Call the get_feature method. + # result = client.get_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def get_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :get_feature, 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 Features in a given FeatureGroup. + # + # @overload list_features(request, options = nil) + # Pass arguments to `list_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::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_features(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil, latest_stats_count: nil) + # Pass arguments to `list_features` 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 Features. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param filter [::String] + # Lists the Features that match the filter expression. The following + # filters are supported: + # + # * `value_type`: Supports = and != comparisons. + # * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 1000 Features will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # call or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `feature_id` + # * `value_type` (Not supported for FeatureRegistry Feature) + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param latest_stats_count [::Integer] + # Only applicable for Vertex AI Feature Store (Legacy). + # If set, return the most recent + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count} + # of stats for each Feature in response. Valid value is [0, 10]. If number of + # stats exists < + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count}, + # return all existing stats. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new + # + # # Call the list_features method. + # result = client.list_features 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::Feature. + # p item + # end + # + def list_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest + + # 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_features.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_features.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :list_features, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feature_registry_service_stub, :list_features, 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 parameters of a single Feature. + # + # @overload update_feature(request, options = nil) + # Pass arguments to `update_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::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_feature(feature: nil, update_mask: nil) + # Pass arguments to `update_feature` 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 feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature's `name` field is used to identify the Feature to be + # updated. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Features resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `disable_monitoring` (Not supported for FeatureRegistryService Feature) + # * `point_of_contact` (Not supported for FeaturestoreService FeatureStore) + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new + # + # # Call the update_feature method. + # result = client.update_feature request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest + + # 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_feature.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.feature&.name + header_params["feature.name"] = request.feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :update_feature, 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 single Feature. + # + # @overload delete_feature(request, options = nil) + # Pass arguments to `delete_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `delete_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Features to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # + # @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::FeatureRegistryService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new + # + # # Call the delete_feature method. + # result = client.delete_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.call_rpc :delete_feature, 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 FeatureRegistryService API. + # + # This class represents the configuration for FeatureRegistryService, + # 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::FeatureRegistryService::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_feature_group to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_group.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_group.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeatureRegistryService 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_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_group + ## + # RPC-specific configuration for `get_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_group + ## + # RPC-specific configuration for `list_feature_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_groups + ## + # RPC-specific configuration for `update_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_group + ## + # RPC-specific configuration for `delete_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_group + ## + # RPC-specific configuration for `create_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature + ## + # RPC-specific configuration for `batch_create_features` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_features + ## + # RPC-specific configuration for `get_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature + ## + # RPC-specific configuration for `list_features` + # @return [::Gapic::Config::Method] + # + attr_reader :list_features + ## + # RPC-specific configuration for `update_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature + ## + # RPC-specific configuration for `delete_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature + + # @private + def initialize parent_rpcs = nil + create_feature_group_config = parent_rpcs.create_feature_group if parent_rpcs.respond_to? :create_feature_group + @create_feature_group = ::Gapic::Config::Method.new create_feature_group_config + get_feature_group_config = parent_rpcs.get_feature_group if parent_rpcs.respond_to? :get_feature_group + @get_feature_group = ::Gapic::Config::Method.new get_feature_group_config + list_feature_groups_config = parent_rpcs.list_feature_groups if parent_rpcs.respond_to? :list_feature_groups + @list_feature_groups = ::Gapic::Config::Method.new list_feature_groups_config + update_feature_group_config = parent_rpcs.update_feature_group if parent_rpcs.respond_to? :update_feature_group + @update_feature_group = ::Gapic::Config::Method.new update_feature_group_config + delete_feature_group_config = parent_rpcs.delete_feature_group if parent_rpcs.respond_to? :delete_feature_group + @delete_feature_group = ::Gapic::Config::Method.new delete_feature_group_config + create_feature_config = parent_rpcs.create_feature if parent_rpcs.respond_to? :create_feature + @create_feature = ::Gapic::Config::Method.new create_feature_config + batch_create_features_config = parent_rpcs.batch_create_features if parent_rpcs.respond_to? :batch_create_features + @batch_create_features = ::Gapic::Config::Method.new batch_create_features_config + get_feature_config = parent_rpcs.get_feature if parent_rpcs.respond_to? :get_feature + @get_feature = ::Gapic::Config::Method.new get_feature_config + list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features + @list_features = ::Gapic::Config::Method.new list_features_config + update_feature_config = parent_rpcs.update_feature if parent_rpcs.respond_to? :update_feature + @update_feature = ::Gapic::Config::Method.new update_feature_config + delete_feature_config = parent_rpcs.delete_feature if parent_rpcs.respond_to? :delete_feature + @delete_feature = ::Gapic::Config::Method.new delete_feature_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/credentials.rb new file mode 100644 index 000000000000..cbb97b50b896 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + # Credentials for the FeatureRegistryService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb new file mode 100644 index 000000000000..7c4876ee5f5b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + # 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 FeatureRegistryService 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 FeatureRegistryService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/paths.rb new file mode 100644 index 000000000000..322969b71571 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/paths.rb @@ -0,0 +1,139 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + # Path helper methods for the FeatureRegistryService API. + module Paths + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, featurestore:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Feature resource string. + # + # @overload feature_path(project:, location:, featurestore:, entity_type:, feature:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # @param entity_type [String] + # @param feature [String] + # + # @overload feature_path(project:, location:, feature_group:, feature:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # + # @param project [String] + # @param location [String] + # @param feature_group [String] + # @param feature [String] + # + # @return [::String] + def feature_path **args + resources = { + "entity_type:feature:featurestore:location:project" => (proc do |project:, location:, featurestore:, entity_type:, feature:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/" + raise ::ArgumentError, "entity_type cannot contain /" if entity_type.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}/features/#{feature}" + end), + "feature:feature_group:location:project" => (proc do |project:, location:, feature_group:, feature:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "feature_group cannot contain /" if feature_group.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureGroups/#{feature_group}/features/#{feature}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified FeatureGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # + # @param project [String] + # @param location [String] + # @param feature_group [String] + # + # @return [::String] + def feature_group_path project:, location:, feature_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureGroups/#{feature_group}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest.rb new file mode 100644 index 000000000000..778dbf950925 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/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/feature_registry_service/credentials" +require "google/cloud/ai_platform/v1/feature_registry_service/paths" +require "google/cloud/ai_platform/v1/feature_registry_service/rest/operations" +require "google/cloud/ai_platform/v1/feature_registry_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for + # FeatureRegistry. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/feature_registry_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.new + # + module FeatureRegistryService + # 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/feature_registry_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb new file mode 100644 index 000000000000..e7e2599ceb67 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb @@ -0,0 +1,1583 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/feature_registry_service_pb" +require "google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + module Rest + ## + # REST client for the FeatureRegistryService service. + # + # The service that handles CRUD and List for resources for + # FeatureRegistry. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feature_registry_service_stub + + ## + # Configure the FeatureRegistryService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeatureRegistryService clients + # ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::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 FeatureRegistryService 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::FeatureRegistryService::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 + @feature_registry_service_stub.universe_domain + end + + ## + # Create a new FeatureRegistryService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeatureRegistryService 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::FeatureRegistryService::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 + + @feature_registry_service_stub = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @feature_registry_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 = @feature_registry_service_stub.endpoint + config.universe_domain = @feature_registry_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_registry_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 = @feature_registry_service_stub.endpoint + config.universe_domain = @feature_registry_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @feature_registry_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureRegistryService::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 + @feature_registry_service_stub.logger + end + + # Service calls + + ## + # Creates a new FeatureGroup in a given project and location. + # + # @overload create_feature_group(request, options = nil) + # Pass arguments to `create_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest, ::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_feature_group(parent: nil, feature_group: nil, feature_group_id: nil) + # Pass arguments to `create_feature_group` 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 FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @param feature_group [::Google::Cloud::AIPlatform::V1::FeatureGroup, ::Hash] + # Required. The FeatureGroup to create. + # @param feature_group_id [::String] + # Required. The ID to use for this FeatureGroup, which will become the final + # component of the FeatureGroup's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest.new + # + # # Call the create_feature_group method. + # result = client.create_feature_group 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_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.create_feature_group 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 a single FeatureGroup. + # + # @overload get_feature_group(request, options = nil) + # Pass arguments to `get_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest, ::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_feature_group(name: nil) + # Pass arguments to `get_feature_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureGroup resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest.new + # + # # Call the get_feature_group method. + # result = client.get_feature_group request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FeatureGroup. + # p result + # + def get_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.get_feature_group 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 FeatureGroups in a given project and location. + # + # @overload list_feature_groups(request, options = nil) + # Pass arguments to `list_feature_groups` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest, ::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_feature_groups(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_feature_groups` 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 FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the FeatureGroups that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureGroups created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureGroups with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of FeatureGroups to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureGroups will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureGroup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::FeatureGroup>] + # + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest.new + # + # # Call the list_feature_groups method. + # result = client.list_feature_groups 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::FeatureGroup. + # p item + # end + # + def list_feature_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest + + # 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_feature_groups.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_feature_groups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_feature_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.list_feature_groups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feature_registry_service_stub, :list_feature_groups, "feature_groups", 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 parameters of a single FeatureGroup. + # + # @overload update_feature_group(request, options = nil) + # Pass arguments to `update_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest, ::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_feature_group(feature_group: nil, update_mask: nil) + # Pass arguments to `update_feature_group` 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 feature_group [::Google::Cloud::AIPlatform::V1::FeatureGroup, ::Hash] + # Required. The FeatureGroup's `name` field is used to identify the + # FeatureGroup to be updated. Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # FeatureGroup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `big_query` + # * `big_query.entity_id_columns` + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest.new + # + # # Call the update_feature_group method. + # result = client.update_feature_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.update_feature_group 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 single FeatureGroup. + # + # @overload delete_feature_group(request, options = nil) + # Pass arguments to `delete_feature_group` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest, ::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_feature_group(name: nil, force: nil) + # Pass arguments to `delete_feature_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the FeatureGroup to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param force [::Boolean] + # If set to true, any Features under this FeatureGroup + # will also be deleted. (Otherwise, the request will only work if the + # FeatureGroup has no Features.) + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest.new + # + # # Call the delete_feature_group method. + # result = client.delete_feature_group 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_feature_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest + + # 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_feature_group.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_feature_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.delete_feature_group 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 + + ## + # Creates a new Feature in a given FeatureGroup. + # + # @overload create_feature(request, options = nil) + # Pass arguments to `create_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::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_feature(parent: nil, feature: nil, feature_id: nil) + # Pass arguments to `create_feature` 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 EntityType or FeatureGroup to create a + # Feature. Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature to create. + # @param feature_id [::String] + # Required. The ID to use for the Feature, which will become the final + # component of the Feature's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within an EntityType/FeatureGroup. + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new + # + # # Call the create_feature method. + # result = client.create_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.create_feature 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 + + ## + # Creates a batch of Features in a given FeatureGroup. + # + # @overload batch_create_features(request, options = nil) + # Pass arguments to `batch_create_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::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 batch_create_features(parent: nil, requests: nil) + # Pass arguments to `batch_create_features` 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 EntityType/FeatureGroup to create the + # batch of Features under. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Hash>] + # Required. The request message specifying the Features to create. All + # Features must be created under the same parent EntityType / FeatureGroup. + # The `parent` field in each child request message can be omitted. If + # `parent` is set in a child request, then the value must match the `parent` + # value in this request message. + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new + # + # # Call the batch_create_features method. + # result = client.batch_create_features 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 batch_create_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest + + # 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.batch_create_features.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.batch_create_features.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.batch_create_features 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 a single Feature. + # + # @overload get_feature(request, options = nil) + # Pass arguments to `get_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `get_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Feature resource. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new + # + # # Call the get_feature method. + # result = client.get_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def get_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.get_feature 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 Features in a given FeatureGroup. + # + # @overload list_features(request, options = nil) + # Pass arguments to `list_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::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_features(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil, latest_stats_count: nil) + # Pass arguments to `list_features` 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 Features. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param filter [::String] + # Lists the Features that match the filter expression. The following + # filters are supported: + # + # * `value_type`: Supports = and != comparisons. + # * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 1000 Features will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_features FeaturestoreService.ListFeatures} + # call or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_features FeatureRegistryService.ListFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_features FeaturestoreService.ListFeatures} + # or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_features FeatureRegistryService.ListFeatures} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `feature_id` + # * `value_type` (Not supported for FeatureRegistry Feature) + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param latest_stats_count [::Integer] + # Only applicable for Vertex AI Feature Store (Legacy). + # If set, return the most recent + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count} + # of stats for each Feature in response. Valid value is [0, 10]. If number of + # stats exists < + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count}, + # return all existing stats. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new + # + # # Call the list_features method. + # result = client.list_features 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::Feature. + # p item + # end + # + def list_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest + + # 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_features.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_features.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.list_features request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feature_registry_service_stub, :list_features, "features", 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 parameters of a single Feature. + # + # @overload update_feature(request, options = nil) + # Pass arguments to `update_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::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_feature(feature: nil, update_mask: nil) + # Pass arguments to `update_feature` 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 feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature's `name` field is used to identify the Feature to be + # updated. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Features resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `disable_monitoring` (Not supported for FeatureRegistryService Feature) + # * `point_of_contact` (Not supported for FeaturestoreService FeatureStore) + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new + # + # # Call the update_feature method. + # result = client.update_feature request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.update_feature 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 single Feature. + # + # @overload delete_feature(request, options = nil) + # Pass arguments to `delete_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `delete_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Features to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @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::FeatureRegistryService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new + # + # # Call the delete_feature method. + # result = client.delete_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feature_registry_service_stub.delete_feature 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 FeatureRegistryService REST API. + # + # This class represents the configuration for FeatureRegistryService 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::FeatureRegistryService::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_feature_group to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_group.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_feature_group.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeatureRegistryService 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_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature_group + ## + # RPC-specific configuration for `get_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature_group + ## + # RPC-specific configuration for `list_feature_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_feature_groups + ## + # RPC-specific configuration for `update_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature_group + ## + # RPC-specific configuration for `delete_feature_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_group + ## + # RPC-specific configuration for `create_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature + ## + # RPC-specific configuration for `batch_create_features` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_features + ## + # RPC-specific configuration for `get_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature + ## + # RPC-specific configuration for `list_features` + # @return [::Gapic::Config::Method] + # + attr_reader :list_features + ## + # RPC-specific configuration for `update_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature + ## + # RPC-specific configuration for `delete_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature + + # @private + def initialize parent_rpcs = nil + create_feature_group_config = parent_rpcs.create_feature_group if parent_rpcs.respond_to? :create_feature_group + @create_feature_group = ::Gapic::Config::Method.new create_feature_group_config + get_feature_group_config = parent_rpcs.get_feature_group if parent_rpcs.respond_to? :get_feature_group + @get_feature_group = ::Gapic::Config::Method.new get_feature_group_config + list_feature_groups_config = parent_rpcs.list_feature_groups if parent_rpcs.respond_to? :list_feature_groups + @list_feature_groups = ::Gapic::Config::Method.new list_feature_groups_config + update_feature_group_config = parent_rpcs.update_feature_group if parent_rpcs.respond_to? :update_feature_group + @update_feature_group = ::Gapic::Config::Method.new update_feature_group_config + delete_feature_group_config = parent_rpcs.delete_feature_group if parent_rpcs.respond_to? :delete_feature_group + @delete_feature_group = ::Gapic::Config::Method.new delete_feature_group_config + create_feature_config = parent_rpcs.create_feature if parent_rpcs.respond_to? :create_feature + @create_feature = ::Gapic::Config::Method.new create_feature_config + batch_create_features_config = parent_rpcs.batch_create_features if parent_rpcs.respond_to? :batch_create_features + @batch_create_features = ::Gapic::Config::Method.new batch_create_features_config + get_feature_config = parent_rpcs.get_feature if parent_rpcs.respond_to? :get_feature + @get_feature = ::Gapic::Config::Method.new get_feature_config + list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features + @list_features = ::Gapic::Config::Method.new list_features_config + update_feature_config = parent_rpcs.update_feature if parent_rpcs.respond_to? :update_feature + @update_feature = ::Gapic::Config::Method.new update_feature_config + delete_feature_config = parent_rpcs.delete_feature if parent_rpcs.respond_to? :delete_feature + @delete_feature = ::Gapic::Config::Method.new delete_feature_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb new file mode 100644 index 000000000000..c8ebc72f4226 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + 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 FeatureRegistryService 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 FeatureRegistryService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb new file mode 100644 index 000000000000..64357f79d1e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb @@ -0,0 +1,757 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/feature_registry_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + module Rest + ## + # REST service stub for the FeatureRegistryService 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_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest] + # 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_feature_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_feature_group_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_feature_group", + 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_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest] + # 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::FeatureGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # A result object deserialized from the server's reply + def get_feature_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_group_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_feature_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::FeatureGroup.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_feature_groups REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest] + # 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::ListFeatureGroupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeatureGroupsResponse] + # A result object deserialized from the server's reply + def list_feature_groups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_feature_groups_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_feature_groups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeatureGroupsResponse.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_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_feature_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_feature_group_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_feature_group", + 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_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest] + # 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_feature_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_group_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_feature_group", + 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 create_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest] + # 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_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_feature_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_feature", + 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 batch_create_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest] + # 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 batch_create_features request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_features_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: "batch_create_features", + 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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureRequest] + # 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::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # A result object deserialized from the server's reply + def get_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_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_feature", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Feature.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_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest] + # 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::ListFeaturesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeaturesResponse] + # A result object deserialized from the server's reply + def list_features request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_features_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_features", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeaturesResponse.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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_feature_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_feature", + 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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest] + # 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_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_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_feature", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest] + # 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_feature_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/featureGroups", + body: "feature_group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest] + # 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_feature_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_feature_groups REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest] + # 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_feature_groups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featureGroups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest] + # 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_feature_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{feature_group.name}", + body: "feature_group", + matches: [ + ["feature_group.name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature_group REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest] + # 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_feature_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/features", + body: "feature", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/features:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest] + # 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_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/features", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{feature.name}", + body: "feature", + matches: [ + ["feature.name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service.rb new file mode 100644 index 000000000000..e271f246e65d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/paths" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/client" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for serving online feature values. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/featurestore_online_serving_service" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.new + # + module FeaturestoreOnlineServingService + end + end + end + end +end + +helper_path = ::File.join __dir__, "featurestore_online_serving_service", "helpers.rb" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb new file mode 100644 index 000000000000..75efb90a7506 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb @@ -0,0 +1,707 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/featurestore_online_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + ## + # Client for the FeaturestoreOnlineServingService service. + # + # A service for serving online feature values. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featurestore_online_serving_service_stub + + ## + # Configure the FeaturestoreOnlineServingService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturestoreOnlineServingService clients + # ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::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 FeaturestoreOnlineServingService 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::FeaturestoreOnlineServingService::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 + @featurestore_online_serving_service_stub.universe_domain + end + + ## + # Create a new FeaturestoreOnlineServingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturestoreOnlineServingService 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/featurestore_online_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 + + @featurestore_online_serving_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::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 + ) + + @featurestore_online_serving_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 = @featurestore_online_serving_service_stub.endpoint + config.universe_domain = @featurestore_online_serving_service_stub.universe_domain + config.logger = @featurestore_online_serving_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 = @featurestore_online_serving_service_stub.endpoint + config.universe_domain = @featurestore_online_serving_service_stub.universe_domain + config.logger = @featurestore_online_serving_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @featurestore_online_serving_service_stub.logger + end + + # Service calls + + ## + # Reads Feature values of a specific entity of an EntityType. For reading + # feature values of multiple entities of an EntityType, please use + # StreamingReadFeatureValues. + # + # @overload read_feature_values(request, options = nil) + # Pass arguments to `read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest, ::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 read_feature_values(entity_type: nil, entity_id: nil, feature_selector: nil) + # Pass arguments to `read_feature_values` 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 entity_type [::String] + # Required. The resource name of the EntityType for the entity being read. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, for a machine learning model predicting user clicks on a + # website, an EntityType ID could be `user`. + # @param entity_id [::String] + # Required. ID for a specific entity. For example, + # for a machine learning model predicting user clicks on a website, an entity + # ID could be `user_123`. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selector choosing Features of the target EntityType. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse] + # + # @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::FeaturestoreOnlineServingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest.new + # + # # Call the read_feature_values method. + # result = client.read_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. + # p result + # + def read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest + + # 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.read_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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.read_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_online_serving_service_stub.call_rpc :read_feature_values, 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 + + ## + # Reads Feature values for multiple entities. Depending on their size, data + # for different entities may be broken + # up across multiple responses. + # + # @overload streaming_read_feature_values(request, options = nil) + # Pass arguments to `streaming_read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest, ::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 streaming_read_feature_values(entity_type: nil, entity_ids: nil, feature_selector: nil) + # Pass arguments to `streaming_read_feature_values` 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 entity_type [::String] + # Required. The resource name of the entities' type. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @param entity_ids [::Array<::String>] + # Required. IDs of entities to read Feature values of. The maximum number of + # IDs is 100. For example, for a machine learning model predicting user + # clicks on a website, an entity ID could be `user_123`. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selector choosing Features of the target EntityType. Feature IDs + # will be deduplicated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse>] + # + # @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::FeaturestoreOnlineServingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest.new + # + # # Call the streaming_read_feature_values method to start streaming. + # output = client.streaming_read_feature_values request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest + + # 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.streaming_read_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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.streaming_read_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_online_serving_service_stub.call_rpc :streaming_read_feature_values, 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 + + ## + # Writes Feature values of one or more entities of an EntityType. + # + # The Feature values are merged into existing entities if any. The Feature + # values to be written must have timestamp within the online storage + # retention. + # + # @overload write_feature_values(request, options = nil) + # Pass arguments to `write_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest, ::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 write_feature_values(entity_type: nil, payloads: nil) + # Pass arguments to `write_feature_values` 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 entity_type [::String] + # Required. The resource name of the EntityType for the entities being + # written. Value format: + # `projects/{project}/locations/{location}/featurestores/ + # \\{featurestore}/entityTypes/\\{entityType}`. For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @param payloads [::Array<::Google::Cloud::AIPlatform::V1::WriteFeatureValuesPayload, ::Hash>] + # Required. The entities to be written. Up to 100,000 feature values can be + # written across all `payloads`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse] + # + # @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::FeaturestoreOnlineServingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest.new + # + # # Call the write_feature_values method. + # result = client.write_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse. + # p result + # + def write_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest + + # 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.write_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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.write_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_online_serving_service_stub.call_rpc :write_feature_values, 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 FeaturestoreOnlineServingService API. + # + # This class represents the configuration for FeaturestoreOnlineServingService, + # 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::FeaturestoreOnlineServingService::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 + # # read_feature_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.read_feature_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.read_feature_values.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeaturestoreOnlineServingService 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 `read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :read_feature_values + ## + # RPC-specific configuration for `streaming_read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_read_feature_values + ## + # RPC-specific configuration for `write_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :write_feature_values + + # @private + def initialize parent_rpcs = nil + read_feature_values_config = parent_rpcs.read_feature_values if parent_rpcs.respond_to? :read_feature_values + @read_feature_values = ::Gapic::Config::Method.new read_feature_values_config + streaming_read_feature_values_config = parent_rpcs.streaming_read_feature_values if parent_rpcs.respond_to? :streaming_read_feature_values + @streaming_read_feature_values = ::Gapic::Config::Method.new streaming_read_feature_values_config + write_feature_values_config = parent_rpcs.write_feature_values if parent_rpcs.respond_to? :write_feature_values + @write_feature_values = ::Gapic::Config::Method.new write_feature_values_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials.rb new file mode 100644 index 000000000000..9c942307ef7e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + # Credentials for the FeaturestoreOnlineServingService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/paths.rb new file mode 100644 index 000000000000..7e33cd8f997d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/paths.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + # Path helper methods for the FeaturestoreOnlineServingService API. + module Paths + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, featurestore:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest.rb new file mode 100644 index 000000000000..b425550458a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/credentials" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/paths" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for serving online feature values. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.new + # + module FeaturestoreOnlineServingService + # 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/featurestore_online_serving_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb new file mode 100644 index 000000000000..ece984bf128f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb @@ -0,0 +1,671 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/featurestore_online_service_pb" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + module Rest + ## + # REST client for the FeaturestoreOnlineServingService service. + # + # A service for serving online feature values. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featurestore_online_serving_service_stub + + ## + # Configure the FeaturestoreOnlineServingService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturestoreOnlineServingService clients + # ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::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 FeaturestoreOnlineServingService 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::FeaturestoreOnlineServingService::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 + @featurestore_online_serving_service_stub.universe_domain + end + + ## + # Create a new FeaturestoreOnlineServingService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturestoreOnlineServingService 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 + + @featurestore_online_serving_service_stub = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @featurestore_online_serving_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 = @featurestore_online_serving_service_stub.endpoint + config.universe_domain = @featurestore_online_serving_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @featurestore_online_serving_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 = @featurestore_online_serving_service_stub.endpoint + config.universe_domain = @featurestore_online_serving_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @featurestore_online_serving_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @featurestore_online_serving_service_stub.logger + end + + # Service calls + + ## + # Reads Feature values of a specific entity of an EntityType. For reading + # feature values of multiple entities of an EntityType, please use + # StreamingReadFeatureValues. + # + # @overload read_feature_values(request, options = nil) + # Pass arguments to `read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest, ::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 read_feature_values(entity_type: nil, entity_id: nil, feature_selector: nil) + # Pass arguments to `read_feature_values` 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 entity_type [::String] + # Required. The resource name of the EntityType for the entity being read. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, for a machine learning model predicting user clicks on a + # website, an EntityType ID could be `user`. + # @param entity_id [::String] + # Required. ID for a specific entity. For example, + # for a machine learning model predicting user clicks on a website, an entity + # ID could be `user_123`. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selector choosing Features of the target EntityType. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse] + # + # @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::FeaturestoreOnlineServingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest.new + # + # # Call the read_feature_values method. + # result = client.read_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. + # p result + # + def read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest + + # 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.read_feature_values.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.read_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_online_serving_service_stub.read_feature_values 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 + + ## + # Reads Feature values for multiple entities. Depending on their size, data + # for different entities may be broken + # up across multiple responses. + # + # @overload streaming_read_feature_values(request, options = nil) + # Pass arguments to `streaming_read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest, ::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 streaming_read_feature_values(entity_type: nil, entity_ids: nil, feature_selector: nil) + # Pass arguments to `streaming_read_feature_values` 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 entity_type [::String] + # Required. The resource name of the entities' type. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @param entity_ids [::Array<::String>] + # Required. IDs of entities to read Feature values of. The maximum number of + # IDs is 100. For example, for a machine learning model predicting user + # clicks on a website, an entity ID could be `user_123`. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selector choosing Features of the target EntityType. Feature IDs + # will be deduplicated. + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse>] + # + # @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::FeaturestoreOnlineServingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest.new + # + # # Call the streaming_read_feature_values method to start streaming. + # output = client.streaming_read_feature_values request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest + + # 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.streaming_read_feature_values.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.streaming_read_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.streaming_read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @featurestore_online_serving_service_stub.streaming_read_feature_values request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Writes Feature values of one or more entities of an EntityType. + # + # The Feature values are merged into existing entities if any. The Feature + # values to be written must have timestamp within the online storage + # retention. + # + # @overload write_feature_values(request, options = nil) + # Pass arguments to `write_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest, ::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 write_feature_values(entity_type: nil, payloads: nil) + # Pass arguments to `write_feature_values` 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 entity_type [::String] + # Required. The resource name of the EntityType for the entities being + # written. Value format: + # `projects/{project}/locations/{location}/featurestores/ + # \\{featurestore}/entityTypes/\\{entityType}`. For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @param payloads [::Array<::Google::Cloud::AIPlatform::V1::WriteFeatureValuesPayload, ::Hash>] + # Required. The entities to be written. Up to 100,000 feature values can be + # written across all `payloads`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse] + # + # @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::FeaturestoreOnlineServingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest.new + # + # # Call the write_feature_values method. + # result = client.write_feature_values request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse. + # p result + # + def write_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest + + # 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.write_feature_values.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.write_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.write_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_online_serving_service_stub.write_feature_values 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 FeaturestoreOnlineServingService REST API. + # + # This class represents the configuration for FeaturestoreOnlineServingService 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::FeaturestoreOnlineServingService::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 + # # read_feature_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.read_feature_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.read_feature_values.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeaturestoreOnlineServingService 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 `read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :read_feature_values + ## + # RPC-specific configuration for `streaming_read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_read_feature_values + ## + # RPC-specific configuration for `write_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :write_feature_values + + # @private + def initialize parent_rpcs = nil + read_feature_values_config = parent_rpcs.read_feature_values if parent_rpcs.respond_to? :read_feature_values + @read_feature_values = ::Gapic::Config::Method.new read_feature_values_config + streaming_read_feature_values_config = parent_rpcs.streaming_read_feature_values if parent_rpcs.respond_to? :streaming_read_feature_values + @streaming_read_feature_values = ::Gapic::Config::Method.new streaming_read_feature_values_config + write_feature_values_config = parent_rpcs.write_feature_values if parent_rpcs.respond_to? :write_feature_values + @write_feature_values = ::Gapic::Config::Method.new write_feature_values_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb new file mode 100644 index 000000000000..d96690f41f02 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb @@ -0,0 +1,261 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/featurestore_online_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + module Rest + ## + # REST service stub for the FeaturestoreOnlineServingService 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 read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest] + # 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::ReadFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse] + # A result object deserialized from the server's reply + def read_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_feature_values_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: "read_feature_values", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the streaming_read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def streaming_read_feature_values request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_streaming_read_feature_values_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: "streaming_read_feature_values", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the write_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest] + # 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::WriteFeatureValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse] + # A result object deserialized from the server's reply + def write_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_write_feature_values_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: "write_feature_values", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse.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 read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:readFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the streaming_read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_streaming_read_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:streamingReadFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the write_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_write_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:writeFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service.rb new file mode 100644 index 000000000000..00a2cb4a8256 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/featurestore_service/credentials" +require "google/cloud/ai_platform/v1/featurestore_service/paths" +require "google/cloud/ai_platform/v1/featurestore_service/operations" +require "google/cloud/ai_platform/v1/featurestore_service/client" +require "google/cloud/ai_platform/v1/featurestore_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for Featurestore. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/featurestore_service" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/featurestore_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.new + # + module FeaturestoreService + end + end + end + end +end + +helper_path = ::File.join __dir__, "featurestore_service", "helpers.rb" +require "google/cloud/ai_platform/v1/featurestore_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb new file mode 100644 index 000000000000..ce7200414692 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb @@ -0,0 +1,2954 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/featurestore_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + ## + # Client for the FeaturestoreService service. + # + # The service that handles CRUD and List for resources for Featurestore. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featurestore_service_stub + + ## + # Configure the FeaturestoreService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturestoreService clients + # ::Google::Cloud::AIPlatform::V1::FeaturestoreService::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 FeaturestoreService 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::FeaturestoreService::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 + @featurestore_service_stub.universe_domain + end + + ## + # Create a new FeaturestoreService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturestoreService 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/featurestore_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 + + @featurestore_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::FeaturestoreService::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 + ) + + @featurestore_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 = @featurestore_service_stub.endpoint + config.universe_domain = @featurestore_service_stub.universe_domain + config.logger = @featurestore_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 = @featurestore_service_stub.endpoint + config.universe_domain = @featurestore_service_stub.universe_domain + config.logger = @featurestore_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreService::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 + @featurestore_service_stub.logger + end + + # Service calls + + ## + # Creates a new Featurestore in a given project and location. + # + # @overload create_featurestore(request, options = nil) + # Pass arguments to `create_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest, ::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_featurestore(parent: nil, featurestore: nil, featurestore_id: nil) + # Pass arguments to `create_featurestore` 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 Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @param featurestore [::Google::Cloud::AIPlatform::V1::Featurestore, ::Hash] + # Required. The Featurestore to create. + # @param featurestore_id [::String] + # Required. The ID to use for this Featurestore, which will become the final + # component of the Featurestore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest.new + # + # # Call the create_featurestore method. + # result = client.create_featurestore 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_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :create_featurestore, 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 a single Featurestore. + # + # @overload get_featurestore(request, options = nil) + # Pass arguments to `get_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest, ::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_featurestore(name: nil) + # Pass arguments to `get_featurestore` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Featurestore resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Featurestore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Featurestore] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest.new + # + # # Call the get_featurestore method. + # result = client.get_featurestore request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Featurestore. + # p result + # + def get_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :get_featurestore, 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 Featurestores in a given project and location. + # + # @overload list_featurestores(request, options = nil) + # Pass arguments to `list_featurestores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest, ::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_featurestores(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_featurestores` 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 Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the featurestores that match the filter expression. The following + # fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + # `<=`, and `>=` comparisons. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # Featurestores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # Featurestores with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of Featurestores to return. The service may return fewer + # than this value. If unspecified, at most 100 Featurestores will be + # returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # * `online_serving_config.fixed_node_count` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Featurestore>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Featurestore>] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest.new + # + # # Call the list_featurestores method. + # result = client.list_featurestores 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::Featurestore. + # p item + # end + # + def list_featurestores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest + + # 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_featurestores.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_featurestores.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_featurestores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :list_featurestores, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @featurestore_service_stub, :list_featurestores, 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 parameters of a single Featurestore. + # + # @overload update_featurestore(request, options = nil) + # Pass arguments to `update_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest, ::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_featurestore(featurestore: nil, update_mask: nil) + # Pass arguments to `update_featurestore` 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 featurestore [::Google::Cloud::AIPlatform::V1::Featurestore, ::Hash] + # Required. The Featurestore's `name` field is used to identify the + # Featurestore to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Featurestore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `online_serving_config.fixed_node_count` + # * `online_serving_config.scaling` + # * `online_storage_ttl_days` + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest.new + # + # # Call the update_featurestore method. + # result = client.update_featurestore request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest + + # 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_featurestore.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.featurestore&.name + header_params["featurestore.name"] = request.featurestore.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_featurestore.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :update_featurestore, 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 single Featurestore. The Featurestore must not contain any + # EntityTypes or `force` must be set to true for the request to succeed. + # + # @overload delete_featurestore(request, options = nil) + # Pass arguments to `delete_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest, ::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_featurestore(name: nil, force: nil) + # Pass arguments to `delete_featurestore` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Featurestore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param force [::Boolean] + # If set to true, any EntityTypes and Features for this Featurestore will + # also be deleted. (Otherwise, the request will only work if the Featurestore + # has no EntityTypes.) + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest.new + # + # # Call the delete_featurestore method. + # result = client.delete_featurestore 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_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :delete_featurestore, 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 + + ## + # Creates a new EntityType in a given Featurestore. + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest, ::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_entity_type(parent: nil, entity_type: nil, entity_type_id: nil) + # Pass arguments to `create_entity_type` 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 Featurestore to create EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param entity_type [::Google::Cloud::AIPlatform::V1::EntityType, ::Hash] + # The EntityType to create. + # @param entity_type_id [::String] + # Required. The ID to use for the EntityType, which will become the final + # component of the EntityType's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a featurestore. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type 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_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :create_entity_type, 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 a single EntityType. + # + # @overload get_entity_type(request, options = nil) + # Pass arguments to `get_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest, ::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_entity_type(name: nil) + # Pass arguments to `get_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the EntityType resource. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + # p result + # + def get_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :get_entity_type, 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 EntityTypes in a given Featurestore. + # + # @overload list_entity_types(request, options = nil) + # Pass arguments to `list_entity_types` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest, ::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_entity_types(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_entity_types` 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 Featurestore to list EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param filter [::String] + # Lists the EntityTypes that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any EntityType which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of EntityTypes to return. The service may return fewer + # than this value. If unspecified, at most 1000 EntityTypes will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `entity_type_id` + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::EntityType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::EntityType>] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types 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::EntityType. + # p item + # end + # + def list_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest + + # 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_entity_types.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_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :list_entity_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @featurestore_service_stub, :list_entity_types, 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 parameters of a single EntityType. + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest, ::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_entity_type(entity_type: nil, update_mask: nil) + # Pass arguments to `update_entity_type` 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 entity_type [::Google::Cloud::AIPlatform::V1::EntityType, ::Hash] + # Required. The EntityType's `name` field is used to identify the EntityType + # to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # EntityType resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `monitoring_config.snapshot_analysis.disabled` + # * `monitoring_config.snapshot_analysis.monitoring_interval_days` + # * `monitoring_config.snapshot_analysis.staleness_days` + # * `monitoring_config.import_features_analysis.state` + # * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + # * `monitoring_config.numerical_threshold_config.value` + # * `monitoring_config.categorical_threshold_config.value` + # * `offline_storage_ttl_days` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + # p result + # + def update_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest + + # 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_entity_type.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.entity_type&.name + header_params["entity_type.name"] = request.entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :update_entity_type, 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 a single EntityType. The EntityType must not have any Features + # or `force` must be set to true for the request to succeed. + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest, ::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_entity_type(name: nil, force: nil) + # Pass arguments to `delete_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the EntityType to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param force [::Boolean] + # If set to true, any Features for this EntityType will also be deleted. + # (Otherwise, the request will only work if the EntityType has no Features.) + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type 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_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :delete_entity_type, 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 + + ## + # Creates a new Feature in a given EntityType. + # + # @overload create_feature(request, options = nil) + # Pass arguments to `create_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::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_feature(parent: nil, feature: nil, feature_id: nil) + # Pass arguments to `create_feature` 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 EntityType or FeatureGroup to create a + # Feature. Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature to create. + # @param feature_id [::String] + # Required. The ID to use for the Feature, which will become the final + # component of the Feature's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within an EntityType/FeatureGroup. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new + # + # # Call the create_feature method. + # result = client.create_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :create_feature, 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 + + ## + # Creates a batch of Features in a given EntityType. + # + # @overload batch_create_features(request, options = nil) + # Pass arguments to `batch_create_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::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 batch_create_features(parent: nil, requests: nil) + # Pass arguments to `batch_create_features` 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 EntityType/FeatureGroup to create the + # batch of Features under. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Hash>] + # Required. The request message specifying the Features to create. All + # Features must be created under the same parent EntityType / FeatureGroup. + # The `parent` field in each child request message can be omitted. If + # `parent` is set in a child request, then the value must match the `parent` + # value in this request message. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new + # + # # Call the batch_create_features method. + # result = client.batch_create_features 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 batch_create_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest + + # 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.batch_create_features.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.batch_create_features.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :batch_create_features, 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 a single Feature. + # + # @overload get_feature(request, options = nil) + # Pass arguments to `get_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `get_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Feature resource. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new + # + # # Call the get_feature method. + # result = client.get_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def get_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :get_feature, 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 Features in a given EntityType. + # + # @overload list_features(request, options = nil) + # Pass arguments to `list_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::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_features(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil, latest_stats_count: nil) + # Pass arguments to `list_features` 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 Features. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param filter [::String] + # Lists the Features that match the filter expression. The following + # filters are supported: + # + # * `value_type`: Supports = and != comparisons. + # * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 1000 Features will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # call or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `feature_id` + # * `value_type` (Not supported for FeatureRegistry Feature) + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param latest_stats_count [::Integer] + # Only applicable for Vertex AI Feature Store (Legacy). + # If set, return the most recent + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count} + # of stats for each Feature in response. Valid value is [0, 10]. If number of + # stats exists < + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count}, + # return all existing stats. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new + # + # # Call the list_features method. + # result = client.list_features 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::Feature. + # p item + # end + # + def list_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest + + # 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_features.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_features.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :list_features, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @featurestore_service_stub, :list_features, 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 parameters of a single Feature. + # + # @overload update_feature(request, options = nil) + # Pass arguments to `update_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::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_feature(feature: nil, update_mask: nil) + # Pass arguments to `update_feature` 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 feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature's `name` field is used to identify the Feature to be + # updated. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Features resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `disable_monitoring` (Not supported for FeatureRegistryService Feature) + # * `point_of_contact` (Not supported for FeaturestoreService FeatureStore) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new + # + # # Call the update_feature method. + # result = client.update_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def update_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest + + # 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_feature.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.feature&.name + header_params["feature.name"] = request.feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :update_feature, 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 a single Feature. + # + # @overload delete_feature(request, options = nil) + # Pass arguments to `delete_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `delete_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Features to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new + # + # # Call the delete_feature method. + # result = client.delete_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :delete_feature, 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 + + ## + # Imports Feature values into the Featurestore from a source storage. + # + # The progress of the import is tracked by the returned operation. The + # imported features are guaranteed to be visible to subsequent read + # operations after the operation is marked as successfully done. + # + # If an import operation fails, the Feature values returned from + # reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same import request again and wait till + # the new operation returned is marked as successfully done. + # + # There are also scenarios where the caller can cause inconsistency. + # + # - Source data for import contains multiple distinct Feature values for + # the same entity ID and timestamp. + # - Source is modified during an import. This includes adding, updating, or + # removing source data and/or metadata. Examples of updating metadata + # include but are not limited to changing storage location, storage class, + # or retention policy. + # - Online serving cluster is under-provisioned. + # + # @overload import_feature_values(request, options = nil) + # Pass arguments to `import_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest, ::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 import_feature_values(avro_source: nil, bigquery_source: nil, csv_source: nil, feature_time_field: nil, feature_time: nil, entity_type: nil, entity_id_field: nil, feature_specs: nil, disable_online_serving: nil, worker_count: nil, disable_ingestion_analysis: nil) + # Pass arguments to `import_feature_values` 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 avro_source [::Google::Cloud::AIPlatform::V1::AvroSource, ::Hash] + # @param bigquery_source [::Google::Cloud::AIPlatform::V1::BigQuerySource, ::Hash] + # @param csv_source [::Google::Cloud::AIPlatform::V1::CsvSource, ::Hash] + # @param feature_time_field [::String] + # Source column that holds the Feature timestamp for all Feature + # values in each entity. + # @param feature_time [::Google::Protobuf::Timestamp, ::Hash] + # Single Feature timestamp for all entities being imported. The + # timestamp must not have higher than millisecond precision. + # @param entity_type [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being imported. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + # @param entity_id_field [::String] + # Source column that holds entity IDs. If not provided, entity IDs are + # extracted from the column named entity_id. + # @param feature_specs [::Array<::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest::FeatureSpec, ::Hash>] + # Required. Specifications defining which Feature values to import from the + # entity. The request fails if no feature_specs are provided, and having + # multiple feature_specs for one Feature is not allowed. + # @param disable_online_serving [::Boolean] + # If set, data will not be imported for online serving. This + # is typically used for backfilling, where Feature generation timestamps are + # not in the timestamp range needed for online serving. + # @param worker_count [::Integer] + # Specifies the number of workers that are used to write data to the + # Featurestore. Consider the online serving capacity that you require to + # achieve the desired import throughput without interfering with online + # serving. The value must be positive, and less than or equal to 100. + # If not set, defaults to using 1 worker. The low count ensures minimal + # impact on online serving performance. + # @param disable_ingestion_analysis [::Boolean] + # If true, API doesn't start ingestion analysis pipeline. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest.new + # + # # Call the import_feature_values method. + # result = client.import_feature_values 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 import_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest + + # 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.import_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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.import_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :import_feature_values, 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 + + ## + # Batch reads Feature values from a Featurestore. + # + # This API enables batch reading Feature values, where each read + # instance in the batch may read Feature values of entities from one or + # more EntityTypes. Point-in-time correctness is guaranteed for Feature + # values of each read instance as of each instance's read timestamp. + # + # @overload batch_read_feature_values(request, options = nil) + # Pass arguments to `batch_read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest, ::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 batch_read_feature_values(csv_read_instances: nil, bigquery_read_instances: nil, featurestore: nil, destination: nil, pass_through_fields: nil, entity_type_specs: nil, start_time: nil) + # Pass arguments to `batch_read_feature_values` 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 csv_read_instances [::Google::Cloud::AIPlatform::V1::CsvSource, ::Hash] + # Each read instance consists of exactly one read timestamp and one or more + # entity IDs identifying entities of the corresponding EntityTypes whose + # Features are requested. + # + # Each output instance contains Feature values of requested entities + # concatenated together as of the read time. + # + # An example read instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z`. + # + # An example output instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + # bar_entity_feature2_value`. + # + # Timestamp in each read instance must be millisecond-aligned. + # + # `csv_read_instances` are read instances stored in a plain-text CSV file. + # The header should be: + # [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + # + # The columns can be in any order. + # + # Values in the timestamp column must use the RFC 3339 format, e.g. + # `2012-07-30T10:43:17.123Z`. + # @param bigquery_read_instances [::Google::Cloud::AIPlatform::V1::BigQuerySource, ::Hash] + # Similar to csv_read_instances, but from BigQuery source. + # @param featurestore [::String] + # Required. The resource name of the Featurestore from which to query Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param destination [::Google::Cloud::AIPlatform::V1::FeatureValueDestination, ::Hash] + # Required. Specifies output location and format. + # @param pass_through_fields [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::PassThroughField, ::Hash>] + # When not empty, the specified fields in the *_read_instances source will be + # joined as-is in the output, in addition to those fields from the + # Featurestore Entity. + # + # For BigQuery source, the type of the pass-through values will be + # automatically inferred. For CSV source, the pass-through values will be + # passed as opaque bytes. + # @param entity_type_specs [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::EntityTypeSpec, ::Hash>] + # Required. Specifies EntityType grouping Features to read values of and + # settings. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Excludes Feature values with feature generation timestamp before + # this timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new + # + # # Call the batch_read_feature_values method. + # result = client.batch_read_feature_values 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 batch_read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest + + # 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.batch_read_feature_values.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.featurestore + header_params["featurestore"] = request.featurestore + 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.batch_read_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :batch_read_feature_values, 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 + + ## + # Exports Feature values from all the entities of a target EntityType. + # + # @overload export_feature_values(request, options = nil) + # Pass arguments to `export_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest, ::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 export_feature_values(snapshot_export: nil, full_export: nil, entity_type: nil, destination: nil, feature_selector: nil, settings: nil) + # Pass arguments to `export_feature_values` 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 snapshot_export [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::SnapshotExport, ::Hash] + # Exports the latest Feature values of all entities of the EntityType + # within a time range. + # @param full_export [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::FullExport, ::Hash] + # Exports all historical values of all entities of the EntityType within a + # time range + # @param entity_type [::String] + # Required. The resource name of the EntityType from which to export Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param destination [::Google::Cloud::AIPlatform::V1::FeatureValueDestination, ::Hash] + # Required. Specifies destination location and format. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selects Features to export values of. + # @param settings [::Array<::Google::Cloud::AIPlatform::V1::DestinationFeatureSetting, ::Hash>] + # Per-Feature export settings. + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest.new + # + # # Call the export_feature_values method. + # result = client.export_feature_values 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 export_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest + + # 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.export_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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.export_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :export_feature_values, 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 + + ## + # Delete Feature values from Featurestore. + # + # The progress of the deletion is tracked by the returned operation. The + # deleted feature values are guaranteed to be invisible to subsequent read + # operations after the operation is marked as successfully done. + # + # If a delete feature values operation fails, the feature values + # returned from reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same delete request again and wait till + # the new operation returned is marked as successfully done. + # + # @overload delete_feature_values(request, options = nil) + # Pass arguments to `delete_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest, ::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_feature_values(select_entity: nil, select_time_range_and_feature: nil, entity_type: nil) + # Pass arguments to `delete_feature_values` 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 select_entity [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectEntity, ::Hash] + # Select feature values to be deleted by specifying entities. + # @param select_time_range_and_feature [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectTimeRangeAndFeature, ::Hash] + # Select feature values to be deleted by specifying time range and + # features. + # @param entity_type [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being deleted from. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest.new + # + # # Call the delete_feature_values method. + # result = client.delete_feature_values 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_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest + + # 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_feature_values.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.entity_type + header_params["entity_type"] = request.entity_type + 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_feature_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :delete_feature_values, 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 + + ## + # Searches Features matching a query in a given project. + # + # @overload search_features(request, options = nil) + # Pass arguments to `search_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest, ::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 search_features(location: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_features` 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 location [::String] + # Required. The resource name of the Location to search Features. + # Format: + # `projects/{project}/locations/{location}` + # @param query [::String] + # Query string that is a conjunction of field-restricted queries and/or + # field-restricted filters. Field-restricted queries and filters can be + # combined using `AND` to form a conjunction. + # + # A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + # exists as a substring within Feature's FIELD. The QUERY + # and the FIELD are converted to a sequence of words (i.e. tokens) for + # comparison. This is done by: + # + # * Removing leading/trailing whitespace and tokenizing the search value. + # Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + # `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + # as a wildcard that matches characters within a token. + # * Ignoring case. + # * Prepending an asterisk to the first and appending an asterisk to the + # last token in QUERY. + # + # A QUERY must be either a singular token or a phrase. A phrase is one or + # multiple words enclosed in double quotation marks ("). With phrases, the + # order of the words is important. Words in the phrase must be matching in + # order and consecutively. + # + # Supported FIELDs for field-restricted queries: + # + # * `feature_id` + # * `description` + # * `entity_type_id` + # + # Examples: + # + # * `feature_id: foo` --> Matches a Feature with ID containing the substring + # `foo` (eg. `foo`, `foofeature`, `barfoo`). + # * `feature_id: foo*feature` --> Matches a Feature with ID containing the + # substring `foo*feature` (eg. `foobarfeature`). + # * `feature_id: foo AND description: bar` --> Matches a Feature with ID + # containing the substring `foo` and description containing the substring + # `bar`. + # + # + # Besides field queries, the following exact-match filters are + # supported. The exact-match filters do not support wildcards. Unlike + # field-restricted queries, exact-match filters are case-sensitive. + # + # * `feature_id`: Supports = comparisons. + # * `description`: Supports = comparisons. Multi-token filters should be + # enclosed in quotes. + # * `entity_type_id`: Supports = comparisons. + # * `value_type`: Supports = and != comparisons. + # * `labels`: Supports key-value equality as well as key presence. + # * `featurestore_id`: Supports = comparisons. + # + # Examples: + # + # * `description = "foo bar"` --> Any Feature with description exactly equal + # to `foo bar` + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with `env` as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 100 Features will be returned. + # The maximum value is 100; any value greater than 100 will be coerced to + # 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures}, + # except `page_size`, must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeaturestoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchFeaturesRequest.new + # + # # Call the search_features method. + # result = client.search_features 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::Feature. + # p item + # end + # + def search_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest + + # 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.search_features.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.location + header_params["location"] = request.location + 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.search_features.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.call_rpc :search_features, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @featurestore_service_stub, :search_features, 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 + + ## + # Configuration class for the FeaturestoreService API. + # + # This class represents the configuration for FeaturestoreService, + # 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::FeaturestoreService::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_featurestore to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_featurestore.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_featurestore.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeaturestoreService 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_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :create_featurestore + ## + # RPC-specific configuration for `get_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :get_featurestore + ## + # RPC-specific configuration for `list_featurestores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_featurestores + ## + # RPC-specific configuration for `update_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :update_featurestore + ## + # RPC-specific configuration for `delete_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_featurestore + ## + # RPC-specific configuration for `create_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entity_type + ## + # RPC-specific configuration for `get_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entity_type + ## + # RPC-specific configuration for `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `update_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entity_type + ## + # RPC-specific configuration for `delete_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entity_type + ## + # RPC-specific configuration for `create_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature + ## + # RPC-specific configuration for `batch_create_features` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_features + ## + # RPC-specific configuration for `get_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature + ## + # RPC-specific configuration for `list_features` + # @return [::Gapic::Config::Method] + # + attr_reader :list_features + ## + # RPC-specific configuration for `update_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature + ## + # RPC-specific configuration for `delete_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature + ## + # RPC-specific configuration for `import_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :import_feature_values + ## + # RPC-specific configuration for `batch_read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_read_feature_values + ## + # RPC-specific configuration for `export_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :export_feature_values + ## + # RPC-specific configuration for `delete_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_values + ## + # RPC-specific configuration for `search_features` + # @return [::Gapic::Config::Method] + # + attr_reader :search_features + + # @private + def initialize parent_rpcs = nil + create_featurestore_config = parent_rpcs.create_featurestore if parent_rpcs.respond_to? :create_featurestore + @create_featurestore = ::Gapic::Config::Method.new create_featurestore_config + get_featurestore_config = parent_rpcs.get_featurestore if parent_rpcs.respond_to? :get_featurestore + @get_featurestore = ::Gapic::Config::Method.new get_featurestore_config + list_featurestores_config = parent_rpcs.list_featurestores if parent_rpcs.respond_to? :list_featurestores + @list_featurestores = ::Gapic::Config::Method.new list_featurestores_config + update_featurestore_config = parent_rpcs.update_featurestore if parent_rpcs.respond_to? :update_featurestore + @update_featurestore = ::Gapic::Config::Method.new update_featurestore_config + delete_featurestore_config = parent_rpcs.delete_featurestore if parent_rpcs.respond_to? :delete_featurestore + @delete_featurestore = ::Gapic::Config::Method.new delete_featurestore_config + create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type + @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config + get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type + @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config + list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types + @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config + update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type + @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config + delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type + @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config + create_feature_config = parent_rpcs.create_feature if parent_rpcs.respond_to? :create_feature + @create_feature = ::Gapic::Config::Method.new create_feature_config + batch_create_features_config = parent_rpcs.batch_create_features if parent_rpcs.respond_to? :batch_create_features + @batch_create_features = ::Gapic::Config::Method.new batch_create_features_config + get_feature_config = parent_rpcs.get_feature if parent_rpcs.respond_to? :get_feature + @get_feature = ::Gapic::Config::Method.new get_feature_config + list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features + @list_features = ::Gapic::Config::Method.new list_features_config + update_feature_config = parent_rpcs.update_feature if parent_rpcs.respond_to? :update_feature + @update_feature = ::Gapic::Config::Method.new update_feature_config + delete_feature_config = parent_rpcs.delete_feature if parent_rpcs.respond_to? :delete_feature + @delete_feature = ::Gapic::Config::Method.new delete_feature_config + import_feature_values_config = parent_rpcs.import_feature_values if parent_rpcs.respond_to? :import_feature_values + @import_feature_values = ::Gapic::Config::Method.new import_feature_values_config + batch_read_feature_values_config = parent_rpcs.batch_read_feature_values if parent_rpcs.respond_to? :batch_read_feature_values + @batch_read_feature_values = ::Gapic::Config::Method.new batch_read_feature_values_config + export_feature_values_config = parent_rpcs.export_feature_values if parent_rpcs.respond_to? :export_feature_values + @export_feature_values = ::Gapic::Config::Method.new export_feature_values_config + delete_feature_values_config = parent_rpcs.delete_feature_values if parent_rpcs.respond_to? :delete_feature_values + @delete_feature_values = ::Gapic::Config::Method.new delete_feature_values_config + search_features_config = parent_rpcs.search_features if parent_rpcs.respond_to? :search_features + @search_features = ::Gapic::Config::Method.new search_features_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/credentials.rb new file mode 100644 index 000000000000..d0b8589323cf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + # Credentials for the FeaturestoreService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb new file mode 100644 index 000000000000..bd72a3424717 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + # 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 FeaturestoreService 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 FeaturestoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb new file mode 100644 index 000000000000..272a000561cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + # Path helper methods for the FeaturestoreService API. + module Paths + ## + # Create a fully-qualified EntityType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path project:, location:, featurestore:, entity_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}" + end + + ## + # Create a fully-qualified Feature resource string. + # + # @overload feature_path(project:, location:, featurestore:, entity_type:, feature:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # @param entity_type [String] + # @param feature [String] + # + # @overload feature_path(project:, location:, feature_group:, feature:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # + # @param project [String] + # @param location [String] + # @param feature_group [String] + # @param feature [String] + # + # @return [::String] + def feature_path **args + resources = { + "entity_type:feature:featurestore:location:project" => (proc do |project:, location:, featurestore:, entity_type:, feature:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "featurestore cannot contain /" if featurestore.to_s.include? "/" + raise ::ArgumentError, "entity_type cannot contain /" if entity_type.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}/entityTypes/#{entity_type}/features/#{feature}" + end), + "feature:feature_group:location:project" => (proc do |project:, location:, feature_group:, feature:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "feature_group cannot contain /" if feature_group.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureGroups/#{feature_group}/features/#{feature}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified FeatureGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # + # @param project [String] + # @param location [String] + # @param feature_group [String] + # + # @return [::String] + def feature_group_path project:, location:, feature_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featureGroups/#{feature_group}" + end + + ## + # Create a fully-qualified Featurestore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # + # @param project [String] + # @param location [String] + # @param featurestore [String] + # + # @return [::String] + def featurestore_path project:, location:, featurestore: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/featurestores/#{featurestore}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest.rb new file mode 100644 index 000000000000..36e086bbd7e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/featurestore_service/credentials" +require "google/cloud/ai_platform/v1/featurestore_service/paths" +require "google/cloud/ai_platform/v1/featurestore_service/rest/operations" +require "google/cloud/ai_platform/v1/featurestore_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that handles CRUD and List for resources for Featurestore. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/featurestore_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.new + # + module FeaturestoreService + # 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/featurestore_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb new file mode 100644 index 000000000000..b2444176140e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb @@ -0,0 +1,2790 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/featurestore_service_pb" +require "google/cloud/ai_platform/v1/featurestore_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + module Rest + ## + # REST client for the FeaturestoreService service. + # + # The service that handles CRUD and List for resources for Featurestore. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :featurestore_service_stub + + ## + # Configure the FeaturestoreService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeaturestoreService clients + # ::Google::Cloud::AIPlatform::V1::FeaturestoreService::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 FeaturestoreService 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::FeaturestoreService::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 + @featurestore_service_stub.universe_domain + end + + ## + # Create a new FeaturestoreService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeaturestoreService 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::FeaturestoreService::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 + + @featurestore_service_stub = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @featurestore_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 = @featurestore_service_stub.endpoint + config.universe_domain = @featurestore_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @featurestore_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 = @featurestore_service_stub.endpoint + config.universe_domain = @featurestore_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @featurestore_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreService::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 + @featurestore_service_stub.logger + end + + # Service calls + + ## + # Creates a new Featurestore in a given project and location. + # + # @overload create_featurestore(request, options = nil) + # Pass arguments to `create_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest, ::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_featurestore(parent: nil, featurestore: nil, featurestore_id: nil) + # Pass arguments to `create_featurestore` 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 Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @param featurestore [::Google::Cloud::AIPlatform::V1::Featurestore, ::Hash] + # Required. The Featurestore to create. + # @param featurestore_id [::String] + # Required. The ID to use for this Featurestore, which will become the final + # component of the Featurestore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest.new + # + # # Call the create_featurestore method. + # result = client.create_featurestore 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_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.create_featurestore 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 a single Featurestore. + # + # @overload get_featurestore(request, options = nil) + # Pass arguments to `get_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest, ::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_featurestore(name: nil) + # Pass arguments to `get_featurestore` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Featurestore resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Featurestore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Featurestore] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest.new + # + # # Call the get_featurestore method. + # result = client.get_featurestore request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Featurestore. + # p result + # + def get_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.get_featurestore 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 Featurestores in a given project and location. + # + # @overload list_featurestores(request, options = nil) + # Pass arguments to `list_featurestores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest, ::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_featurestores(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_featurestores` 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 Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the featurestores that match the filter expression. The following + # fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + # `<=`, and `>=` comparisons. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # Featurestores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # Featurestores with label "env" set to "prod". + # @param page_size [::Integer] + # The maximum number of Featurestores to return. The service may return fewer + # than this value. If unspecified, at most 100 Featurestores will be + # returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # must match the call that provided the page token. + # @param order_by [::String] + # 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` + # * `online_serving_config.fixed_node_count` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Featurestore>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Featurestore>] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest.new + # + # # Call the list_featurestores method. + # result = client.list_featurestores 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::Featurestore. + # p item + # end + # + def list_featurestores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest + + # 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_featurestores.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_featurestores.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_featurestores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.list_featurestores request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @featurestore_service_stub, :list_featurestores, "featurestores", 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 parameters of a single Featurestore. + # + # @overload update_featurestore(request, options = nil) + # Pass arguments to `update_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest, ::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_featurestore(featurestore: nil, update_mask: nil) + # Pass arguments to `update_featurestore` 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 featurestore [::Google::Cloud::AIPlatform::V1::Featurestore, ::Hash] + # Required. The Featurestore's `name` field is used to identify the + # Featurestore to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Featurestore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `online_serving_config.fixed_node_count` + # * `online_serving_config.scaling` + # * `online_storage_ttl_days` + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest.new + # + # # Call the update_featurestore method. + # result = client.update_featurestore request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.update_featurestore 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 single Featurestore. The Featurestore must not contain any + # EntityTypes or `force` must be set to true for the request to succeed. + # + # @overload delete_featurestore(request, options = nil) + # Pass arguments to `delete_featurestore` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest, ::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_featurestore(name: nil, force: nil) + # Pass arguments to `delete_featurestore` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Featurestore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param force [::Boolean] + # If set to true, any EntityTypes and Features for this Featurestore will + # also be deleted. (Otherwise, the request will only work if the Featurestore + # has no EntityTypes.) + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest.new + # + # # Call the delete_featurestore method. + # result = client.delete_featurestore 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_featurestore request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest + + # 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_featurestore.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_featurestore.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_featurestore.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.delete_featurestore 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 + + ## + # Creates a new EntityType in a given Featurestore. + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest, ::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_entity_type(parent: nil, entity_type: nil, entity_type_id: nil) + # Pass arguments to `create_entity_type` 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 Featurestore to create EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param entity_type [::Google::Cloud::AIPlatform::V1::EntityType, ::Hash] + # The EntityType to create. + # @param entity_type_id [::String] + # Required. The ID to use for the EntityType, which will become the final + # component of the EntityType's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a featurestore. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type 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_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.create_entity_type 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 a single EntityType. + # + # @overload get_entity_type(request, options = nil) + # Pass arguments to `get_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest, ::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_entity_type(name: nil) + # Pass arguments to `get_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the EntityType resource. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + # p result + # + def get_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.get_entity_type 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 EntityTypes in a given Featurestore. + # + # @overload list_entity_types(request, options = nil) + # Pass arguments to `list_entity_types` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest, ::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_entity_types(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_entity_types` 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 Featurestore to list EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param filter [::String] + # Lists the EntityTypes that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any EntityType which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of EntityTypes to return. The service may return fewer + # than this value. If unspecified, at most 1000 EntityTypes will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `entity_type_id` + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::EntityType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::EntityType>] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types 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::EntityType. + # p item + # end + # + def list_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest + + # 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_entity_types.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_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.list_entity_types request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @featurestore_service_stub, :list_entity_types, "entity_types", 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 parameters of a single EntityType. + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest, ::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_entity_type(entity_type: nil, update_mask: nil) + # Pass arguments to `update_entity_type` 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 entity_type [::Google::Cloud::AIPlatform::V1::EntityType, ::Hash] + # Required. The EntityType's `name` field is used to identify the EntityType + # to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # EntityType resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `monitoring_config.snapshot_analysis.disabled` + # * `monitoring_config.snapshot_analysis.monitoring_interval_days` + # * `monitoring_config.snapshot_analysis.staleness_days` + # * `monitoring_config.import_features_analysis.state` + # * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + # * `monitoring_config.numerical_threshold_config.value` + # * `monitoring_config.categorical_threshold_config.value` + # * `offline_storage_ttl_days` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + # p result + # + def update_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.update_entity_type 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 a single EntityType. The EntityType must not have any Features + # or `force` must be set to true for the request to succeed. + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest, ::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_entity_type(name: nil, force: nil) + # Pass arguments to `delete_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the EntityType to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param force [::Boolean] + # If set to true, any Features for this EntityType will also be deleted. + # (Otherwise, the request will only work if the EntityType has no Features.) + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type 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_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest + + # 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_entity_type.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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.delete_entity_type 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 + + ## + # Creates a new Feature in a given EntityType. + # + # @overload create_feature(request, options = nil) + # Pass arguments to `create_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::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_feature(parent: nil, feature: nil, feature_id: nil) + # Pass arguments to `create_feature` 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 EntityType or FeatureGroup to create a + # Feature. Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature to create. + # @param feature_id [::String] + # Required. The ID to use for the Feature, which will become the final + # component of the Feature's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within an EntityType/FeatureGroup. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new + # + # # Call the create_feature method. + # result = client.create_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.create_feature 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 + + ## + # Creates a batch of Features in a given EntityType. + # + # @overload batch_create_features(request, options = nil) + # Pass arguments to `batch_create_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::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 batch_create_features(parent: nil, requests: nil) + # Pass arguments to `batch_create_features` 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 EntityType/FeatureGroup to create the + # batch of Features under. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Hash>] + # Required. The request message specifying the Features to create. All + # Features must be created under the same parent EntityType / FeatureGroup. + # The `parent` field in each child request message can be omitted. If + # `parent` is set in a child request, then the value must match the `parent` + # value in this request message. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new + # + # # Call the batch_create_features method. + # result = client.batch_create_features 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 batch_create_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest + + # 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.batch_create_features.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.batch_create_features.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.batch_create_features 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 a single Feature. + # + # @overload get_feature(request, options = nil) + # Pass arguments to `get_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `get_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Feature resource. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new + # + # # Call the get_feature method. + # result = client.get_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def get_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.get_feature 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 Features in a given EntityType. + # + # @overload list_features(request, options = nil) + # Pass arguments to `list_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::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_features(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil, latest_stats_count: nil) + # Pass arguments to `list_features` 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 Features. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @param filter [::String] + # Lists the Features that match the filter expression. The following + # filters are supported: + # + # * `value_type`: Supports = and != comparisons. + # * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with 'env' as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 1000 Features will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_features FeaturestoreService.ListFeatures} + # call or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_features FeatureRegistryService.ListFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#list_features FeaturestoreService.ListFeatures} + # or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client#list_features FeatureRegistryService.ListFeatures} + # must match the call that provided the page token. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `feature_id` + # * `value_type` (Not supported for FeatureRegistry Feature) + # * `create_time` + # * `update_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param latest_stats_count [::Integer] + # Only applicable for Vertex AI Feature Store (Legacy). + # If set, return the most recent + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count} + # of stats for each Feature in response. Valid value is [0, 10]. If number of + # stats exists < + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count}, + # return all existing stats. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new + # + # # Call the list_features method. + # result = client.list_features 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::Feature. + # p item + # end + # + def list_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest + + # 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_features.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_features.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.list_features request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @featurestore_service_stub, :list_features, "features", 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 parameters of a single Feature. + # + # @overload update_feature(request, options = nil) + # Pass arguments to `update_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::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_feature(feature: nil, update_mask: nil) + # Pass arguments to `update_feature` 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 feature [::Google::Cloud::AIPlatform::V1::Feature, ::Hash] + # Required. The Feature's `name` field is used to identify the Feature to be + # updated. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Features resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `disable_monitoring` (Not supported for FeatureRegistryService Feature) + # * `point_of_contact` (Not supported for FeaturestoreService FeatureStore) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new + # + # # Call the update_feature method. + # result = client.update_feature request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + # p result + # + def update_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.update_feature 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 a single Feature. + # + # @overload delete_feature(request, options = nil) + # Pass arguments to `delete_feature` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::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_feature(name: nil) + # Pass arguments to `delete_feature` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Features to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new + # + # # Call the delete_feature method. + # result = client.delete_feature 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_feature request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest + + # 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_feature.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_feature.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.delete_feature 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 + + ## + # Imports Feature values into the Featurestore from a source storage. + # + # The progress of the import is tracked by the returned operation. The + # imported features are guaranteed to be visible to subsequent read + # operations after the operation is marked as successfully done. + # + # If an import operation fails, the Feature values returned from + # reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same import request again and wait till + # the new operation returned is marked as successfully done. + # + # There are also scenarios where the caller can cause inconsistency. + # + # - Source data for import contains multiple distinct Feature values for + # the same entity ID and timestamp. + # - Source is modified during an import. This includes adding, updating, or + # removing source data and/or metadata. Examples of updating metadata + # include but are not limited to changing storage location, storage class, + # or retention policy. + # - Online serving cluster is under-provisioned. + # + # @overload import_feature_values(request, options = nil) + # Pass arguments to `import_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest, ::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 import_feature_values(avro_source: nil, bigquery_source: nil, csv_source: nil, feature_time_field: nil, feature_time: nil, entity_type: nil, entity_id_field: nil, feature_specs: nil, disable_online_serving: nil, worker_count: nil, disable_ingestion_analysis: nil) + # Pass arguments to `import_feature_values` 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 avro_source [::Google::Cloud::AIPlatform::V1::AvroSource, ::Hash] + # @param bigquery_source [::Google::Cloud::AIPlatform::V1::BigQuerySource, ::Hash] + # @param csv_source [::Google::Cloud::AIPlatform::V1::CsvSource, ::Hash] + # @param feature_time_field [::String] + # Source column that holds the Feature timestamp for all Feature + # values in each entity. + # @param feature_time [::Google::Protobuf::Timestamp, ::Hash] + # Single Feature timestamp for all entities being imported. The + # timestamp must not have higher than millisecond precision. + # @param entity_type [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being imported. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + # @param entity_id_field [::String] + # Source column that holds entity IDs. If not provided, entity IDs are + # extracted from the column named entity_id. + # @param feature_specs [::Array<::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest::FeatureSpec, ::Hash>] + # Required. Specifications defining which Feature values to import from the + # entity. The request fails if no feature_specs are provided, and having + # multiple feature_specs for one Feature is not allowed. + # @param disable_online_serving [::Boolean] + # If set, data will not be imported for online serving. This + # is typically used for backfilling, where Feature generation timestamps are + # not in the timestamp range needed for online serving. + # @param worker_count [::Integer] + # Specifies the number of workers that are used to write data to the + # Featurestore. Consider the online serving capacity that you require to + # achieve the desired import throughput without interfering with online + # serving. The value must be positive, and less than or equal to 100. + # If not set, defaults to using 1 worker. The low count ensures minimal + # impact on online serving performance. + # @param disable_ingestion_analysis [::Boolean] + # If true, API doesn't start ingestion analysis pipeline. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest.new + # + # # Call the import_feature_values method. + # result = client.import_feature_values 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 import_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest + + # 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.import_feature_values.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.import_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.import_feature_values 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 + + ## + # Batch reads Feature values from a Featurestore. + # + # This API enables batch reading Feature values, where each read + # instance in the batch may read Feature values of entities from one or + # more EntityTypes. Point-in-time correctness is guaranteed for Feature + # values of each read instance as of each instance's read timestamp. + # + # @overload batch_read_feature_values(request, options = nil) + # Pass arguments to `batch_read_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest, ::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 batch_read_feature_values(csv_read_instances: nil, bigquery_read_instances: nil, featurestore: nil, destination: nil, pass_through_fields: nil, entity_type_specs: nil, start_time: nil) + # Pass arguments to `batch_read_feature_values` 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 csv_read_instances [::Google::Cloud::AIPlatform::V1::CsvSource, ::Hash] + # Each read instance consists of exactly one read timestamp and one or more + # entity IDs identifying entities of the corresponding EntityTypes whose + # Features are requested. + # + # Each output instance contains Feature values of requested entities + # concatenated together as of the read time. + # + # An example read instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z`. + # + # An example output instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + # bar_entity_feature2_value`. + # + # Timestamp in each read instance must be millisecond-aligned. + # + # `csv_read_instances` are read instances stored in a plain-text CSV file. + # The header should be: + # [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + # + # The columns can be in any order. + # + # Values in the timestamp column must use the RFC 3339 format, e.g. + # `2012-07-30T10:43:17.123Z`. + # @param bigquery_read_instances [::Google::Cloud::AIPlatform::V1::BigQuerySource, ::Hash] + # Similar to csv_read_instances, but from BigQuery source. + # @param featurestore [::String] + # Required. The resource name of the Featurestore from which to query Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @param destination [::Google::Cloud::AIPlatform::V1::FeatureValueDestination, ::Hash] + # Required. Specifies output location and format. + # @param pass_through_fields [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::PassThroughField, ::Hash>] + # When not empty, the specified fields in the *_read_instances source will be + # joined as-is in the output, in addition to those fields from the + # Featurestore Entity. + # + # For BigQuery source, the type of the pass-through values will be + # automatically inferred. For CSV source, the pass-through values will be + # passed as opaque bytes. + # @param entity_type_specs [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::EntityTypeSpec, ::Hash>] + # Required. Specifies EntityType grouping Features to read values of and + # settings. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Excludes Feature values with feature generation timestamp before + # this timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new + # + # # Call the batch_read_feature_values method. + # result = client.batch_read_feature_values 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 batch_read_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest + + # 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.batch_read_feature_values.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.batch_read_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_read_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.batch_read_feature_values 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 + + ## + # Exports Feature values from all the entities of a target EntityType. + # + # @overload export_feature_values(request, options = nil) + # Pass arguments to `export_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest, ::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 export_feature_values(snapshot_export: nil, full_export: nil, entity_type: nil, destination: nil, feature_selector: nil, settings: nil) + # Pass arguments to `export_feature_values` 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 snapshot_export [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::SnapshotExport, ::Hash] + # Exports the latest Feature values of all entities of the EntityType + # within a time range. + # @param full_export [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::FullExport, ::Hash] + # Exports all historical values of all entities of the EntityType within a + # time range + # @param entity_type [::String] + # Required. The resource name of the EntityType from which to export Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @param destination [::Google::Cloud::AIPlatform::V1::FeatureValueDestination, ::Hash] + # Required. Specifies destination location and format. + # @param feature_selector [::Google::Cloud::AIPlatform::V1::FeatureSelector, ::Hash] + # Required. Selects Features to export values of. + # @param settings [::Array<::Google::Cloud::AIPlatform::V1::DestinationFeatureSetting, ::Hash>] + # Per-Feature export settings. + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest.new + # + # # Call the export_feature_values method. + # result = client.export_feature_values 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 export_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest + + # 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.export_feature_values.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.export_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.export_feature_values 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 + + ## + # Delete Feature values from Featurestore. + # + # The progress of the deletion is tracked by the returned operation. The + # deleted feature values are guaranteed to be invisible to subsequent read + # operations after the operation is marked as successfully done. + # + # If a delete feature values operation fails, the feature values + # returned from reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same delete request again and wait till + # the new operation returned is marked as successfully done. + # + # @overload delete_feature_values(request, options = nil) + # Pass arguments to `delete_feature_values` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest, ::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_feature_values(select_entity: nil, select_time_range_and_feature: nil, entity_type: nil) + # Pass arguments to `delete_feature_values` 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 select_entity [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectEntity, ::Hash] + # Select feature values to be deleted by specifying entities. + # @param select_time_range_and_feature [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectTimeRangeAndFeature, ::Hash] + # Select feature values to be deleted by specifying time range and + # features. + # @param entity_type [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being deleted from. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest.new + # + # # Call the delete_feature_values method. + # result = client.delete_feature_values 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_feature_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest + + # 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_feature_values.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_feature_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_feature_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.delete_feature_values 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 + + ## + # Searches Features matching a query in a given project. + # + # @overload search_features(request, options = nil) + # Pass arguments to `search_features` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest, ::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 search_features(location: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_features` 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 location [::String] + # Required. The resource name of the Location to search Features. + # Format: + # `projects/{project}/locations/{location}` + # @param query [::String] + # Query string that is a conjunction of field-restricted queries and/or + # field-restricted filters. Field-restricted queries and filters can be + # combined using `AND` to form a conjunction. + # + # A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + # exists as a substring within Feature's FIELD. The QUERY + # and the FIELD are converted to a sequence of words (i.e. tokens) for + # comparison. This is done by: + # + # * Removing leading/trailing whitespace and tokenizing the search value. + # Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + # `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + # as a wildcard that matches characters within a token. + # * Ignoring case. + # * Prepending an asterisk to the first and appending an asterisk to the + # last token in QUERY. + # + # A QUERY must be either a singular token or a phrase. A phrase is one or + # multiple words enclosed in double quotation marks ("). With phrases, the + # order of the words is important. Words in the phrase must be matching in + # order and consecutively. + # + # Supported FIELDs for field-restricted queries: + # + # * `feature_id` + # * `description` + # * `entity_type_id` + # + # Examples: + # + # * `feature_id: foo` --> Matches a Feature with ID containing the substring + # `foo` (eg. `foo`, `foofeature`, `barfoo`). + # * `feature_id: foo*feature` --> Matches a Feature with ID containing the + # substring `foo*feature` (eg. `foobarfeature`). + # * `feature_id: foo AND description: bar` --> Matches a Feature with ID + # containing the substring `foo` and description containing the substring + # `bar`. + # + # + # Besides field queries, the following exact-match filters are + # supported. The exact-match filters do not support wildcards. Unlike + # field-restricted queries, exact-match filters are case-sensitive. + # + # * `feature_id`: Supports = comparisons. + # * `description`: Supports = comparisons. Multi-token filters should be + # enclosed in quotes. + # * `entity_type_id`: Supports = comparisons. + # * `value_type`: Supports = and != comparisons. + # * `labels`: Supports key-value equality as well as key presence. + # * `featurestore_id`: Supports = comparisons. + # + # Examples: + # + # * `description = "foo bar"` --> Any Feature with description exactly equal + # to `foo bar` + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with `env` as the + # key. + # @param page_size [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 100 Features will be returned. + # The maximum value is 100; any value greater than 100 will be coerced to + # 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#search_features FeaturestoreService.SearchFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client#search_features FeaturestoreService.SearchFeatures}, + # except `page_size`, must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Feature>] + # + # @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::FeaturestoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchFeaturesRequest.new + # + # # Call the search_features method. + # result = client.search_features 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::Feature. + # p item + # end + # + def search_features request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest + + # 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.search_features.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.search_features.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_features.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @featurestore_service_stub.search_features request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @featurestore_service_stub, :search_features, "features", 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 + + ## + # Configuration class for the FeaturestoreService REST API. + # + # This class represents the configuration for FeaturestoreService 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::FeaturestoreService::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_featurestore to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_featurestore.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_featurestore.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeaturestoreService 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_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :create_featurestore + ## + # RPC-specific configuration for `get_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :get_featurestore + ## + # RPC-specific configuration for `list_featurestores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_featurestores + ## + # RPC-specific configuration for `update_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :update_featurestore + ## + # RPC-specific configuration for `delete_featurestore` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_featurestore + ## + # RPC-specific configuration for `create_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entity_type + ## + # RPC-specific configuration for `get_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entity_type + ## + # RPC-specific configuration for `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `update_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entity_type + ## + # RPC-specific configuration for `delete_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entity_type + ## + # RPC-specific configuration for `create_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :create_feature + ## + # RPC-specific configuration for `batch_create_features` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_features + ## + # RPC-specific configuration for `get_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :get_feature + ## + # RPC-specific configuration for `list_features` + # @return [::Gapic::Config::Method] + # + attr_reader :list_features + ## + # RPC-specific configuration for `update_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :update_feature + ## + # RPC-specific configuration for `delete_feature` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature + ## + # RPC-specific configuration for `import_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :import_feature_values + ## + # RPC-specific configuration for `batch_read_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_read_feature_values + ## + # RPC-specific configuration for `export_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :export_feature_values + ## + # RPC-specific configuration for `delete_feature_values` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_feature_values + ## + # RPC-specific configuration for `search_features` + # @return [::Gapic::Config::Method] + # + attr_reader :search_features + + # @private + def initialize parent_rpcs = nil + create_featurestore_config = parent_rpcs.create_featurestore if parent_rpcs.respond_to? :create_featurestore + @create_featurestore = ::Gapic::Config::Method.new create_featurestore_config + get_featurestore_config = parent_rpcs.get_featurestore if parent_rpcs.respond_to? :get_featurestore + @get_featurestore = ::Gapic::Config::Method.new get_featurestore_config + list_featurestores_config = parent_rpcs.list_featurestores if parent_rpcs.respond_to? :list_featurestores + @list_featurestores = ::Gapic::Config::Method.new list_featurestores_config + update_featurestore_config = parent_rpcs.update_featurestore if parent_rpcs.respond_to? :update_featurestore + @update_featurestore = ::Gapic::Config::Method.new update_featurestore_config + delete_featurestore_config = parent_rpcs.delete_featurestore if parent_rpcs.respond_to? :delete_featurestore + @delete_featurestore = ::Gapic::Config::Method.new delete_featurestore_config + create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type + @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config + get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type + @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config + list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types + @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config + update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type + @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config + delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type + @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config + create_feature_config = parent_rpcs.create_feature if parent_rpcs.respond_to? :create_feature + @create_feature = ::Gapic::Config::Method.new create_feature_config + batch_create_features_config = parent_rpcs.batch_create_features if parent_rpcs.respond_to? :batch_create_features + @batch_create_features = ::Gapic::Config::Method.new batch_create_features_config + get_feature_config = parent_rpcs.get_feature if parent_rpcs.respond_to? :get_feature + @get_feature = ::Gapic::Config::Method.new get_feature_config + list_features_config = parent_rpcs.list_features if parent_rpcs.respond_to? :list_features + @list_features = ::Gapic::Config::Method.new list_features_config + update_feature_config = parent_rpcs.update_feature if parent_rpcs.respond_to? :update_feature + @update_feature = ::Gapic::Config::Method.new update_feature_config + delete_feature_config = parent_rpcs.delete_feature if parent_rpcs.respond_to? :delete_feature + @delete_feature = ::Gapic::Config::Method.new delete_feature_config + import_feature_values_config = parent_rpcs.import_feature_values if parent_rpcs.respond_to? :import_feature_values + @import_feature_values = ::Gapic::Config::Method.new import_feature_values_config + batch_read_feature_values_config = parent_rpcs.batch_read_feature_values if parent_rpcs.respond_to? :batch_read_feature_values + @batch_read_feature_values = ::Gapic::Config::Method.new batch_read_feature_values_config + export_feature_values_config = parent_rpcs.export_feature_values if parent_rpcs.respond_to? :export_feature_values + @export_feature_values = ::Gapic::Config::Method.new export_feature_values_config + delete_feature_values_config = parent_rpcs.delete_feature_values if parent_rpcs.respond_to? :delete_feature_values + @delete_feature_values = ::Gapic::Config::Method.new delete_feature_values_config + search_features_config = parent_rpcs.search_features if parent_rpcs.respond_to? :search_features + @search_features = ::Gapic::Config::Method.new search_features_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb new file mode 100644 index 000000000000..e952b4bb0338 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + 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 FeaturestoreService 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 FeaturestoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb new file mode 100644 index 000000000000..d93eb330d852 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb @@ -0,0 +1,1373 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/featurestore_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + module Rest + ## + # REST service stub for the FeaturestoreService 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_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest] + # 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_featurestore request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_featurestore_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_featurestore", + 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_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest] + # 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::Featurestore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Featurestore] + # A result object deserialized from the server's reply + def get_featurestore request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_featurestore_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_featurestore", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Featurestore.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_featurestores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest] + # 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::ListFeaturestoresResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeaturestoresResponse] + # A result object deserialized from the server's reply + def list_featurestores request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_featurestores_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_featurestores", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeaturestoresResponse.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_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_featurestore request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_featurestore_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_featurestore", + 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_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest] + # 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_featurestore request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_featurestore_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_featurestore", + 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 create_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest] + # 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_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_entity_type_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_entity_type", + 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_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest] + # 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::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # A result object deserialized from the server's reply + def get_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_entity_type_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::EntityType.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_entity_types REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest] + # 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::ListEntityTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListEntityTypesResponse] + # A result object deserialized from the server's reply + def list_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_entity_types_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_entity_types", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListEntityTypesResponse.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest] + # 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::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # A result object deserialized from the server's reply + def update_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_entity_type_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::EntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest] + # 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_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity_type_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_entity_type", + 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 create_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest] + # 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_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_feature_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_feature", + 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 batch_create_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest] + # 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 batch_create_features request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_features_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: "batch_create_features", + 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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureRequest] + # 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::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # A result object deserialized from the server's reply + def get_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_feature_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_feature", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Feature.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_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest] + # 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::ListFeaturesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListFeaturesResponse] + # A result object deserialized from the server's reply + def list_features request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_features_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_features", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListFeaturesResponse.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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest] + # 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::Feature] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # A result object deserialized from the server's reply + def update_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_feature_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_feature", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Feature.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_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest] + # 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_feature request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_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_feature", + 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 import_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest] + # 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 import_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_feature_values_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: "import_feature_values", + 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 batch_read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest] + # 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 batch_read_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_read_feature_values_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: "batch_read_feature_values", + 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 export_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest] + # 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 export_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_feature_values_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: "export_feature_values", + 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_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest] + # 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_feature_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_feature_values_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_feature_values", + 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 search_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest] + # 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::SearchFeaturesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchFeaturesResponse] + # A result object deserialized from the server's reply + def search_features request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_features_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: "search_features", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SearchFeaturesResponse.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_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest] + # 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_featurestore_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/featurestores", + body: "featurestore", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest] + # 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_featurestore_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_featurestores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest] + # 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_featurestores_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/featurestores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest] + # 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_featurestore_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{featurestore.name}", + body: "featurestore", + matches: [ + ["featurestore.name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_featurestore REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest] + # 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_featurestore_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entityTypes", + body: "entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_entity_types REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest] + # 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_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entity_type.name}", + body: "entity_type", + matches: [ + ["entity_type.name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_entity_type REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/features", + body: "feature", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/features:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListFeaturesRequest] + # 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_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/features", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{feature.name}", + body: "feature", + matches: [ + ["feature.name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest] + # 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_feature_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:importFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_read_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_read_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{featurestore}:batchReadFeatureValues", + body: "*", + matches: [ + ["featurestore", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:exportFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_feature_values REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest] + # 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_feature_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{entity_type}:deleteFeatureValues", + body: "*", + matches: [ + ["entity_type", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_features REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_features_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{location}/featurestores:searchFeatures", + matches: [ + ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service.rb new file mode 100644 index 000000000000..8adcb4b183f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/gen_ai_cache_service/credentials" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/paths" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/client" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for managing Vertex AI's CachedContent resource. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/gen_ai_cache_service" + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new + # + module GenAiCacheService + end + end + end + end +end + +helper_path = ::File.join __dir__, "gen_ai_cache_service", "helpers.rb" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/client.rb new file mode 100644 index 000000000000..a06fffb056d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/client.rb @@ -0,0 +1,872 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/gen_ai_cache_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + ## + # Client for the GenAiCacheService service. + # + # Service for managing Vertex AI's CachedContent resource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :gen_ai_cache_service_stub + + ## + # Configure the GenAiCacheService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenAiCacheService clients + # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::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 GenAiCacheService 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::GenAiCacheService::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 + @gen_ai_cache_service_stub.universe_domain + end + + ## + # Create a new GenAiCacheService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenAiCacheService 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/gen_ai_cache_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 + + @gen_ai_cache_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::GenAiCacheService::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 + ) + + @gen_ai_cache_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 = @gen_ai_cache_service_stub.endpoint + config.universe_domain = @gen_ai_cache_service_stub.universe_domain + config.logger = @gen_ai_cache_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 = @gen_ai_cache_service_stub.endpoint + config.universe_domain = @gen_ai_cache_service_stub.universe_domain + config.logger = @gen_ai_cache_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @gen_ai_cache_service_stub.logger + end + + # Service calls + + ## + # Creates cached content, this call will initialize the cached content in the + # data storage, and users need to pay for the cache data storage. + # + # @overload create_cached_content(request, options = nil) + # Pass arguments to `create_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest, ::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_cached_content(parent: nil, cached_content: nil) + # Pass arguments to `create_cached_content` 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 parent resource where the cached content will be created + # @param cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash] + # Required. The cached content to create + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateCachedContentRequest.new + # + # # Call the create_cached_content method. + # result = client.create_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def create_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.call_rpc :create_cached_content, 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 + + ## + # Gets cached content configurations + # + # @overload get_cached_content(request, options = nil) + # Pass arguments to `get_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetCachedContentRequest, ::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_cached_content(name: nil) + # Pass arguments to `get_cached_content` 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 referring to the cached content + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetCachedContentRequest.new + # + # # Call the get_cached_content method. + # result = client.get_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def get_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.call_rpc :get_cached_content, 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 + + ## + # Updates cached content configurations + # + # @overload update_cached_content(request, options = nil) + # Pass arguments to `update_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest, ::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_cached_content(cached_content: nil, update_mask: nil) + # Pass arguments to `update_cached_content` 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 cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash] + # Required. The cached content to update + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest.new + # + # # Call the update_cached_content method. + # result = client.update_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def update_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest + + # 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_cached_content.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.cached_content&.name + header_params["cached_content.name"] = request.cached_content.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_cached_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.call_rpc :update_cached_content, 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 cached content + # + # @overload delete_cached_content(request, options = nil) + # Pass arguments to `delete_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest, ::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_cached_content(name: nil) + # Pass arguments to `delete_cached_content` 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 referring to the cached content + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest.new + # + # # Call the delete_cached_content method. + # result = client.delete_cached_content request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.call_rpc :delete_cached_content, 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 cached contents in a project + # + # @overload list_cached_contents(request, options = nil) + # Pass arguments to `list_cached_contents` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest, ::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_cached_contents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_cached_contents` 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 parent, which owns this collection of cached contents. + # @param page_size [::Integer] + # Optional. The maximum number of cached contents to return. The service may + # return fewer than this value. If unspecified, some default (under maximum) + # number of items will be returned. The maximum value is 1000; values above + # 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListCachedContents` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCachedContents` must + # match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>] + # + # @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::GenAiCacheService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListCachedContentsRequest.new + # + # # Call the list_cached_contents method. + # result = client.list_cached_contents 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::CachedContent. + # p item + # end + # + def list_cached_contents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest + + # 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_cached_contents.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_cached_contents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_cached_contents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.call_rpc :list_cached_contents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gen_ai_cache_service_stub, :list_cached_contents, 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 + + ## + # Configuration class for the GenAiCacheService API. + # + # This class represents the configuration for GenAiCacheService, + # 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::GenAiCacheService::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_cached_content to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_cached_content.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_cached_content.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GenAiCacheService 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_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cached_content + ## + # RPC-specific configuration for `get_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cached_content + ## + # RPC-specific configuration for `update_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cached_content + ## + # RPC-specific configuration for `delete_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cached_content + ## + # RPC-specific configuration for `list_cached_contents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cached_contents + + # @private + def initialize parent_rpcs = nil + create_cached_content_config = parent_rpcs.create_cached_content if parent_rpcs.respond_to? :create_cached_content + @create_cached_content = ::Gapic::Config::Method.new create_cached_content_config + get_cached_content_config = parent_rpcs.get_cached_content if parent_rpcs.respond_to? :get_cached_content + @get_cached_content = ::Gapic::Config::Method.new get_cached_content_config + update_cached_content_config = parent_rpcs.update_cached_content if parent_rpcs.respond_to? :update_cached_content + @update_cached_content = ::Gapic::Config::Method.new update_cached_content_config + delete_cached_content_config = parent_rpcs.delete_cached_content if parent_rpcs.respond_to? :delete_cached_content + @delete_cached_content = ::Gapic::Config::Method.new delete_cached_content_config + list_cached_contents_config = parent_rpcs.list_cached_contents if parent_rpcs.respond_to? :list_cached_contents + @list_cached_contents = ::Gapic::Config::Method.new list_cached_contents_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/credentials.rb new file mode 100644 index 000000000000..b1de1b675c33 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + # Credentials for the GenAiCacheService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/paths.rb new file mode 100644 index 000000000000..9206d9c7cc0e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + # Path helper methods for the GenAiCacheService API. + module Paths + ## + # Create a fully-qualified CachedContent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cachedContents/{cached_content}` + # + # @param project [String] + # @param location [String] + # @param cached_content [String] + # + # @return [::String] + def cached_content_path project:, location:, cached_content: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cachedContents/#{cached_content}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified RagCorpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # + # @return [::String] + def rag_corpus_path project:, location:, rag_corpus: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest.rb new file mode 100644 index 000000000000..b93e659d7754 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/gen_ai_cache_service/credentials" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/paths" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for managing Vertex AI's CachedContent resource. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new + # + module GenAiCacheService + # 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/gen_ai_cache_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client.rb new file mode 100644 index 000000000000..2220e0bc8034 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client.rb @@ -0,0 +1,820 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/gen_ai_cache_service_pb" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + module Rest + ## + # REST client for the GenAiCacheService service. + # + # Service for managing Vertex AI's CachedContent resource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :gen_ai_cache_service_stub + + ## + # Configure the GenAiCacheService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenAiCacheService clients + # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::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 GenAiCacheService 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::GenAiCacheService::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 + @gen_ai_cache_service_stub.universe_domain + end + + ## + # Create a new GenAiCacheService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenAiCacheService 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 + + @gen_ai_cache_service_stub = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @gen_ai_cache_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 = @gen_ai_cache_service_stub.endpoint + config.universe_domain = @gen_ai_cache_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @gen_ai_cache_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 = @gen_ai_cache_service_stub.endpoint + config.universe_domain = @gen_ai_cache_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @gen_ai_cache_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @gen_ai_cache_service_stub.logger + end + + # Service calls + + ## + # Creates cached content, this call will initialize the cached content in the + # data storage, and users need to pay for the cache data storage. + # + # @overload create_cached_content(request, options = nil) + # Pass arguments to `create_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest, ::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_cached_content(parent: nil, cached_content: nil) + # Pass arguments to `create_cached_content` 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 parent resource where the cached content will be created + # @param cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash] + # Required. The cached content to create + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateCachedContentRequest.new + # + # # Call the create_cached_content method. + # result = client.create_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def create_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.create_cached_content 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 + + ## + # Gets cached content configurations + # + # @overload get_cached_content(request, options = nil) + # Pass arguments to `get_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetCachedContentRequest, ::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_cached_content(name: nil) + # Pass arguments to `get_cached_content` 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 referring to the cached content + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetCachedContentRequest.new + # + # # Call the get_cached_content method. + # result = client.get_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def get_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.get_cached_content 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 + + ## + # Updates cached content configurations + # + # @overload update_cached_content(request, options = nil) + # Pass arguments to `update_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest, ::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_cached_content(cached_content: nil, update_mask: nil) + # Pass arguments to `update_cached_content` 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 cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash] + # Required. The cached content to update + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # + # @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::GenAiCacheService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest.new + # + # # Call the update_cached_content method. + # result = client.update_cached_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent. + # p result + # + def update_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.update_cached_content 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 cached content + # + # @overload delete_cached_content(request, options = nil) + # Pass arguments to `delete_cached_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest, ::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_cached_content(name: nil) + # Pass arguments to `delete_cached_content` 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 referring to the cached content + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest.new + # + # # Call the delete_cached_content method. + # result = client.delete_cached_content request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_cached_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest + + # 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_cached_content.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_cached_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cached_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.delete_cached_content 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 cached contents in a project + # + # @overload list_cached_contents(request, options = nil) + # Pass arguments to `list_cached_contents` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest, ::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_cached_contents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_cached_contents` 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 parent, which owns this collection of cached contents. + # @param page_size [::Integer] + # Optional. The maximum number of cached contents to return. The service may + # return fewer than this value. If unspecified, some default (under maximum) + # number of items will be returned. The maximum value is 1000; values above + # 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListCachedContents` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCachedContents` must + # match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>] + # + # @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::GenAiCacheService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListCachedContentsRequest.new + # + # # Call the list_cached_contents method. + # result = client.list_cached_contents 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::CachedContent. + # p item + # end + # + def list_cached_contents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest + + # 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_cached_contents.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_cached_contents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_cached_contents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_cache_service_stub.list_cached_contents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gen_ai_cache_service_stub, :list_cached_contents, "cached_contents", 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 + + ## + # Configuration class for the GenAiCacheService REST API. + # + # This class represents the configuration for GenAiCacheService 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::GenAiCacheService::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_cached_content to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_cached_content.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_cached_content.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the GenAiCacheService 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_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cached_content + ## + # RPC-specific configuration for `get_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cached_content + ## + # RPC-specific configuration for `update_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cached_content + ## + # RPC-specific configuration for `delete_cached_content` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cached_content + ## + # RPC-specific configuration for `list_cached_contents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cached_contents + + # @private + def initialize parent_rpcs = nil + create_cached_content_config = parent_rpcs.create_cached_content if parent_rpcs.respond_to? :create_cached_content + @create_cached_content = ::Gapic::Config::Method.new create_cached_content_config + get_cached_content_config = parent_rpcs.get_cached_content if parent_rpcs.respond_to? :get_cached_content + @get_cached_content = ::Gapic::Config::Method.new get_cached_content_config + update_cached_content_config = parent_rpcs.update_cached_content if parent_rpcs.respond_to? :update_cached_content + @update_cached_content = ::Gapic::Config::Method.new update_cached_content_config + delete_cached_content_config = parent_rpcs.delete_cached_content if parent_rpcs.respond_to? :delete_cached_content + @delete_cached_content = ::Gapic::Config::Method.new delete_cached_content_config + list_cached_contents_config = parent_rpcs.list_cached_contents if parent_rpcs.respond_to? :list_cached_contents + @list_cached_contents = ::Gapic::Config::Method.new list_cached_contents_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub.rb new file mode 100644 index 000000000000..52e1a988f774 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/gen_ai_cache_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + module Rest + ## + # REST service stub for the GenAiCacheService 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_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest] + # 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::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # A result object deserialized from the server's reply + def create_cached_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cached_content_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_cached_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CachedContent.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_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetCachedContentRequest] + # 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::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # A result object deserialized from the server's reply + def get_cached_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cached_content_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_cached_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CachedContent.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_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest] + # 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::CachedContent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # A result object deserialized from the server's reply + def update_cached_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cached_content_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_cached_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CachedContent.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_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest] + # 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_cached_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cached_content_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_cached_content", + 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 list_cached_contents REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest] + # 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::ListCachedContentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListCachedContentsResponse] + # A result object deserialized from the server's reply + def list_cached_contents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_cached_contents_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_cached_contents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListCachedContentsResponse.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_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest] + # 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_cached_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cachedContents", + body: "cached_content", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetCachedContentRequest] + # 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_cached_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/cachedContents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest] + # 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_cached_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{cached_content.name}", + body: "cached_content", + matches: [ + ["cached_content.name", %r{^projects/[^/]+/locations/[^/]+/cachedContents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cached_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest] + # 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_cached_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/cachedContents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_cached_contents REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest] + # 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_cached_contents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cachedContents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb new file mode 100644 index 000000000000..a73bb4cecaee --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/paths" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/operations" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/client" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing GenAI Tuning Jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/gen_ai_tuning_service" + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new + # + module GenAiTuningService + end + end + end + end +end + +helper_path = ::File.join __dir__, "gen_ai_tuning_service", "helpers.rb" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb new file mode 100644 index 000000000000..1d9663facc6a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb @@ -0,0 +1,918 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/genai_tuning_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + ## + # Client for the GenAiTuningService service. + # + # A service for creating and managing GenAI Tuning Jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :gen_ai_tuning_service_stub + + ## + # Configure the GenAiTuningService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenAiTuningService clients + # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::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 GenAiTuningService 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::GenAiTuningService::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 + @gen_ai_tuning_service_stub.universe_domain + end + + ## + # Create a new GenAiTuningService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenAiTuningService 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/genai_tuning_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 + + @gen_ai_tuning_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::GenAiTuningService::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 + ) + + @gen_ai_tuning_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 = @gen_ai_tuning_service_stub.endpoint + config.universe_domain = @gen_ai_tuning_service_stub.universe_domain + config.logger = @gen_ai_tuning_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 = @gen_ai_tuning_service_stub.endpoint + config.universe_domain = @gen_ai_tuning_service_stub.universe_domain + config.logger = @gen_ai_tuning_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::GenAiTuningService::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 + @gen_ai_tuning_service_stub.logger + end + + # Service calls + + ## + # Creates a TuningJob. A created TuningJob right away will be attempted to + # be run. + # + # @overload create_tuning_job(request, options = nil) + # Pass arguments to `create_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest, ::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_tuning_job(parent: nil, tuning_job: nil) + # Pass arguments to `create_tuning_job` 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 TuningJob in. + # Format: `projects/{project}/locations/{location}` + # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash] + # Required. The TuningJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TuningJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # + # @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::GenAiTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTuningJobRequest.new + # + # # Call the create_tuning_job method. + # result = client.create_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob. + # p result + # + def create_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.call_rpc :create_tuning_job, 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 + + ## + # Gets a TuningJob. + # + # @overload get_tuning_job(request, options = nil) + # Pass arguments to `get_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTuningJobRequest, ::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_tuning_job(name: nil) + # Pass arguments to `get_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TuningJob resource. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TuningJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # + # @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::GenAiTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTuningJobRequest.new + # + # # Call the get_tuning_job method. + # result = client.get_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob. + # p result + # + def get_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.call_rpc :get_tuning_job, 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 TuningJobs in a Location. + # + # @overload list_tuning_jobs(request, options = nil) + # Pass arguments to `list_tuning_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest, ::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_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tuning_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the TuningJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse#next_page_token ListTuningJobsResponse.next_page_token} + # of the previous GenAiTuningService.ListTuningJob][] call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>] + # + # @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::GenAiTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTuningJobsRequest.new + # + # # Call the list_tuning_jobs method. + # result = client.list_tuning_jobs 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::TuningJob. + # p item + # end + # + def list_tuning_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest + + # 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_tuning_jobs.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_tuning_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tuning_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.call_rpc :list_tuning_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @gen_ai_tuning_service_stub, :list_tuning_jobs, 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 + + ## + # Cancels a TuningJob. + # Starts asynchronous cancellation on the TuningJob. The server makes a best + # effort to cancel the job, but success is not guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#get_tuning_job GenAiTuningService.GetTuningJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, the + # TuningJob is not deleted; instead it becomes a job with a + # {::Google::Cloud::AIPlatform::V1::TuningJob#error TuningJob.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::TuningJob#state TuningJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_tuning_job(request, options = nil) + # Pass arguments to `cancel_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest, ::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_tuning_job(name: nil) + # Pass arguments to `cancel_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TuningJob to cancel. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelTuningJobRequest.new + # + # # Call the cancel_tuning_job method. + # result = client.cancel_tuning_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.call_rpc :cancel_tuning_job, 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 + + ## + # Rebase a TunedModel. + # + # @overload rebase_tuned_model(request, options = nil) + # Pass arguments to `rebase_tuned_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest, ::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 rebase_tuned_model(parent: nil, tuned_model_ref: nil, tuning_job: nil, artifact_destination: nil, deploy_to_same_endpoint: nil) + # Pass arguments to `rebase_tuned_model` 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 into which to rebase the Model. + # Format: `projects/{project}/locations/{location}` + # @param tuned_model_ref [::Google::Cloud::AIPlatform::V1::TunedModelRef, ::Hash] + # Required. TunedModel reference to retrieve the legacy model information. + # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash] + # Optional. The TuningJob to be updated. Users can use this TuningJob field + # to overwrite tuning configs. + # @param artifact_destination [::Google::Cloud::AIPlatform::V1::GcsDestination, ::Hash] + # Optional. The Google Cloud Storage location to write the artifacts. + # @param deploy_to_same_endpoint [::Boolean] + # Optional. By default, bison to gemini migration will always create new + # model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default + # deploy to the same endpoint. See details in this Section. + # + # @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::GenAiTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest.new + # + # # Call the rebase_tuned_model method. + # result = client.rebase_tuned_model 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 rebase_tuned_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest + + # 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.rebase_tuned_model.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.rebase_tuned_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rebase_tuned_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.call_rpc :rebase_tuned_model, 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 GenAiTuningService API. + # + # This class represents the configuration for GenAiTuningService, + # 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::GenAiTuningService::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_tuning_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tuning_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tuning_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GenAiTuningService 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_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tuning_job + ## + # RPC-specific configuration for `get_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tuning_job + ## + # RPC-specific configuration for `list_tuning_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tuning_jobs + ## + # RPC-specific configuration for `cancel_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_tuning_job + ## + # RPC-specific configuration for `rebase_tuned_model` + # @return [::Gapic::Config::Method] + # + attr_reader :rebase_tuned_model + + # @private + def initialize parent_rpcs = nil + create_tuning_job_config = parent_rpcs.create_tuning_job if parent_rpcs.respond_to? :create_tuning_job + @create_tuning_job = ::Gapic::Config::Method.new create_tuning_job_config + get_tuning_job_config = parent_rpcs.get_tuning_job if parent_rpcs.respond_to? :get_tuning_job + @get_tuning_job = ::Gapic::Config::Method.new get_tuning_job_config + list_tuning_jobs_config = parent_rpcs.list_tuning_jobs if parent_rpcs.respond_to? :list_tuning_jobs + @list_tuning_jobs = ::Gapic::Config::Method.new list_tuning_jobs_config + cancel_tuning_job_config = parent_rpcs.cancel_tuning_job if parent_rpcs.respond_to? :cancel_tuning_job + @cancel_tuning_job = ::Gapic::Config::Method.new cancel_tuning_job_config + rebase_tuned_model_config = parent_rpcs.rebase_tuned_model if parent_rpcs.respond_to? :rebase_tuned_model + @rebase_tuned_model = ::Gapic::Config::Method.new rebase_tuned_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb new file mode 100644 index 000000000000..4605aa823ae7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + # Credentials for the GenAiTuningService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb new file mode 100644 index 000000000000..3272641c1697 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + # 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 GenAiTuningService 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 GenAiTuningService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb new file mode 100644 index 000000000000..e323a6178993 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/paths.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + # Path helper methods for the GenAiTuningService API. + module Paths + ## + # Create a fully-qualified Context resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param context [String] + # + # @return [::String] + def context_path project:, location:, metadata_store:, context: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/contexts/#{context}" + end + + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified PipelineJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @param project [String] + # @param location [String] + # @param pipeline_job [String] + # + # @return [::String] + def pipeline_job_path project:, location:, pipeline_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/pipelineJobs/#{pipeline_job}" + end + + ## + # Create a fully-qualified TuningJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + # + # @param project [String] + # @param location [String] + # @param tuning_job [String] + # + # @return [::String] + def tuning_job_path project:, location:, tuning_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tuningJobs/#{tuning_job}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb new file mode 100644 index 000000000000..547d3e5a50b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/credentials" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/paths" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing GenAI Tuning Jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new + # + module GenAiTuningService + # 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/gen_ai_tuning_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb new file mode 100644 index 000000000000..5c489ec03585 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb @@ -0,0 +1,866 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/genai_tuning_service_pb" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + module Rest + ## + # REST client for the GenAiTuningService service. + # + # A service for creating and managing GenAI Tuning Jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :gen_ai_tuning_service_stub + + ## + # Configure the GenAiTuningService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenAiTuningService clients + # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::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 GenAiTuningService 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::GenAiTuningService::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 + @gen_ai_tuning_service_stub.universe_domain + end + + ## + # Create a new GenAiTuningService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenAiTuningService 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::GenAiTuningService::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 + + @gen_ai_tuning_service_stub = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @gen_ai_tuning_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 = @gen_ai_tuning_service_stub.endpoint + config.universe_domain = @gen_ai_tuning_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @gen_ai_tuning_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 = @gen_ai_tuning_service_stub.endpoint + config.universe_domain = @gen_ai_tuning_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @gen_ai_tuning_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::GenAiTuningService::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 + @gen_ai_tuning_service_stub.logger + end + + # Service calls + + ## + # Creates a TuningJob. A created TuningJob right away will be attempted to + # be run. + # + # @overload create_tuning_job(request, options = nil) + # Pass arguments to `create_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest, ::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_tuning_job(parent: nil, tuning_job: nil) + # Pass arguments to `create_tuning_job` 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 TuningJob in. + # Format: `projects/{project}/locations/{location}` + # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash] + # Required. The TuningJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # + # @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::GenAiTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTuningJobRequest.new + # + # # Call the create_tuning_job method. + # result = client.create_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob. + # p result + # + def create_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.create_tuning_job 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 + + ## + # Gets a TuningJob. + # + # @overload get_tuning_job(request, options = nil) + # Pass arguments to `get_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTuningJobRequest, ::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_tuning_job(name: nil) + # Pass arguments to `get_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TuningJob resource. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # + # @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::GenAiTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTuningJobRequest.new + # + # # Call the get_tuning_job method. + # result = client.get_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TuningJob. + # p result + # + def get_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.get_tuning_job 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 TuningJobs in a Location. + # + # @overload list_tuning_jobs(request, options = nil) + # Pass arguments to `list_tuning_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest, ::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_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tuning_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the TuningJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse#next_page_token ListTuningJobsResponse.next_page_token} + # of the previous GenAiTuningService.ListTuningJob][] call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TuningJob>] + # + # @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::GenAiTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTuningJobsRequest.new + # + # # Call the list_tuning_jobs method. + # result = client.list_tuning_jobs 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::TuningJob. + # p item + # end + # + def list_tuning_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest + + # 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_tuning_jobs.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_tuning_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tuning_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.list_tuning_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @gen_ai_tuning_service_stub, :list_tuning_jobs, "tuning_jobs", 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 + + ## + # Cancels a TuningJob. + # Starts asynchronous cancellation on the TuningJob. The server makes a best + # effort to cancel the job, but success is not guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client#get_tuning_job GenAiTuningService.GetTuningJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, the + # TuningJob is not deleted; instead it becomes a job with a + # {::Google::Cloud::AIPlatform::V1::TuningJob#error TuningJob.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::TuningJob#state TuningJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_tuning_job(request, options = nil) + # Pass arguments to `cancel_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest, ::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_tuning_job(name: nil) + # Pass arguments to `cancel_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TuningJob to cancel. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelTuningJobRequest.new + # + # # Call the cancel_tuning_job method. + # result = client.cancel_tuning_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest + + # 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_tuning_job.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_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.cancel_tuning_job 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 + + ## + # Rebase a TunedModel. + # + # @overload rebase_tuned_model(request, options = nil) + # Pass arguments to `rebase_tuned_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest, ::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 rebase_tuned_model(parent: nil, tuned_model_ref: nil, tuning_job: nil, artifact_destination: nil, deploy_to_same_endpoint: nil) + # Pass arguments to `rebase_tuned_model` 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 into which to rebase the Model. + # Format: `projects/{project}/locations/{location}` + # @param tuned_model_ref [::Google::Cloud::AIPlatform::V1::TunedModelRef, ::Hash] + # Required. TunedModel reference to retrieve the legacy model information. + # @param tuning_job [::Google::Cloud::AIPlatform::V1::TuningJob, ::Hash] + # Optional. The TuningJob to be updated. Users can use this TuningJob field + # to overwrite tuning configs. + # @param artifact_destination [::Google::Cloud::AIPlatform::V1::GcsDestination, ::Hash] + # Optional. The Google Cloud Storage location to write the artifacts. + # @param deploy_to_same_endpoint [::Boolean] + # Optional. By default, bison to gemini migration will always create new + # model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default + # deploy to the same endpoint. See details in this Section. + # @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::GenAiTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest.new + # + # # Call the rebase_tuned_model method. + # result = client.rebase_tuned_model 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 rebase_tuned_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest + + # 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.rebase_tuned_model.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.rebase_tuned_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rebase_tuned_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @gen_ai_tuning_service_stub.rebase_tuned_model 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 GenAiTuningService REST API. + # + # This class represents the configuration for GenAiTuningService 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::GenAiTuningService::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_tuning_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tuning_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tuning_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the GenAiTuningService 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_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tuning_job + ## + # RPC-specific configuration for `get_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tuning_job + ## + # RPC-specific configuration for `list_tuning_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tuning_jobs + ## + # RPC-specific configuration for `cancel_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_tuning_job + ## + # RPC-specific configuration for `rebase_tuned_model` + # @return [::Gapic::Config::Method] + # + attr_reader :rebase_tuned_model + + # @private + def initialize parent_rpcs = nil + create_tuning_job_config = parent_rpcs.create_tuning_job if parent_rpcs.respond_to? :create_tuning_job + @create_tuning_job = ::Gapic::Config::Method.new create_tuning_job_config + get_tuning_job_config = parent_rpcs.get_tuning_job if parent_rpcs.respond_to? :get_tuning_job + @get_tuning_job = ::Gapic::Config::Method.new get_tuning_job_config + list_tuning_jobs_config = parent_rpcs.list_tuning_jobs if parent_rpcs.respond_to? :list_tuning_jobs + @list_tuning_jobs = ::Gapic::Config::Method.new list_tuning_jobs_config + cancel_tuning_job_config = parent_rpcs.cancel_tuning_job if parent_rpcs.respond_to? :cancel_tuning_job + @cancel_tuning_job = ::Gapic::Config::Method.new cancel_tuning_job_config + rebase_tuned_model_config = parent_rpcs.rebase_tuned_model if parent_rpcs.respond_to? :rebase_tuned_model + @rebase_tuned_model = ::Gapic::Config::Method.new rebase_tuned_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb new file mode 100644 index 000000000000..94a6041de70c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + 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 GenAiTuningService 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 GenAiTuningService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb new file mode 100644 index 000000000000..42376d1b8a77 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/genai_tuning_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + module Rest + ## + # REST service stub for the GenAiTuningService 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_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest] + # 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::TuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # A result object deserialized from the server's reply + def create_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tuning_job_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_tuning_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TuningJob.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_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTuningJobRequest] + # 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::TuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # A result object deserialized from the server's reply + def get_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tuning_job_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_tuning_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TuningJob.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_tuning_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest] + # 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::ListTuningJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse] + # A result object deserialized from the server's reply + def list_tuning_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tuning_jobs_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_tuning_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse.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_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest] + # 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_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_tuning_job_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_tuning_job", + 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 rebase_tuned_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest] + # 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 rebase_tuned_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rebase_tuned_model_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: "rebase_tuned_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest] + # 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_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tuningJobs", + body: "tuning_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTuningJobRequest] + # 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_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tuning_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest] + # 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_tuning_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/tuningJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest] + # 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_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rebase_tuned_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rebase_tuned_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tuningJobs:rebaseTunedModel", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb new file mode 100644 index 000000000000..afa42321305d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/index_endpoint_service/credentials" +require "google/cloud/ai_platform/v1/index_endpoint_service/paths" +require "google/cloud/ai_platform/v1/index_endpoint_service/operations" +require "google/cloud/ai_platform/v1/index_endpoint_service/client" +require "google/cloud/ai_platform/v1/index_endpoint_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's IndexEndpoints. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/index_endpoint_service" + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/index_endpoint_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.new + # + module IndexEndpointService + end + end + end + end +end + +helper_path = ::File.join __dir__, "index_endpoint_service", "helpers.rb" +require "google/cloud/ai_platform/v1/index_endpoint_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb new file mode 100644 index 000000000000..4a159505c4a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb @@ -0,0 +1,1252 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/index_endpoint_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + ## + # Client for the IndexEndpointService service. + # + # A service for managing Vertex AI's IndexEndpoints. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :index_endpoint_service_stub + + ## + # Configure the IndexEndpointService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IndexEndpointService clients + # ::Google::Cloud::AIPlatform::V1::IndexEndpointService::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 IndexEndpointService 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::IndexEndpointService::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 + @index_endpoint_service_stub.universe_domain + end + + ## + # Create a new IndexEndpointService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IndexEndpointService 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/index_endpoint_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 + + @index_endpoint_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::IndexEndpointService::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 + ) + + @index_endpoint_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 = @index_endpoint_service_stub.endpoint + config.universe_domain = @index_endpoint_service_stub.universe_domain + config.logger = @index_endpoint_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 = @index_endpoint_service_stub.endpoint + config.universe_domain = @index_endpoint_service_stub.universe_domain + config.logger = @index_endpoint_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpointService::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 + @index_endpoint_service_stub.logger + end + + # Service calls + + ## + # Creates an IndexEndpoint. + # + # @overload create_index_endpoint(request, options = nil) + # Pass arguments to `create_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest, ::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_index_endpoint(parent: nil, index_endpoint: nil) + # Pass arguments to `create_index_endpoint` 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 IndexEndpoint in. + # Format: `projects/{project}/locations/{location}` + # @param index_endpoint [::Google::Cloud::AIPlatform::V1::IndexEndpoint, ::Hash] + # Required. The IndexEndpoint 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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest.new + # + # # Call the create_index_endpoint method. + # result = client.create_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :create_index_endpoint, 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 an IndexEndpoint. + # + # @overload get_index_endpoint(request, options = nil) + # Pass arguments to `get_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest, ::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_index_endpoint(name: nil) + # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the IndexEndpoint resource. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest.new + # + # # Call the get_index_endpoint method. + # result = client.get_index_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + # p result + # + def get_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :get_index_endpoint, 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 IndexEndpoints in a Location. + # + # @overload list_index_endpoints(request, options = nil) + # Pass arguments to `list_index_endpoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest, ::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_index_endpoints(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_index_endpoints` 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 from which to list the + # IndexEndpoints. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `index_endpoint` supports = and !=. `index_endpoint` represents the + # IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#name resourcename}. + # * `display_name` supports =, != and regex() + # (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* or labels:key - key existence + # A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # * `index_endpoint="1"` + # * `display_name="myDisplayName"` + # * `regex(display_name, "^A") -> The display name starts with an A. + # * `labels.myKey="myValue"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse#next_page_token ListIndexEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#list_index_endpoints IndexEndpointService.ListIndexEndpoints} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::IndexEndpoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::IndexEndpoint>] + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest.new + # + # # Call the list_index_endpoints method. + # result = client.list_index_endpoints 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::IndexEndpoint. + # p item + # end + # + def list_index_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest + + # 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_index_endpoints.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_index_endpoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_index_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :list_index_endpoints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @index_endpoint_service_stub, :list_index_endpoints, 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 an IndexEndpoint. + # + # @overload update_index_endpoint(request, options = nil) + # Pass arguments to `update_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest, ::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_index_endpoint(index_endpoint: nil, update_mask: nil) + # Pass arguments to `update_index_endpoint` 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 index_endpoint [::Google::Cloud::AIPlatform::V1::IndexEndpoint, ::Hash] + # Required. The IndexEndpoint which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest.new + # + # # Call the update_index_endpoint method. + # result = client.update_index_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + # p result + # + def update_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest + + # 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_index_endpoint.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.index_endpoint&.name + header_params["index_endpoint.name"] = request.index_endpoint.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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :update_index_endpoint, 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 an IndexEndpoint. + # + # @overload delete_index_endpoint(request, options = nil) + # Pass arguments to `delete_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest, ::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_index_endpoint(name: nil) + # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the IndexEndpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest.new + # + # # Call the delete_index_endpoint method. + # result = client.delete_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :delete_index_endpoint, 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 + + ## + # Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + # it. + # Only non-empty Indexes can be deployed. + # + # @overload deploy_index(request, options = nil) + # Pass arguments to `deploy_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeployIndexRequest, ::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 deploy_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `deploy_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::AIPlatform::V1::DeployedIndex, ::Hash] + # Required. The DeployedIndex to be created within the IndexEndpoint. + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeployIndexRequest.new + # + # # Call the deploy_index method. + # result = client.deploy_index 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 deploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeployIndexRequest + + # 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.deploy_index.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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.deploy_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :deploy_index, 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 + + ## + # Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + # and freeing all resources it's using. + # + # @overload undeploy_index(request, options = nil) + # Pass arguments to `undeploy_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UndeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UndeployIndexRequest, ::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 undeploy_index(index_endpoint: nil, deployed_index_id: nil) + # Pass arguments to `undeploy_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource from which to undeploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # Required. The ID of the DeployedIndex to be undeployed from the + # IndexEndpoint. + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UndeployIndexRequest.new + # + # # Call the undeploy_index method. + # result = client.undeploy_index 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 undeploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UndeployIndexRequest + + # 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.undeploy_index.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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.undeploy_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :undeploy_index, 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 + + ## + # Update an existing DeployedIndex under an IndexEndpoint. + # + # @overload mutate_deployed_index(request, options = nil) + # Pass arguments to `mutate_deployed_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest, ::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 mutate_deployed_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `mutate_deployed_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::AIPlatform::V1::DeployedIndex, ::Hash] + # Required. The DeployedIndex to be updated within the IndexEndpoint. + # Currently, the updatable fields are + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#automatic_resources DeployedIndex.automatic_resources} + # and + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#dedicated_resources DeployedIndex.dedicated_resources} + # + # @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::IndexEndpointService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest.new + # + # # Call the mutate_deployed_index method. + # result = client.mutate_deployed_index 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 mutate_deployed_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest + + # 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.mutate_deployed_index.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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.mutate_deployed_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mutate_deployed_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.call_rpc :mutate_deployed_index, 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 IndexEndpointService API. + # + # This class represents the configuration for IndexEndpointService, + # 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::IndexEndpointService::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_index_endpoint to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index_endpoint.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index_endpoint.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the IndexEndpointService 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_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index_endpoint + ## + # RPC-specific configuration for `get_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index_endpoint + ## + # RPC-specific configuration for `list_index_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_index_endpoints + ## + # RPC-specific configuration for `update_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index_endpoint + ## + # RPC-specific configuration for `delete_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index_endpoint + ## + # RPC-specific configuration for `deploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_index + ## + # RPC-specific configuration for `undeploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_index + ## + # RPC-specific configuration for `mutate_deployed_index` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_deployed_index + + # @private + def initialize parent_rpcs = nil + create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint + @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config + get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint + @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config + list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints + @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config + update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint + @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config + delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint + @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config + deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index + @deploy_index = ::Gapic::Config::Method.new deploy_index_config + undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index + @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config + mutate_deployed_index_config = parent_rpcs.mutate_deployed_index if parent_rpcs.respond_to? :mutate_deployed_index + @mutate_deployed_index = ::Gapic::Config::Method.new mutate_deployed_index_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/credentials.rb new file mode 100644 index 000000000000..ccf952be2069 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + # Credentials for the IndexEndpointService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb new file mode 100644 index 000000000000..e1b0c2b61a0a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + # 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 IndexEndpointService 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 IndexEndpointService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/paths.rb new file mode 100644 index 000000000000..64d916bbbc9e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/paths.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + # Path helper methods for the IndexEndpointService API. + module Paths + ## + # Create a fully-qualified Index resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexes/{index}` + # + # @param project [String] + # @param location [String] + # @param index [String] + # + # @return [::String] + def index_path project:, location:, index: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexes/#{index}" + end + + ## + # Create a fully-qualified IndexEndpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @param project [String] + # @param location [String] + # @param index_endpoint [String] + # + # @return [::String] + def index_endpoint_path project:, location:, index_endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb new file mode 100644 index 000000000000..a83b254da1ec --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/index_endpoint_service/credentials" +require "google/cloud/ai_platform/v1/index_endpoint_service/paths" +require "google/cloud/ai_platform/v1/index_endpoint_service/rest/operations" +require "google/cloud/ai_platform/v1/index_endpoint_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's IndexEndpoints. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/index_endpoint_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.new + # + module IndexEndpointService + # 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/index_endpoint_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb new file mode 100644 index 000000000000..519adc48b686 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb @@ -0,0 +1,1179 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/index_endpoint_service_pb" +require "google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + module Rest + ## + # REST client for the IndexEndpointService service. + # + # A service for managing Vertex AI's IndexEndpoints. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :index_endpoint_service_stub + + ## + # Configure the IndexEndpointService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IndexEndpointService clients + # ::Google::Cloud::AIPlatform::V1::IndexEndpointService::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 IndexEndpointService 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::IndexEndpointService::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 + @index_endpoint_service_stub.universe_domain + end + + ## + # Create a new IndexEndpointService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IndexEndpointService 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::IndexEndpointService::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 + + @index_endpoint_service_stub = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @index_endpoint_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 = @index_endpoint_service_stub.endpoint + config.universe_domain = @index_endpoint_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @index_endpoint_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 = @index_endpoint_service_stub.endpoint + config.universe_domain = @index_endpoint_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @index_endpoint_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpointService::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 + @index_endpoint_service_stub.logger + end + + # Service calls + + ## + # Creates an IndexEndpoint. + # + # @overload create_index_endpoint(request, options = nil) + # Pass arguments to `create_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest, ::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_index_endpoint(parent: nil, index_endpoint: nil) + # Pass arguments to `create_index_endpoint` 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 IndexEndpoint in. + # Format: `projects/{project}/locations/{location}` + # @param index_endpoint [::Google::Cloud::AIPlatform::V1::IndexEndpoint, ::Hash] + # Required. The IndexEndpoint 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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest.new + # + # # Call the create_index_endpoint method. + # result = client.create_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.create_index_endpoint 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 an IndexEndpoint. + # + # @overload get_index_endpoint(request, options = nil) + # Pass arguments to `get_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest, ::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_index_endpoint(name: nil) + # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the IndexEndpoint resource. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest.new + # + # # Call the get_index_endpoint method. + # result = client.get_index_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + # p result + # + def get_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.get_index_endpoint 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 IndexEndpoints in a Location. + # + # @overload list_index_endpoints(request, options = nil) + # Pass arguments to `list_index_endpoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest, ::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_index_endpoints(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_index_endpoints` 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 from which to list the + # IndexEndpoints. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `index_endpoint` supports = and !=. `index_endpoint` represents the + # IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#name resourcename}. + # * `display_name` supports =, != and regex() + # (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* or labels:key - key existence + # A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # * `index_endpoint="1"` + # * `display_name="myDisplayName"` + # * `regex(display_name, "^A") -> The display name starts with an A. + # * `labels.myKey="myValue"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse#next_page_token ListIndexEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client#list_index_endpoints IndexEndpointService.ListIndexEndpoints} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::IndexEndpoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::IndexEndpoint>] + # + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest.new + # + # # Call the list_index_endpoints method. + # result = client.list_index_endpoints 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::IndexEndpoint. + # p item + # end + # + def list_index_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest + + # 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_index_endpoints.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_index_endpoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_index_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.list_index_endpoints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @index_endpoint_service_stub, :list_index_endpoints, "index_endpoints", 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 an IndexEndpoint. + # + # @overload update_index_endpoint(request, options = nil) + # Pass arguments to `update_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest, ::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_index_endpoint(index_endpoint: nil, update_mask: nil) + # Pass arguments to `update_index_endpoint` 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 index_endpoint [::Google::Cloud::AIPlatform::V1::IndexEndpoint, ::Hash] + # Required. The IndexEndpoint which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest.new + # + # # Call the update_index_endpoint method. + # result = client.update_index_endpoint request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + # p result + # + def update_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.update_index_endpoint 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 an IndexEndpoint. + # + # @overload delete_index_endpoint(request, options = nil) + # Pass arguments to `delete_index_endpoint` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest, ::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_index_endpoint(name: nil) + # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the IndexEndpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest.new + # + # # Call the delete_index_endpoint method. + # result = client.delete_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest + + # 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_index_endpoint.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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.delete_index_endpoint 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 + + ## + # Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + # it. + # Only non-empty Indexes can be deployed. + # + # @overload deploy_index(request, options = nil) + # Pass arguments to `deploy_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeployIndexRequest, ::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 deploy_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `deploy_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::AIPlatform::V1::DeployedIndex, ::Hash] + # Required. The DeployedIndex to be created within the IndexEndpoint. + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeployIndexRequest.new + # + # # Call the deploy_index method. + # result = client.deploy_index 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 deploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeployIndexRequest + + # 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.deploy_index.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.deploy_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.deploy_index 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 + + ## + # Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + # and freeing all resources it's using. + # + # @overload undeploy_index(request, options = nil) + # Pass arguments to `undeploy_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UndeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UndeployIndexRequest, ::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 undeploy_index(index_endpoint: nil, deployed_index_id: nil) + # Pass arguments to `undeploy_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource from which to undeploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # Required. The ID of the DeployedIndex to be undeployed from the + # IndexEndpoint. + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UndeployIndexRequest.new + # + # # Call the undeploy_index method. + # result = client.undeploy_index 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 undeploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UndeployIndexRequest + + # 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.undeploy_index.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.undeploy_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.undeploy_index 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 + + ## + # Update an existing DeployedIndex under an IndexEndpoint. + # + # @overload mutate_deployed_index(request, options = nil) + # Pass arguments to `mutate_deployed_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest, ::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 mutate_deployed_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `mutate_deployed_index` 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 index_endpoint [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::AIPlatform::V1::DeployedIndex, ::Hash] + # Required. The DeployedIndex to be updated within the IndexEndpoint. + # Currently, the updatable fields are + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#automatic_resources DeployedIndex.automatic_resources} + # and + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#dedicated_resources DeployedIndex.dedicated_resources} + # @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::IndexEndpointService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest.new + # + # # Call the mutate_deployed_index method. + # result = client.mutate_deployed_index 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 mutate_deployed_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest + + # 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.mutate_deployed_index.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.mutate_deployed_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mutate_deployed_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_endpoint_service_stub.mutate_deployed_index 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 IndexEndpointService REST API. + # + # This class represents the configuration for IndexEndpointService 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::IndexEndpointService::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_index_endpoint to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index_endpoint.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index_endpoint.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the IndexEndpointService 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_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index_endpoint + ## + # RPC-specific configuration for `get_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index_endpoint + ## + # RPC-specific configuration for `list_index_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_index_endpoints + ## + # RPC-specific configuration for `update_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index_endpoint + ## + # RPC-specific configuration for `delete_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index_endpoint + ## + # RPC-specific configuration for `deploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_index + ## + # RPC-specific configuration for `undeploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_index + ## + # RPC-specific configuration for `mutate_deployed_index` + # @return [::Gapic::Config::Method] + # + attr_reader :mutate_deployed_index + + # @private + def initialize parent_rpcs = nil + create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint + @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config + get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint + @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config + list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints + @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config + update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint + @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config + delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint + @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config + deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index + @deploy_index = ::Gapic::Config::Method.new deploy_index_config + undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index + @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config + mutate_deployed_index_config = parent_rpcs.mutate_deployed_index if parent_rpcs.respond_to? :mutate_deployed_index + @mutate_deployed_index = ::Gapic::Config::Method.new mutate_deployed_index_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb new file mode 100644 index 000000000000..349ad9ae8813 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + 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 IndexEndpointService 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 IndexEndpointService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb new file mode 100644 index 000000000000..2622bca6fa50 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/index_endpoint_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + module Rest + ## + # REST service stub for the IndexEndpointService 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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest] + # 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_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_index_endpoint_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_index_endpoint", + 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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest] + # 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::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # A result object deserialized from the server's reply + def get_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_index_endpoint_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_index_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::IndexEndpoint.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_index_endpoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest] + # 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::ListIndexEndpointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse] + # A result object deserialized from the server's reply + def list_index_endpoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_index_endpoints_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_index_endpoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse.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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest] + # 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::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # A result object deserialized from the server's reply + def update_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_index_endpoint_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_index_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::IndexEndpoint.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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest] + # 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_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_endpoint_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_index_endpoint", + 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 deploy_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeployIndexRequest] + # 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 deploy_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_index_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: "deploy_index", + 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 undeploy_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UndeployIndexRequest] + # 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 undeploy_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_index_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: "undeploy_index", + 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 mutate_deployed_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest] + # 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 mutate_deployed_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mutate_deployed_index_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: "mutate_deployed_index", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/indexEndpoints", + body: "index_endpoint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_index_endpoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest] + # 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_index_endpoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/indexEndpoints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{index_endpoint.name}", + body: "index_endpoint", + matches: [ + ["index_endpoint.name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeployIndexRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:deployIndex", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UndeployIndexRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:undeployIndex", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mutate_deployed_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mutate_deployed_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:mutateDeployedIndex", + body: "deployed_index", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service.rb new file mode 100644 index 000000000000..77d293d8883d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/index_service/credentials" +require "google/cloud/ai_platform/v1/index_service/paths" +require "google/cloud/ai_platform/v1/index_service/operations" +require "google/cloud/ai_platform/v1/index_service/client" +require "google/cloud/ai_platform/v1/index_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's Index resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/index_service" + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/index_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new + # + module IndexService + end + end + end + end +end + +helper_path = ::File.join __dir__, "index_service", "helpers.rb" +require "google/cloud/ai_platform/v1/index_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/client.rb new file mode 100644 index 000000000000..5f5b86580419 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/client.rb @@ -0,0 +1,1125 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/index_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + ## + # Client for the IndexService service. + # + # A service for creating and managing Vertex AI's Index resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :index_service_stub + + ## + # Configure the IndexService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::IndexService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IndexService clients + # ::Google::Cloud::AIPlatform::V1::IndexService::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 IndexService 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::IndexService::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 + @index_service_stub.universe_domain + end + + ## + # Create a new IndexService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IndexService 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/index_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 + + @index_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::IndexService::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 + ) + + @index_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 = @index_service_stub.endpoint + config.universe_domain = @index_service_stub.universe_domain + config.logger = @index_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 = @index_service_stub.endpoint + config.universe_domain = @index_service_stub.universe_domain + config.logger = @index_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::IndexService::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 + @index_service_stub.logger + end + + # Service calls + + ## + # Creates an Index. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) + # Pass arguments to `create_index` 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 Index in. + # Format: `projects/{project}/locations/{location}` + # @param index [::Google::Cloud::AIPlatform::V1::Index, ::Hash] + # Required. The Index 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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateIndexRequest + + # 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_index.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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :create_index, 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 an Index. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetIndexRequest, ::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_index(name: nil) + # Pass arguments to `get_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Index resource. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Index] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Index] + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetIndexRequest + + # 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_index.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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :get_index, 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 Indexes in a Location. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_indexes` 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 from which to list the Indexes. + # Format: `projects/{project}/locations/{location}` + # @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. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexesResponse#next_page_token ListIndexesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#list_indexes IndexService.ListIndexes} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>] + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListIndexesRequest + + # 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_indexes.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_indexes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :list_indexes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @index_service_stub, :list_indexes, 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 an Index. + # + # @overload update_index(request, options = nil) + # Pass arguments to `update_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateIndexRequest, ::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_index(index: nil, update_mask: nil) + # Pass arguments to `update_index` 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 index [::Google::Cloud::AIPlatform::V1::Index, ::Hash] + # Required. The Index which updates the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateIndexRequest.new + # + # # Call the update_index method. + # result = client.update_index request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateIndexRequest + + # 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_index.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.index&.name + header_params["index.name"] = request.index.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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :update_index, 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 an Index. + # An Index can only be deleted when all its + # {::Google::Cloud::AIPlatform::V1::Index#deployed_indexes DeployedIndexes} had + # been undeployed. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteIndexRequest, ::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_index(name: nil) + # Pass arguments to `delete_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Index resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteIndexRequest + + # 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_index.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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :delete_index, 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 + + ## + # Add/update Datapoints into an Index. + # + # @overload upsert_datapoints(request, options = nil) + # Pass arguments to `upsert_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest, ::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 upsert_datapoints(index: nil, datapoints: nil, update_mask: nil) + # Pass arguments to `upsert_datapoints` 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 index [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @param datapoints [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint, ::Hash>] + # A list of datapoints to be created/updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Update mask is used to specify the fields to be overwritten in + # the datapoints by the update. The fields specified in the update_mask are + # relative to each IndexDatapoint inside datapoints, not the full request. + # + # Updatable fields: + # + # * Use `all_restricts` to update both restricts and numeric_restricts. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse] + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest.new + # + # # Call the upsert_datapoints method. + # result = client.upsert_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse. + # p result + # + def upsert_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest + + # 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.upsert_datapoints.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.index + header_params["index"] = request.index + 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.upsert_datapoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upsert_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :upsert_datapoints, 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 + + ## + # Remove Datapoints from an Index. + # + # @overload remove_datapoints(request, options = nil) + # Pass arguments to `remove_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest, ::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 remove_datapoints(index: nil, datapoint_ids: nil) + # Pass arguments to `remove_datapoints` 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 index [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @param datapoint_ids [::Array<::String>] + # A list of datapoint ids to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse] + # + # @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::IndexService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest.new + # + # # Call the remove_datapoints method. + # result = client.remove_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse. + # p result + # + def remove_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest + + # 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.remove_datapoints.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.index + header_params["index"] = request.index + 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.remove_datapoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.call_rpc :remove_datapoints, 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 IndexService API. + # + # This class represents the configuration for IndexService, + # 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::IndexService::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_index to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::IndexService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the IndexService 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_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `update_index` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `upsert_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :upsert_datapoints + ## + # RPC-specific configuration for `remove_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_datapoints + + # @private + def initialize parent_rpcs = nil + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index + @update_index = ::Gapic::Config::Method.new update_index_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + upsert_datapoints_config = parent_rpcs.upsert_datapoints if parent_rpcs.respond_to? :upsert_datapoints + @upsert_datapoints = ::Gapic::Config::Method.new upsert_datapoints_config + remove_datapoints_config = parent_rpcs.remove_datapoints if parent_rpcs.respond_to? :remove_datapoints + @remove_datapoints = ::Gapic::Config::Method.new remove_datapoints_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/credentials.rb new file mode 100644 index 000000000000..ae13adbddc9d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + # Credentials for the IndexService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/operations.rb new file mode 100644 index 000000000000..6761c6ab1e2f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + # 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 IndexService 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 IndexService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/paths.rb new file mode 100644 index 000000000000..6926d7a809aa --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + # Path helper methods for the IndexService API. + module Paths + ## + # Create a fully-qualified Index resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexes/{index}` + # + # @param project [String] + # @param location [String] + # @param index [String] + # + # @return [::String] + def index_path project:, location:, index: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexes/#{index}" + end + + ## + # Create a fully-qualified IndexEndpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @param project [String] + # @param location [String] + # @param index_endpoint [String] + # + # @return [::String] + def index_endpoint_path project:, location:, index_endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest.rb new file mode 100644 index 000000000000..8553707a9520 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/index_service/credentials" +require "google/cloud/ai_platform/v1/index_service/paths" +require "google/cloud/ai_platform/v1/index_service/rest/operations" +require "google/cloud/ai_platform/v1/index_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's Index resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/index_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new + # + module IndexService + # 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/index_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb new file mode 100644 index 000000000000..671137773587 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb @@ -0,0 +1,1059 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/index_service_pb" +require "google/cloud/ai_platform/v1/index_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + module Rest + ## + # REST client for the IndexService service. + # + # A service for creating and managing Vertex AI's Index resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :index_service_stub + + ## + # Configure the IndexService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IndexService clients + # ::Google::Cloud::AIPlatform::V1::IndexService::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 IndexService 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::IndexService::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 + @index_service_stub.universe_domain + end + + ## + # Create a new IndexService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IndexService 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::IndexService::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 + + @index_service_stub = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @index_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 = @index_service_stub.endpoint + config.universe_domain = @index_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @index_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 = @index_service_stub.endpoint + config.universe_domain = @index_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @index_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::IndexService::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 + @index_service_stub.logger + end + + # Service calls + + ## + # Creates an Index. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) + # Pass arguments to `create_index` 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 Index in. + # Format: `projects/{project}/locations/{location}` + # @param index [::Google::Cloud::AIPlatform::V1::Index, ::Hash] + # Required. The Index 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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateIndexRequest + + # 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_index.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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.create_index 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 an Index. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetIndexRequest, ::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_index(name: nil) + # Pass arguments to `get_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Index resource. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Index] + # + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetIndexRequest + + # 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_index.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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.get_index 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 Indexes in a Location. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_indexes` 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 from which to list the Indexes. + # Format: `projects/{project}/locations/{location}` + # @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. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexesResponse#next_page_token ListIndexesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client#list_indexes IndexService.ListIndexes} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Index>] + # + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListIndexesRequest + + # 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_indexes.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_indexes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.list_indexes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @index_service_stub, :list_indexes, "indexes", 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 an Index. + # + # @overload update_index(request, options = nil) + # Pass arguments to `update_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateIndexRequest, ::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_index(index: nil, update_mask: nil) + # Pass arguments to `update_index` 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 index [::Google::Cloud::AIPlatform::V1::Index, ::Hash] + # Required. The Index which updates the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateIndexRequest.new + # + # # Call the update_index method. + # result = client.update_index request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateIndexRequest + + # 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_index.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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.update_index 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 an Index. + # An Index can only be deleted when all its + # {::Google::Cloud::AIPlatform::V1::Index#deployed_indexes DeployedIndexes} had + # been undeployed. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteIndexRequest, ::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_index(name: nil) + # Pass arguments to `delete_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Index resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteIndexRequest + + # 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_index.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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.delete_index 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 + + ## + # Add/update Datapoints into an Index. + # + # @overload upsert_datapoints(request, options = nil) + # Pass arguments to `upsert_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest, ::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 upsert_datapoints(index: nil, datapoints: nil, update_mask: nil) + # Pass arguments to `upsert_datapoints` 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 index [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @param datapoints [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint, ::Hash>] + # A list of datapoints to be created/updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Update mask is used to specify the fields to be overwritten in + # the datapoints by the update. The fields specified in the update_mask are + # relative to each IndexDatapoint inside datapoints, not the full request. + # + # Updatable fields: + # + # * Use `all_restricts` to update both restricts and numeric_restricts. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse] + # + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest.new + # + # # Call the upsert_datapoints method. + # result = client.upsert_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse. + # p result + # + def upsert_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest + + # 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.upsert_datapoints.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.upsert_datapoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upsert_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.upsert_datapoints 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 + + ## + # Remove Datapoints from an Index. + # + # @overload remove_datapoints(request, options = nil) + # Pass arguments to `remove_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest, ::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 remove_datapoints(index: nil, datapoint_ids: nil) + # Pass arguments to `remove_datapoints` 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 index [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @param datapoint_ids [::Array<::String>] + # A list of datapoint ids to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse] + # + # @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::IndexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest.new + # + # # Call the remove_datapoints method. + # result = client.remove_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse. + # p result + # + def remove_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest + + # 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.remove_datapoints.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.remove_datapoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @index_service_stub.remove_datapoints 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 IndexService REST API. + # + # This class represents the configuration for IndexService 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::IndexService::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_index to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::IndexService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the IndexService 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_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `update_index` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `upsert_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :upsert_datapoints + ## + # RPC-specific configuration for `remove_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_datapoints + + # @private + def initialize parent_rpcs = nil + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index + @update_index = ::Gapic::Config::Method.new update_index_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + upsert_datapoints_config = parent_rpcs.upsert_datapoints if parent_rpcs.respond_to? :upsert_datapoints + @upsert_datapoints = ::Gapic::Config::Method.new upsert_datapoints_config + remove_datapoints_config = parent_rpcs.remove_datapoints if parent_rpcs.respond_to? :remove_datapoints + @remove_datapoints = ::Gapic::Config::Method.new remove_datapoints_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb new file mode 100644 index 000000000000..8693f05bb70e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + 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 IndexService 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 IndexService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb new file mode 100644 index 000000000000..474052f970f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/index_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + module Rest + ## + # REST service stub for the IndexService 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_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_index_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_index", + 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_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetIndexRequest] + # 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::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Index] + # A result object deserialized from the server's reply + def get_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_index_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_index", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Index.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_indexes REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListIndexesRequest] + # 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::ListIndexesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListIndexesResponse] + # A result object deserialized from the server's reply + def list_indexes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_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_indexes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListIndexesResponse.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_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateIndexRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_index_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_index", + 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_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_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_index", + 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 upsert_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest] + # 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::UpsertDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse] + # A result object deserialized from the server's reply + def upsert_datapoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upsert_datapoints_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: "upsert_datapoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest] + # 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::RemoveDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse] + # A result object deserialized from the server's reply + def remove_datapoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_datapoints_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: "remove_datapoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse.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_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/indexes", + body: "index", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_indexes REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListIndexesRequest] + # 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_indexes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/indexes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{index.name}", + body: "index", + matches: [ + ["index.name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_index REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upsert_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upsert_datapoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index}:upsertDatapoints", + body: "*", + matches: [ + ["index", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_datapoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index}:removeDatapoints", + body: "*", + matches: [ + ["index", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service.rb new file mode 100644 index 000000000000..cbc4d056b7c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/job_service/credentials" +require "google/cloud/ai_platform/v1/job_service/paths" +require "google/cloud/ai_platform/v1/job_service/operations" +require "google/cloud/ai_platform/v1/job_service/client" +require "google/cloud/ai_platform/v1/job_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/job_service" + # client = ::Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/job_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + module JobService + end + end + end + end +end + +helper_path = ::File.join __dir__, "job_service", "helpers.rb" +require "google/cloud/ai_platform/v1/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/client.rb new file mode 100644 index 000000000000..4ecde56cd8ef --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/client.rb @@ -0,0 +1,4111 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/job_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + ## + # Client for the JobService service. + # + # A service for creating and managing Vertex AI's jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::JobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::AIPlatform::V1::JobService::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 JobService 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::JobService::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 + @job_service_stub.universe_domain + end + + ## + # Create a new JobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::JobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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/job_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 + + @job_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::JobService::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 + ) + + @job_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 = @job_service_stub.endpoint + config.universe_domain = @job_service_stub.universe_domain + config.logger = @job_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 = @job_service_stub.endpoint + config.universe_domain = @job_service_stub.universe_domain + config.logger = @job_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::JobService::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 + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a CustomJob. A created CustomJob right away + # will be attempted to be run. + # + # @overload create_custom_job(request, options = nil) + # Pass arguments to `create_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest, ::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_custom_job(parent: nil, custom_job: nil) + # Pass arguments to `create_custom_job` 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 CustomJob in. + # Format: `projects/{project}/locations/{location}` + # @param custom_job [::Google::Cloud::AIPlatform::V1::CustomJob, ::Hash] + # Required. The CustomJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CustomJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateCustomJobRequest.new + # + # # Call the create_custom_job method. + # result = client.create_custom_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + # p result + # + def create_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_custom_job, 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 + + ## + # Gets a CustomJob. + # + # @overload get_custom_job(request, options = nil) + # Pass arguments to `get_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `get_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob resource. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CustomJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetCustomJobRequest.new + # + # # Call the get_custom_job method. + # result = client.get_custom_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + # p result + # + def get_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_custom_job, 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 CustomJobs in a Location. + # + # @overload list_custom_jobs(request, options = nil) + # Pass arguments to `list_custom_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest, ::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_custom_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_custom_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the CustomJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse#next_page_token ListCustomJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_custom_jobs JobService.ListCustomJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListCustomJobsRequest.new + # + # # Call the list_custom_jobs method. + # result = client.list_custom_jobs 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::CustomJob. + # p item + # end + # + def list_custom_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest + + # 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_custom_jobs.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_custom_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_custom_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_custom_jobs, 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 + + ## + # Deletes a CustomJob. + # + # @overload delete_custom_job(request, options = nil) + # Pass arguments to `delete_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `delete_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest.new + # + # # Call the delete_custom_job method. + # result = client.delete_custom_job 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_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_custom_job, 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 + + ## + # Cancels a CustomJob. + # Starts asynchronous cancellation on the CustomJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_custom_job JobService.GetCustomJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the CustomJob is not deleted; instead it becomes a job with + # a {::Google::Cloud::AIPlatform::V1::CustomJob#error CustomJob.error} value with + # a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::CustomJob#state CustomJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_custom_job(request, options = nil) + # Pass arguments to `cancel_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `cancel_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob to cancel. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelCustomJobRequest.new + # + # # Call the cancel_custom_job method. + # result = client.cancel_custom_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :cancel_custom_job, 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 + + ## + # Creates a DataLabelingJob. + # + # @overload create_data_labeling_job(request, options = nil) + # Pass arguments to `create_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest, ::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_data_labeling_job(parent: nil, data_labeling_job: nil) + # Pass arguments to `create_data_labeling_job` 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 parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @param data_labeling_job [::Google::Cloud::AIPlatform::V1::DataLabelingJob, ::Hash] + # Required. The DataLabelingJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest.new + # + # # Call the create_data_labeling_job method. + # result = client.create_data_labeling_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + # p result + # + def create_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_data_labeling_job, 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 + + ## + # Gets a DataLabelingJob. + # + # @overload get_data_labeling_job(request, options = nil) + # Pass arguments to `get_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `get_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest.new + # + # # Call the get_data_labeling_job method. + # result = client.get_data_labeling_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + # p result + # + def get_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_data_labeling_job, 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 DataLabelingJobs in a Location. + # + # @overload list_data_labeling_jobs(request, options = nil) + # Pass arguments to `list_data_labeling_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest, ::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_data_labeling_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_data_labeling_jobs` 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 parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. FieldMask represents a set of + # symbolic field paths. For example, the mask can be `paths: "name"`. The + # "name" here is a field in DataLabelingJob. + # If this field is not set, all fields of the DataLabelingJob are returned. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order by + # default. + # Use `desc` after a field name for descending. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest.new + # + # # Call the list_data_labeling_jobs method. + # result = client.list_data_labeling_jobs 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::DataLabelingJob. + # p item + # end + # + def list_data_labeling_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest + + # 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_data_labeling_jobs.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_data_labeling_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_labeling_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_data_labeling_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_data_labeling_jobs, 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 + + ## + # Deletes a DataLabelingJob. + # + # @overload delete_data_labeling_job(request, options = nil) + # Pass arguments to `delete_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `delete_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob to be deleted. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest.new + # + # # Call the delete_data_labeling_job method. + # result = client.delete_data_labeling_job 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_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_data_labeling_job, 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 + + ## + # Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + # + # @overload cancel_data_labeling_job(request, options = nil) + # Pass arguments to `cancel_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `cancel_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest.new + # + # # Call the cancel_data_labeling_job method. + # result = client.cancel_data_labeling_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :cancel_data_labeling_job, 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 + + ## + # Creates a HyperparameterTuningJob + # + # @overload create_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `create_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(parent: nil, hyperparameter_tuning_job: nil) + # Pass arguments to `create_hyperparameter_tuning_job` 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 + # HyperparameterTuningJob in. Format: + # `projects/{project}/locations/{location}` + # @param hyperparameter_tuning_job [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob, ::Hash] + # Required. The HyperparameterTuningJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest.new + # + # # Call the create_hyperparameter_tuning_job method. + # result = client.create_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + # p result + # + def create_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_hyperparameter_tuning_job, 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 + + ## + # Gets a HyperparameterTuningJob + # + # @overload get_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `get_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `get_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob resource. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest.new + # + # # Call the get_hyperparameter_tuning_job method. + # result = client.get_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + # p result + # + def get_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_hyperparameter_tuning_job, 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 HyperparameterTuningJobs in a Location. + # + # @overload list_hyperparameter_tuning_jobs(request, options = nil) + # Pass arguments to `list_hyperparameter_tuning_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest, ::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_hyperparameter_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_hyperparameter_tuning_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the + # HyperparameterTuningJobs from. Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse#next_page_token ListHyperparameterTuningJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_hyperparameter_tuning_jobs JobService.ListHyperparameterTuningJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest.new + # + # # Call the list_hyperparameter_tuning_jobs method. + # result = client.list_hyperparameter_tuning_jobs 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::HyperparameterTuningJob. + # p item + # end + # + def list_hyperparameter_tuning_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest + + # 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_hyperparameter_tuning_jobs.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_hyperparameter_tuning_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_hyperparameter_tuning_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_hyperparameter_tuning_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_hyperparameter_tuning_jobs, 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 + + ## + # Deletes a HyperparameterTuningJob. + # + # @overload delete_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `delete_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `delete_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest.new + # + # # Call the delete_hyperparameter_tuning_job method. + # result = client.delete_hyperparameter_tuning_job 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_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_hyperparameter_tuning_job, 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 + + ## + # Cancels a HyperparameterTuningJob. + # Starts asynchronous cancellation on the HyperparameterTuningJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_hyperparameter_tuning_job JobService.GetHyperparameterTuningJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the HyperparameterTuningJob is not deleted; instead it becomes a job with + # a + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#error HyperparameterTuningJob.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#state HyperparameterTuningJob.state} + # is set to `CANCELLED`. + # + # @overload cancel_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `cancel_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `cancel_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob to cancel. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest.new + # + # # Call the cancel_hyperparameter_tuning_job method. + # result = client.cancel_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :cancel_hyperparameter_tuning_job, 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 + + ## + # Creates a NasJob + # + # @overload create_nas_job(request, options = nil) + # Pass arguments to `create_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNasJobRequest, ::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_nas_job(parent: nil, nas_job: nil) + # Pass arguments to `create_nas_job` 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 NasJob in. + # Format: `projects/{project}/locations/{location}` + # @param nas_job [::Google::Cloud::AIPlatform::V1::NasJob, ::Hash] + # Required. The NasJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NasJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNasJobRequest.new + # + # # Call the create_nas_job method. + # result = client.create_nas_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasJob. + # p result + # + def create_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_nas_job, 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 + + ## + # Gets a NasJob + # + # @overload get_nas_job(request, options = nil) + # Pass arguments to `get_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `get_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NasJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNasJobRequest.new + # + # # Call the get_nas_job method. + # result = client.get_nas_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasJob. + # p result + # + def get_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_nas_job, 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 NasJobs in a Location. + # + # @overload list_nas_jobs(request, options = nil) + # Pass arguments to `list_nas_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNasJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNasJobsRequest, ::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_nas_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_nas_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the NasJobs + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasJobsResponse#next_page_token ListNasJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_jobs JobService.ListNasJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNasJobsRequest.new + # + # # Call the list_nas_jobs method. + # result = client.list_nas_jobs 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::NasJob. + # p item + # end + # + def list_nas_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNasJobsRequest + + # 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_nas_jobs.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_nas_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_nas_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_nas_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_nas_jobs, 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 + + ## + # Deletes a NasJob. + # + # @overload delete_nas_job(request, options = nil) + # Pass arguments to `delete_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `delete_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNasJobRequest.new + # + # # Call the delete_nas_job method. + # result = client.delete_nas_job 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_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_nas_job, 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 + + ## + # Cancels a NasJob. + # Starts asynchronous cancellation on the NasJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_nas_job JobService.GetNasJob} or + # other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the NasJob is not deleted; instead it becomes a job with + # a {::Google::Cloud::AIPlatform::V1::NasJob#error NasJob.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::NasJob#state NasJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_nas_job(request, options = nil) + # Pass arguments to `cancel_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `cancel_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob to cancel. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelNasJobRequest.new + # + # # Call the cancel_nas_job method. + # result = client.cancel_nas_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :cancel_nas_job, 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 + + ## + # Gets a NasTrialDetail. + # + # @overload get_nas_trial_detail(request, options = nil) + # Pass arguments to `get_nas_trial_detail` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest, ::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_nas_trial_detail(name: nil) + # Pass arguments to `get_nas_trial_detail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasTrialDetail resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NasTrialDetail] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasTrialDetail] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest.new + # + # # Call the get_nas_trial_detail method. + # result = client.get_nas_trial_detail request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasTrialDetail. + # p result + # + def get_nas_trial_detail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest + + # 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_nas_trial_detail.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_nas_trial_detail.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_nas_trial_detail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_nas_trial_detail, 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 + + ## + # List top NasTrialDetails of a NasJob. + # + # @overload list_nas_trial_details(request, options = nil) + # Pass arguments to `list_nas_trial_details` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest, ::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_nas_trial_details(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_nas_trial_details` 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 name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse#next_page_token ListNasTrialDetailsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_trial_details JobService.ListNasTrialDetails} + # call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasTrialDetail>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasTrialDetail>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest.new + # + # # Call the list_nas_trial_details method. + # result = client.list_nas_trial_details 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::NasTrialDetail. + # p item + # end + # + def list_nas_trial_details request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest + + # 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_nas_trial_details.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_nas_trial_details.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_nas_trial_details.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_nas_trial_details, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_nas_trial_details, 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 + + ## + # Creates a BatchPredictionJob. A BatchPredictionJob once created will + # right away be attempted to start. + # + # @overload create_batch_prediction_job(request, options = nil) + # Pass arguments to `create_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest, ::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_batch_prediction_job(parent: nil, batch_prediction_job: nil) + # Pass arguments to `create_batch_prediction_job` 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 + # BatchPredictionJob in. Format: `projects/{project}/locations/{location}` + # @param batch_prediction_job [::Google::Cloud::AIPlatform::V1::BatchPredictionJob, ::Hash] + # Required. The BatchPredictionJob to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest.new + # + # # Call the create_batch_prediction_job method. + # result = client.create_batch_prediction_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + # p result + # + def create_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_batch_prediction_job, 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 + + ## + # Gets a BatchPredictionJob + # + # @overload get_batch_prediction_job(request, options = nil) + # Pass arguments to `get_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `get_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob resource. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest.new + # + # # Call the get_batch_prediction_job method. + # result = client.get_batch_prediction_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + # p result + # + def get_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_batch_prediction_job, 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 BatchPredictionJobs in a Location. + # + # @overload list_batch_prediction_jobs(request, options = nil) + # Pass arguments to `list_batch_prediction_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest, ::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_batch_prediction_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_batch_prediction_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the BatchPredictionJobs + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `model_display_name` supports `=`, `!=` comparisons. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse#next_page_token ListBatchPredictionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_batch_prediction_jobs JobService.ListBatchPredictionJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest.new + # + # # Call the list_batch_prediction_jobs method. + # result = client.list_batch_prediction_jobs 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::BatchPredictionJob. + # p item + # end + # + def list_batch_prediction_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest + + # 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_batch_prediction_jobs.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_batch_prediction_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_batch_prediction_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_batch_prediction_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_batch_prediction_jobs, 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 + + ## + # Deletes a BatchPredictionJob. Can only be called on jobs that already + # finished. + # + # @overload delete_batch_prediction_job(request, options = nil) + # Pass arguments to `delete_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `delete_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest.new + # + # # Call the delete_batch_prediction_job method. + # result = client.delete_batch_prediction_job 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_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_batch_prediction_job, 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 + + ## + # Cancels a BatchPredictionJob. + # + # Starts asynchronous cancellation on the BatchPredictionJob. The server + # makes the best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_batch_prediction_job JobService.GetBatchPredictionJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On a successful cancellation, + # the BatchPredictionJob is not deleted;instead its + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#state BatchPredictionJob.state} + # is set to `CANCELLED`. Any files already outputted by the job are not + # deleted. + # + # @overload cancel_batch_prediction_job(request, options = nil) + # Pass arguments to `cancel_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `cancel_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob to cancel. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest.new + # + # # Call the cancel_batch_prediction_job method. + # result = client.cancel_batch_prediction_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :cancel_batch_prediction_job, 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 + + ## + # Creates a ModelDeploymentMonitoringJob. It will run periodically on a + # configured interval. + # + # @overload create_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `create_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(parent: nil, model_deployment_monitoring_job: nil) + # Pass arguments to `create_model_deployment_monitoring_job` 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 parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @param model_deployment_monitoring_job [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob, ::Hash] + # Required. The ModelDeploymentMonitoringJob to create + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest.new + # + # # Call the create_model_deployment_monitoring_job method. + # result = client.create_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + # p result + # + def create_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_model_deployment_monitoring_job, 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 + + ## + # Searches Model Monitoring Statistics generated within a given time window. + # + # @overload search_model_deployment_monitoring_stats_anomalies(request, options = nil) + # Pass arguments to `search_model_deployment_monitoring_stats_anomalies` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest, ::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 search_model_deployment_monitoring_stats_anomalies(model_deployment_monitoring_job: nil, deployed_model_id: nil, feature_display_name: nil, objectives: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil) + # Pass arguments to `search_model_deployment_monitoring_stats_anomalies` 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 model_deployment_monitoring_job [::String] + # Required. ModelDeploymentMonitoring Job resource name. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @param deployed_model_id [::String] + # Required. The DeployedModel ID of the + # [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + # @param feature_display_name [::String] + # The feature display name. If specified, only return the stats belonging to + # this feature. Format: + # {::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies#feature_display_name ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + # example: "user_destination". + # @param objectives [::Array<::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest::StatsAnomaliesObjective, ::Hash>] + # Required. Objectives of the stats to retrieve. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies} + # call. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The earliest timestamp of stats being generated. + # If not set, indicates fetching stats till the earliest possible one. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # The latest timestamp of stats being generated. + # If not set, indicates feching stats till the latest possible one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest.new + # + # # Call the search_model_deployment_monitoring_stats_anomalies method. + # result = client.search_model_deployment_monitoring_stats_anomalies 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::ModelMonitoringStatsAnomalies. + # p item + # end + # + def search_model_deployment_monitoring_stats_anomalies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest + + # 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.search_model_deployment_monitoring_stats_anomalies.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.model_deployment_monitoring_job + header_params["model_deployment_monitoring_job"] = request.model_deployment_monitoring_job + 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.search_model_deployment_monitoring_stats_anomalies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_model_deployment_monitoring_stats_anomalies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_model_deployment_monitoring_stats_anomalies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :search_model_deployment_monitoring_stats_anomalies, 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 + + ## + # Gets a ModelDeploymentMonitoringJob. + # + # @overload get_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `get_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(name: nil) + # Pass arguments to `get_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest.new + # + # # Call the get_model_deployment_monitoring_job method. + # result = client.get_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + # p result + # + def get_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_model_deployment_monitoring_job, 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 ModelDeploymentMonitoringJobs in a Location. + # + # @overload list_model_deployment_monitoring_jobs(request, options = nil) + # Pass arguments to `list_model_deployment_monitoring_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest, ::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_model_deployment_monitoring_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_deployment_monitoring_jobs` 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 parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>] + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest.new + # + # # Call the list_model_deployment_monitoring_jobs method. + # result = client.list_model_deployment_monitoring_jobs 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::ModelDeploymentMonitoringJob. + # p item + # end + # + def list_model_deployment_monitoring_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest + + # 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_model_deployment_monitoring_jobs.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_model_deployment_monitoring_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_model_deployment_monitoring_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_model_deployment_monitoring_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_model_deployment_monitoring_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a ModelDeploymentMonitoringJob. + # + # @overload update_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `update_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(model_deployment_monitoring_job: nil, update_mask: nil) + # Pass arguments to `update_model_deployment_monitoring_job` 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 model_deployment_monitoring_job [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob, ::Hash] + # Required. The model monitoring configuration which replaces the resource on + # the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask is used to specify the fields to be overwritten + # in the ModelDeploymentMonitoringJob resource by the update. The fields + # specified in the update_mask are relative to the resource, not the full + # request. A field will be overwritten if it is in the mask. If the user does + # not provide a mask then only the non-empty fields present in the request + # will be overwritten. Set the update_mask to `*` to override all fields. For + # the objective config, the user can either provide the update mask for + # model_deployment_monitoring_objective_configs or any combination of its + # nested fields, such as: + # model_deployment_monitoring_objective_configs.objective_config.training_dataset. + # + # Updatable fields: + # + # * `display_name` + # * `model_deployment_monitoring_schedule_config` + # * `model_monitoring_alert_config` + # * `logging_sampling_strategy` + # * `labels` + # * `log_ttl` + # * `enable_monitoring_pipeline_logs` + # . and + # * `model_deployment_monitoring_objective_configs` + # . or + # * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + # * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + # * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest.new + # + # # Call the update_model_deployment_monitoring_job method. + # result = client.update_model_deployment_monitoring_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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.model_deployment_monitoring_job&.name + header_params["model_deployment_monitoring_job.name"] = request.model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :update_model_deployment_monitoring_job, 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 ModelDeploymentMonitoringJob. + # + # @overload delete_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `delete_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(name: nil) + # Pass arguments to `delete_model_deployment_monitoring_job` 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 model monitoring job to delete. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @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::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest.new + # + # # Call the delete_model_deployment_monitoring_job method. + # result = client.delete_model_deployment_monitoring_job 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_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_model_deployment_monitoring_job, 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 + + ## + # Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + # makes a best effort to cancel the job. Will mark + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob#state ModelDeploymentMonitoringJob.state} + # to 'PAUSED'. + # + # @overload pause_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `pause_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest, ::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 pause_model_deployment_monitoring_job(name: nil) + # Pass arguments to `pause_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob to pause. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest.new + # + # # Call the pause_model_deployment_monitoring_job method. + # result = client.pause_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest + + # 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.pause_model_deployment_monitoring_job.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.pause_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :pause_model_deployment_monitoring_job, 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 + + ## + # Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + # next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + # resumed. + # + # @overload resume_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `resume_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest, ::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 resume_model_deployment_monitoring_job(name: nil) + # Pass arguments to `resume_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob to resume. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest.new + # + # # Call the resume_model_deployment_monitoring_job method. + # result = client.resume_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest + + # 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.resume_model_deployment_monitoring_job.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.resume_model_deployment_monitoring_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :resume_model_deployment_monitoring_job, 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 JobService API. + # + # This class represents the configuration for JobService, + # 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::JobService::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_custom_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::JobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_custom_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::JobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_custom_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the JobService 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_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_job + ## + # RPC-specific configuration for `get_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_job + ## + # RPC-specific configuration for `list_custom_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_jobs + ## + # RPC-specific configuration for `delete_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_job + ## + # RPC-specific configuration for `cancel_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_custom_job + ## + # RPC-specific configuration for `create_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_labeling_job + ## + # RPC-specific configuration for `get_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_labeling_job + ## + # RPC-specific configuration for `list_data_labeling_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_labeling_jobs + ## + # RPC-specific configuration for `delete_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_labeling_job + ## + # RPC-specific configuration for `cancel_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_data_labeling_job + ## + # RPC-specific configuration for `create_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hyperparameter_tuning_job + ## + # RPC-specific configuration for `get_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hyperparameter_tuning_job + ## + # RPC-specific configuration for `list_hyperparameter_tuning_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hyperparameter_tuning_jobs + ## + # RPC-specific configuration for `delete_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_hyperparameter_tuning_job + ## + # RPC-specific configuration for `cancel_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_hyperparameter_tuning_job + ## + # RPC-specific configuration for `create_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_nas_job + ## + # RPC-specific configuration for `get_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_nas_job + ## + # RPC-specific configuration for `list_nas_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nas_jobs + ## + # RPC-specific configuration for `delete_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_nas_job + ## + # RPC-specific configuration for `cancel_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_nas_job + ## + # RPC-specific configuration for `get_nas_trial_detail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_nas_trial_detail + ## + # RPC-specific configuration for `list_nas_trial_details` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nas_trial_details + ## + # RPC-specific configuration for `create_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_batch_prediction_job + ## + # RPC-specific configuration for `get_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_batch_prediction_job + ## + # RPC-specific configuration for `list_batch_prediction_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_batch_prediction_jobs + ## + # RPC-specific configuration for `delete_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_batch_prediction_job + ## + # RPC-specific configuration for `cancel_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_batch_prediction_job + ## + # RPC-specific configuration for `create_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model_deployment_monitoring_job + ## + # RPC-specific configuration for `search_model_deployment_monitoring_stats_anomalies` + # @return [::Gapic::Config::Method] + # + attr_reader :search_model_deployment_monitoring_stats_anomalies + ## + # RPC-specific configuration for `get_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_deployment_monitoring_job + ## + # RPC-specific configuration for `list_model_deployment_monitoring_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_deployment_monitoring_jobs + ## + # RPC-specific configuration for `update_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model_deployment_monitoring_job + ## + # RPC-specific configuration for `delete_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model_deployment_monitoring_job + ## + # RPC-specific configuration for `pause_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_model_deployment_monitoring_job + ## + # RPC-specific configuration for `resume_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_model_deployment_monitoring_job + + # @private + def initialize parent_rpcs = nil + create_custom_job_config = parent_rpcs.create_custom_job if parent_rpcs.respond_to? :create_custom_job + @create_custom_job = ::Gapic::Config::Method.new create_custom_job_config + get_custom_job_config = parent_rpcs.get_custom_job if parent_rpcs.respond_to? :get_custom_job + @get_custom_job = ::Gapic::Config::Method.new get_custom_job_config + list_custom_jobs_config = parent_rpcs.list_custom_jobs if parent_rpcs.respond_to? :list_custom_jobs + @list_custom_jobs = ::Gapic::Config::Method.new list_custom_jobs_config + delete_custom_job_config = parent_rpcs.delete_custom_job if parent_rpcs.respond_to? :delete_custom_job + @delete_custom_job = ::Gapic::Config::Method.new delete_custom_job_config + cancel_custom_job_config = parent_rpcs.cancel_custom_job if parent_rpcs.respond_to? :cancel_custom_job + @cancel_custom_job = ::Gapic::Config::Method.new cancel_custom_job_config + create_data_labeling_job_config = parent_rpcs.create_data_labeling_job if parent_rpcs.respond_to? :create_data_labeling_job + @create_data_labeling_job = ::Gapic::Config::Method.new create_data_labeling_job_config + get_data_labeling_job_config = parent_rpcs.get_data_labeling_job if parent_rpcs.respond_to? :get_data_labeling_job + @get_data_labeling_job = ::Gapic::Config::Method.new get_data_labeling_job_config + list_data_labeling_jobs_config = parent_rpcs.list_data_labeling_jobs if parent_rpcs.respond_to? :list_data_labeling_jobs + @list_data_labeling_jobs = ::Gapic::Config::Method.new list_data_labeling_jobs_config + delete_data_labeling_job_config = parent_rpcs.delete_data_labeling_job if parent_rpcs.respond_to? :delete_data_labeling_job + @delete_data_labeling_job = ::Gapic::Config::Method.new delete_data_labeling_job_config + cancel_data_labeling_job_config = parent_rpcs.cancel_data_labeling_job if parent_rpcs.respond_to? :cancel_data_labeling_job + @cancel_data_labeling_job = ::Gapic::Config::Method.new cancel_data_labeling_job_config + create_hyperparameter_tuning_job_config = parent_rpcs.create_hyperparameter_tuning_job if parent_rpcs.respond_to? :create_hyperparameter_tuning_job + @create_hyperparameter_tuning_job = ::Gapic::Config::Method.new create_hyperparameter_tuning_job_config + get_hyperparameter_tuning_job_config = parent_rpcs.get_hyperparameter_tuning_job if parent_rpcs.respond_to? :get_hyperparameter_tuning_job + @get_hyperparameter_tuning_job = ::Gapic::Config::Method.new get_hyperparameter_tuning_job_config + list_hyperparameter_tuning_jobs_config = parent_rpcs.list_hyperparameter_tuning_jobs if parent_rpcs.respond_to? :list_hyperparameter_tuning_jobs + @list_hyperparameter_tuning_jobs = ::Gapic::Config::Method.new list_hyperparameter_tuning_jobs_config + delete_hyperparameter_tuning_job_config = parent_rpcs.delete_hyperparameter_tuning_job if parent_rpcs.respond_to? :delete_hyperparameter_tuning_job + @delete_hyperparameter_tuning_job = ::Gapic::Config::Method.new delete_hyperparameter_tuning_job_config + cancel_hyperparameter_tuning_job_config = parent_rpcs.cancel_hyperparameter_tuning_job if parent_rpcs.respond_to? :cancel_hyperparameter_tuning_job + @cancel_hyperparameter_tuning_job = ::Gapic::Config::Method.new cancel_hyperparameter_tuning_job_config + create_nas_job_config = parent_rpcs.create_nas_job if parent_rpcs.respond_to? :create_nas_job + @create_nas_job = ::Gapic::Config::Method.new create_nas_job_config + get_nas_job_config = parent_rpcs.get_nas_job if parent_rpcs.respond_to? :get_nas_job + @get_nas_job = ::Gapic::Config::Method.new get_nas_job_config + list_nas_jobs_config = parent_rpcs.list_nas_jobs if parent_rpcs.respond_to? :list_nas_jobs + @list_nas_jobs = ::Gapic::Config::Method.new list_nas_jobs_config + delete_nas_job_config = parent_rpcs.delete_nas_job if parent_rpcs.respond_to? :delete_nas_job + @delete_nas_job = ::Gapic::Config::Method.new delete_nas_job_config + cancel_nas_job_config = parent_rpcs.cancel_nas_job if parent_rpcs.respond_to? :cancel_nas_job + @cancel_nas_job = ::Gapic::Config::Method.new cancel_nas_job_config + get_nas_trial_detail_config = parent_rpcs.get_nas_trial_detail if parent_rpcs.respond_to? :get_nas_trial_detail + @get_nas_trial_detail = ::Gapic::Config::Method.new get_nas_trial_detail_config + list_nas_trial_details_config = parent_rpcs.list_nas_trial_details if parent_rpcs.respond_to? :list_nas_trial_details + @list_nas_trial_details = ::Gapic::Config::Method.new list_nas_trial_details_config + create_batch_prediction_job_config = parent_rpcs.create_batch_prediction_job if parent_rpcs.respond_to? :create_batch_prediction_job + @create_batch_prediction_job = ::Gapic::Config::Method.new create_batch_prediction_job_config + get_batch_prediction_job_config = parent_rpcs.get_batch_prediction_job if parent_rpcs.respond_to? :get_batch_prediction_job + @get_batch_prediction_job = ::Gapic::Config::Method.new get_batch_prediction_job_config + list_batch_prediction_jobs_config = parent_rpcs.list_batch_prediction_jobs if parent_rpcs.respond_to? :list_batch_prediction_jobs + @list_batch_prediction_jobs = ::Gapic::Config::Method.new list_batch_prediction_jobs_config + delete_batch_prediction_job_config = parent_rpcs.delete_batch_prediction_job if parent_rpcs.respond_to? :delete_batch_prediction_job + @delete_batch_prediction_job = ::Gapic::Config::Method.new delete_batch_prediction_job_config + cancel_batch_prediction_job_config = parent_rpcs.cancel_batch_prediction_job if parent_rpcs.respond_to? :cancel_batch_prediction_job + @cancel_batch_prediction_job = ::Gapic::Config::Method.new cancel_batch_prediction_job_config + create_model_deployment_monitoring_job_config = parent_rpcs.create_model_deployment_monitoring_job if parent_rpcs.respond_to? :create_model_deployment_monitoring_job + @create_model_deployment_monitoring_job = ::Gapic::Config::Method.new create_model_deployment_monitoring_job_config + search_model_deployment_monitoring_stats_anomalies_config = parent_rpcs.search_model_deployment_monitoring_stats_anomalies if parent_rpcs.respond_to? :search_model_deployment_monitoring_stats_anomalies + @search_model_deployment_monitoring_stats_anomalies = ::Gapic::Config::Method.new search_model_deployment_monitoring_stats_anomalies_config + get_model_deployment_monitoring_job_config = parent_rpcs.get_model_deployment_monitoring_job if parent_rpcs.respond_to? :get_model_deployment_monitoring_job + @get_model_deployment_monitoring_job = ::Gapic::Config::Method.new get_model_deployment_monitoring_job_config + list_model_deployment_monitoring_jobs_config = parent_rpcs.list_model_deployment_monitoring_jobs if parent_rpcs.respond_to? :list_model_deployment_monitoring_jobs + @list_model_deployment_monitoring_jobs = ::Gapic::Config::Method.new list_model_deployment_monitoring_jobs_config + update_model_deployment_monitoring_job_config = parent_rpcs.update_model_deployment_monitoring_job if parent_rpcs.respond_to? :update_model_deployment_monitoring_job + @update_model_deployment_monitoring_job = ::Gapic::Config::Method.new update_model_deployment_monitoring_job_config + delete_model_deployment_monitoring_job_config = parent_rpcs.delete_model_deployment_monitoring_job if parent_rpcs.respond_to? :delete_model_deployment_monitoring_job + @delete_model_deployment_monitoring_job = ::Gapic::Config::Method.new delete_model_deployment_monitoring_job_config + pause_model_deployment_monitoring_job_config = parent_rpcs.pause_model_deployment_monitoring_job if parent_rpcs.respond_to? :pause_model_deployment_monitoring_job + @pause_model_deployment_monitoring_job = ::Gapic::Config::Method.new pause_model_deployment_monitoring_job_config + resume_model_deployment_monitoring_job_config = parent_rpcs.resume_model_deployment_monitoring_job if parent_rpcs.respond_to? :resume_model_deployment_monitoring_job + @resume_model_deployment_monitoring_job = ::Gapic::Config::Method.new resume_model_deployment_monitoring_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/credentials.rb new file mode 100644 index 000000000000..0c5c676f9bc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/credentials.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + # Credentials for the JobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/operations.rb new file mode 100644 index 000000000000..7adf48755537 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + # 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 JobService 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 JobService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/paths.rb new file mode 100644 index 000000000000..c997c2c58ad7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/paths.rb @@ -0,0 +1,401 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + # Path helper methods for the JobService API. + module Paths + ## + # Create a fully-qualified BatchPredictionJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # + # @param project [String] + # @param location [String] + # @param batch_prediction_job [String] + # + # @return [::String] + def batch_prediction_job_path project:, location:, batch_prediction_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/batchPredictionJobs/#{batch_prediction_job}" + end + + ## + # Create a fully-qualified Context resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param context [String] + # + # @return [::String] + def context_path project:, location:, metadata_store:, context: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/contexts/#{context}" + end + + ## + # Create a fully-qualified CustomJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @param project [String] + # @param location [String] + # @param custom_job [String] + # + # @return [::String] + def custom_job_path project:, location:, custom_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customJobs/#{custom_job}" + end + + ## + # Create a fully-qualified DataLabelingJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # + # @param project [String] + # @param location [String] + # @param data_labeling_job [String] + # + # @return [::String] + def data_labeling_job_path project:, location:, data_labeling_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataLabelingJobs/#{data_labeling_job}" + end + + ## + # Create a fully-qualified Dataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # + # @return [::String] + def dataset_path project:, location:, dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}" + end + + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified HyperparameterTuningJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # + # @param project [String] + # @param location [String] + # @param hyperparameter_tuning_job [String] + # + # @return [::String] + def hyperparameter_tuning_job_path project:, location:, hyperparameter_tuning_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/hyperparameterTuningJobs/#{hyperparameter_tuning_job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified ModelDeploymentMonitoringJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # + # @param project [String] + # @param location [String] + # @param model_deployment_monitoring_job [String] + # + # @return [::String] + def model_deployment_monitoring_job_path project:, location:, model_deployment_monitoring_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/modelDeploymentMonitoringJobs/#{model_deployment_monitoring_job}" + end + + ## + # Create a fully-qualified NasJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # + # @param project [String] + # @param location [String] + # @param nas_job [String] + # + # @return [::String] + def nas_job_path project:, location:, nas_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/nasJobs/#{nas_job}" + end + + ## + # Create a fully-qualified NasTrialDetail resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + # + # @param project [String] + # @param location [String] + # @param nas_job [String] + # @param nas_trial_detail [String] + # + # @return [::String] + def nas_trial_detail_path project:, location:, nas_job:, nas_trial_detail: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "nas_job cannot contain /" if nas_job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/nasJobs/#{nas_job}/nasTrialDetails/#{nas_trial_detail}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified NotificationChannel resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/notificationChannels/{notification_channel}` + # + # @param project [String] + # @param notification_channel [String] + # + # @return [::String] + def notification_channel_path project:, notification_channel: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/notificationChannels/#{notification_channel}" + end + + ## + # Create a fully-qualified PersistentResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + # + # @param project [String] + # @param location [String] + # @param persistent_resource [String] + # + # @return [::String] + def persistent_resource_path project:, location:, persistent_resource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/persistentResources/#{persistent_resource}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + ## + # Create a fully-qualified Tensorboard resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @param project [String] + # @param location [String] + # @param tensorboard [String] + # + # @return [::String] + def tensorboard_path project:, location:, tensorboard: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorboards/#{tensorboard}" + end + + ## + # Create a fully-qualified Trial resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @param project [String] + # @param location [String] + # @param study [String] + # @param trial [String] + # + # @return [::String] + def trial_path project:, location:, study:, trial: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "study cannot contain /" if study.to_s.include? "/" + + "projects/#{project}/locations/#{location}/studies/#{study}/trials/#{trial}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest.rb new file mode 100644 index 000000000000..d04d9ba9221d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/job_service/credentials" +require "google/cloud/ai_platform/v1/job_service/paths" +require "google/cloud/ai_platform/v1/job_service/rest/operations" +require "google/cloud/ai_platform/v1/job_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/job_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + module JobService + # 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/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb new file mode 100644 index 000000000000..1042018bcd5c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb @@ -0,0 +1,3849 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/job_service_pb" +require "google/cloud/ai_platform/v1/job_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + module Rest + ## + # REST client for the JobService service. + # + # A service for creating and managing Vertex AI's jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::AIPlatform::V1::JobService::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 JobService 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::JobService::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 + @job_service_stub.universe_domain + end + + ## + # Create a new JobService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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::JobService::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 + + @job_service_stub = ::Google::Cloud::AIPlatform::V1::JobService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @job_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 = @job_service_stub.endpoint + config.universe_domain = @job_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @job_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 = @job_service_stub.endpoint + config.universe_domain = @job_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @job_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::JobService::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 + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a CustomJob. A created CustomJob right away + # will be attempted to be run. + # + # @overload create_custom_job(request, options = nil) + # Pass arguments to `create_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest, ::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_custom_job(parent: nil, custom_job: nil) + # Pass arguments to `create_custom_job` 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 CustomJob in. + # Format: `projects/{project}/locations/{location}` + # @param custom_job [::Google::Cloud::AIPlatform::V1::CustomJob, ::Hash] + # Required. The CustomJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CustomJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateCustomJobRequest.new + # + # # Call the create_custom_job method. + # result = client.create_custom_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + # p result + # + def create_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_custom_job 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 + + ## + # Gets a CustomJob. + # + # @overload get_custom_job(request, options = nil) + # Pass arguments to `get_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `get_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob resource. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CustomJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetCustomJobRequest.new + # + # # Call the get_custom_job method. + # result = client.get_custom_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + # p result + # + def get_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_custom_job 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 CustomJobs in a Location. + # + # @overload list_custom_jobs(request, options = nil) + # Pass arguments to `list_custom_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest, ::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_custom_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_custom_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the CustomJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse#next_page_token ListCustomJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#list_custom_jobs JobService.ListCustomJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListCustomJobsRequest.new + # + # # Call the list_custom_jobs method. + # result = client.list_custom_jobs 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::CustomJob. + # p item + # end + # + def list_custom_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest + + # 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_custom_jobs.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_custom_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_custom_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_custom_jobs, "custom_jobs", 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 + + ## + # Deletes a CustomJob. + # + # @overload delete_custom_job(request, options = nil) + # Pass arguments to `delete_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `delete_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest.new + # + # # Call the delete_custom_job method. + # result = client.delete_custom_job 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_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_custom_job 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 + + ## + # Cancels a CustomJob. + # Starts asynchronous cancellation on the CustomJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#get_custom_job JobService.GetCustomJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the CustomJob is not deleted; instead it becomes a job with + # a {::Google::Cloud::AIPlatform::V1::CustomJob#error CustomJob.error} value with + # a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::CustomJob#state CustomJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_custom_job(request, options = nil) + # Pass arguments to `cancel_custom_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest, ::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_custom_job(name: nil) + # Pass arguments to `cancel_custom_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the CustomJob to cancel. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelCustomJobRequest.new + # + # # Call the cancel_custom_job method. + # result = client.cancel_custom_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_custom_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest + + # 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_custom_job.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_custom_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_custom_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.cancel_custom_job 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 + + ## + # Creates a DataLabelingJob. + # + # @overload create_data_labeling_job(request, options = nil) + # Pass arguments to `create_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest, ::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_data_labeling_job(parent: nil, data_labeling_job: nil) + # Pass arguments to `create_data_labeling_job` 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 parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @param data_labeling_job [::Google::Cloud::AIPlatform::V1::DataLabelingJob, ::Hash] + # Required. The DataLabelingJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest.new + # + # # Call the create_data_labeling_job method. + # result = client.create_data_labeling_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + # p result + # + def create_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_data_labeling_job 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 + + ## + # Gets a DataLabelingJob. + # + # @overload get_data_labeling_job(request, options = nil) + # Pass arguments to `get_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `get_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest.new + # + # # Call the get_data_labeling_job method. + # result = client.get_data_labeling_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + # p result + # + def get_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_data_labeling_job 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 DataLabelingJobs in a Location. + # + # @overload list_data_labeling_jobs(request, options = nil) + # Pass arguments to `list_data_labeling_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest, ::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_data_labeling_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_data_labeling_jobs` 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 parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. FieldMask represents a set of + # symbolic field paths. For example, the mask can be `paths: "name"`. The + # "name" here is a field in DataLabelingJob. + # If this field is not set, all fields of the DataLabelingJob are returned. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order by + # default. + # Use `desc` after a field name for descending. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest.new + # + # # Call the list_data_labeling_jobs method. + # result = client.list_data_labeling_jobs 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::DataLabelingJob. + # p item + # end + # + def list_data_labeling_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest + + # 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_data_labeling_jobs.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_data_labeling_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_labeling_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_data_labeling_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_data_labeling_jobs, "data_labeling_jobs", 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 + + ## + # Deletes a DataLabelingJob. + # + # @overload delete_data_labeling_job(request, options = nil) + # Pass arguments to `delete_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `delete_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob to be deleted. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest.new + # + # # Call the delete_data_labeling_job method. + # result = client.delete_data_labeling_job 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_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_data_labeling_job 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 + + ## + # Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + # + # @overload cancel_data_labeling_job(request, options = nil) + # Pass arguments to `cancel_data_labeling_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest, ::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_data_labeling_job(name: nil) + # Pass arguments to `cancel_data_labeling_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest.new + # + # # Call the cancel_data_labeling_job method. + # result = client.cancel_data_labeling_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_data_labeling_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest + + # 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_data_labeling_job.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_data_labeling_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_data_labeling_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.cancel_data_labeling_job 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 + + ## + # Creates a HyperparameterTuningJob + # + # @overload create_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `create_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(parent: nil, hyperparameter_tuning_job: nil) + # Pass arguments to `create_hyperparameter_tuning_job` 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 + # HyperparameterTuningJob in. Format: + # `projects/{project}/locations/{location}` + # @param hyperparameter_tuning_job [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob, ::Hash] + # Required. The HyperparameterTuningJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest.new + # + # # Call the create_hyperparameter_tuning_job method. + # result = client.create_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + # p result + # + def create_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_hyperparameter_tuning_job 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 + + ## + # Gets a HyperparameterTuningJob + # + # @overload get_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `get_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `get_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob resource. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest.new + # + # # Call the get_hyperparameter_tuning_job method. + # result = client.get_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + # p result + # + def get_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_hyperparameter_tuning_job 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 HyperparameterTuningJobs in a Location. + # + # @overload list_hyperparameter_tuning_jobs(request, options = nil) + # Pass arguments to `list_hyperparameter_tuning_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest, ::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_hyperparameter_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_hyperparameter_tuning_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the + # HyperparameterTuningJobs from. Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse#next_page_token ListHyperparameterTuningJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#list_hyperparameter_tuning_jobs JobService.ListHyperparameterTuningJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest.new + # + # # Call the list_hyperparameter_tuning_jobs method. + # result = client.list_hyperparameter_tuning_jobs 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::HyperparameterTuningJob. + # p item + # end + # + def list_hyperparameter_tuning_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest + + # 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_hyperparameter_tuning_jobs.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_hyperparameter_tuning_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_hyperparameter_tuning_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_hyperparameter_tuning_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_hyperparameter_tuning_jobs, "hyperparameter_tuning_jobs", 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 + + ## + # Deletes a HyperparameterTuningJob. + # + # @overload delete_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `delete_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `delete_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest.new + # + # # Call the delete_hyperparameter_tuning_job method. + # result = client.delete_hyperparameter_tuning_job 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_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_hyperparameter_tuning_job 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 + + ## + # Cancels a HyperparameterTuningJob. + # Starts asynchronous cancellation on the HyperparameterTuningJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#get_hyperparameter_tuning_job JobService.GetHyperparameterTuningJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the HyperparameterTuningJob is not deleted; instead it becomes a job with + # a + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#error HyperparameterTuningJob.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#state HyperparameterTuningJob.state} + # is set to `CANCELLED`. + # + # @overload cancel_hyperparameter_tuning_job(request, options = nil) + # Pass arguments to `cancel_hyperparameter_tuning_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest, ::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_hyperparameter_tuning_job(name: nil) + # Pass arguments to `cancel_hyperparameter_tuning_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the HyperparameterTuningJob to cancel. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest.new + # + # # Call the cancel_hyperparameter_tuning_job method. + # result = client.cancel_hyperparameter_tuning_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_hyperparameter_tuning_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest + + # 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_hyperparameter_tuning_job.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_hyperparameter_tuning_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_hyperparameter_tuning_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.cancel_hyperparameter_tuning_job 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 + + ## + # Creates a NasJob + # + # @overload create_nas_job(request, options = nil) + # Pass arguments to `create_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNasJobRequest, ::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_nas_job(parent: nil, nas_job: nil) + # Pass arguments to `create_nas_job` 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 NasJob in. + # Format: `projects/{project}/locations/{location}` + # @param nas_job [::Google::Cloud::AIPlatform::V1::NasJob, ::Hash] + # Required. The NasJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NasJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNasJobRequest.new + # + # # Call the create_nas_job method. + # result = client.create_nas_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasJob. + # p result + # + def create_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_nas_job 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 + + ## + # Gets a NasJob + # + # @overload get_nas_job(request, options = nil) + # Pass arguments to `get_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `get_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NasJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNasJobRequest.new + # + # # Call the get_nas_job method. + # result = client.get_nas_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasJob. + # p result + # + def get_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_nas_job 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 NasJobs in a Location. + # + # @overload list_nas_jobs(request, options = nil) + # Pass arguments to `list_nas_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNasJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNasJobsRequest, ::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_nas_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_nas_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the NasJobs + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasJobsResponse#next_page_token ListNasJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#list_nas_jobs JobService.ListNasJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNasJobsRequest.new + # + # # Call the list_nas_jobs method. + # result = client.list_nas_jobs 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::NasJob. + # p item + # end + # + def list_nas_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNasJobsRequest + + # 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_nas_jobs.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_nas_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_nas_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_nas_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_nas_jobs, "nas_jobs", 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 + + ## + # Deletes a NasJob. + # + # @overload delete_nas_job(request, options = nil) + # Pass arguments to `delete_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `delete_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNasJobRequest.new + # + # # Call the delete_nas_job method. + # result = client.delete_nas_job 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_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_nas_job 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 + + ## + # Cancels a NasJob. + # Starts asynchronous cancellation on the NasJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#get_nas_job JobService.GetNasJob} or + # other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the NasJob is not deleted; instead it becomes a job with + # a {::Google::Cloud::AIPlatform::V1::NasJob#error NasJob.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::NasJob#state NasJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_nas_job(request, options = nil) + # Pass arguments to `cancel_nas_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelNasJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelNasJobRequest, ::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_nas_job(name: nil) + # Pass arguments to `cancel_nas_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasJob to cancel. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelNasJobRequest.new + # + # # Call the cancel_nas_job method. + # result = client.cancel_nas_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_nas_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelNasJobRequest + + # 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_nas_job.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_nas_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_nas_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.cancel_nas_job 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 + + ## + # Gets a NasTrialDetail. + # + # @overload get_nas_trial_detail(request, options = nil) + # Pass arguments to `get_nas_trial_detail` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest, ::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_nas_trial_detail(name: nil) + # Pass arguments to `get_nas_trial_detail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NasTrialDetail resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NasTrialDetail] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasTrialDetail] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest.new + # + # # Call the get_nas_trial_detail method. + # result = client.get_nas_trial_detail request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NasTrialDetail. + # p result + # + def get_nas_trial_detail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest + + # 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_nas_trial_detail.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_nas_trial_detail.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_nas_trial_detail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_nas_trial_detail 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 + + ## + # List top NasTrialDetails of a NasJob. + # + # @overload list_nas_trial_details(request, options = nil) + # Pass arguments to `list_nas_trial_details` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest, ::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_nas_trial_details(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_nas_trial_details` 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 name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse#next_page_token ListNasTrialDetailsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#list_nas_trial_details JobService.ListNasTrialDetails} + # call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasTrialDetail>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NasTrialDetail>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest.new + # + # # Call the list_nas_trial_details method. + # result = client.list_nas_trial_details 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::NasTrialDetail. + # p item + # end + # + def list_nas_trial_details request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest + + # 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_nas_trial_details.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_nas_trial_details.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_nas_trial_details.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_nas_trial_details request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_nas_trial_details, "nas_trial_details", 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 + + ## + # Creates a BatchPredictionJob. A BatchPredictionJob once created will + # right away be attempted to start. + # + # @overload create_batch_prediction_job(request, options = nil) + # Pass arguments to `create_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest, ::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_batch_prediction_job(parent: nil, batch_prediction_job: nil) + # Pass arguments to `create_batch_prediction_job` 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 + # BatchPredictionJob in. Format: `projects/{project}/locations/{location}` + # @param batch_prediction_job [::Google::Cloud::AIPlatform::V1::BatchPredictionJob, ::Hash] + # Required. The BatchPredictionJob to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest.new + # + # # Call the create_batch_prediction_job method. + # result = client.create_batch_prediction_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + # p result + # + def create_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_batch_prediction_job 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 + + ## + # Gets a BatchPredictionJob + # + # @overload get_batch_prediction_job(request, options = nil) + # Pass arguments to `get_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `get_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob resource. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest.new + # + # # Call the get_batch_prediction_job method. + # result = client.get_batch_prediction_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + # p result + # + def get_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_batch_prediction_job 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 BatchPredictionJobs in a Location. + # + # @overload list_batch_prediction_jobs(request, options = nil) + # Pass arguments to `list_batch_prediction_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest, ::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_batch_prediction_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_batch_prediction_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the BatchPredictionJobs + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `model_display_name` supports `=`, `!=` comparisons. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse#next_page_token ListBatchPredictionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#list_batch_prediction_jobs JobService.ListBatchPredictionJobs} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest.new + # + # # Call the list_batch_prediction_jobs method. + # result = client.list_batch_prediction_jobs 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::BatchPredictionJob. + # p item + # end + # + def list_batch_prediction_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest + + # 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_batch_prediction_jobs.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_batch_prediction_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_batch_prediction_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_batch_prediction_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_batch_prediction_jobs, "batch_prediction_jobs", 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 + + ## + # Deletes a BatchPredictionJob. Can only be called on jobs that already + # finished. + # + # @overload delete_batch_prediction_job(request, options = nil) + # Pass arguments to `delete_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `delete_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest.new + # + # # Call the delete_batch_prediction_job method. + # result = client.delete_batch_prediction_job 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_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_batch_prediction_job 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 + + ## + # Cancels a BatchPredictionJob. + # + # Starts asynchronous cancellation on the BatchPredictionJob. The server + # makes the best effort to cancel the job, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#get_batch_prediction_job JobService.GetBatchPredictionJob} + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On a successful cancellation, + # the BatchPredictionJob is not deleted;instead its + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#state BatchPredictionJob.state} + # is set to `CANCELLED`. Any files already outputted by the job are not + # deleted. + # + # @overload cancel_batch_prediction_job(request, options = nil) + # Pass arguments to `cancel_batch_prediction_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest, ::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_batch_prediction_job(name: nil) + # Pass arguments to `cancel_batch_prediction_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the BatchPredictionJob to cancel. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest.new + # + # # Call the cancel_batch_prediction_job method. + # result = client.cancel_batch_prediction_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_batch_prediction_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest + + # 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_batch_prediction_job.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_batch_prediction_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_batch_prediction_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.cancel_batch_prediction_job 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 + + ## + # Creates a ModelDeploymentMonitoringJob. It will run periodically on a + # configured interval. + # + # @overload create_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `create_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(parent: nil, model_deployment_monitoring_job: nil) + # Pass arguments to `create_model_deployment_monitoring_job` 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 parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @param model_deployment_monitoring_job [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob, ::Hash] + # Required. The ModelDeploymentMonitoringJob to create + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest.new + # + # # Call the create_model_deployment_monitoring_job method. + # result = client.create_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + # p result + # + def create_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_model_deployment_monitoring_job 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 + + ## + # Searches Model Monitoring Statistics generated within a given time window. + # + # @overload search_model_deployment_monitoring_stats_anomalies(request, options = nil) + # Pass arguments to `search_model_deployment_monitoring_stats_anomalies` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest, ::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 search_model_deployment_monitoring_stats_anomalies(model_deployment_monitoring_job: nil, deployed_model_id: nil, feature_display_name: nil, objectives: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil) + # Pass arguments to `search_model_deployment_monitoring_stats_anomalies` 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 model_deployment_monitoring_job [::String] + # Required. ModelDeploymentMonitoring Job resource name. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @param deployed_model_id [::String] + # Required. The DeployedModel ID of the + # [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + # @param feature_display_name [::String] + # The feature display name. If specified, only return the stats belonging to + # this feature. Format: + # {::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies#feature_display_name ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + # example: "user_destination". + # @param objectives [::Array<::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest::StatsAnomaliesObjective, ::Hash>] + # Required. Objectives of the stats to retrieve. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::AIPlatform::V1::JobService::Rest::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies} + # call. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The earliest timestamp of stats being generated. + # If not set, indicates fetching stats till the earliest possible one. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # The latest timestamp of stats being generated. + # If not set, indicates feching stats till the latest possible one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest.new + # + # # Call the search_model_deployment_monitoring_stats_anomalies method. + # result = client.search_model_deployment_monitoring_stats_anomalies 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::ModelMonitoringStatsAnomalies. + # p item + # end + # + def search_model_deployment_monitoring_stats_anomalies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest + + # 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.search_model_deployment_monitoring_stats_anomalies.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.search_model_deployment_monitoring_stats_anomalies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_model_deployment_monitoring_stats_anomalies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_model_deployment_monitoring_stats_anomalies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :search_model_deployment_monitoring_stats_anomalies, "monitoring_stats", 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 a ModelDeploymentMonitoringJob. + # + # @overload get_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `get_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(name: nil) + # Pass arguments to `get_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest.new + # + # # Call the get_model_deployment_monitoring_job method. + # result = client.get_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + # p result + # + def get_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_model_deployment_monitoring_job 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 ModelDeploymentMonitoringJobs in a Location. + # + # @overload list_model_deployment_monitoring_jobs(request, options = nil) + # Pass arguments to `list_model_deployment_monitoring_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest, ::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_model_deployment_monitoring_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_deployment_monitoring_jobs` 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 parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>] + # + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest.new + # + # # Call the list_model_deployment_monitoring_jobs method. + # result = client.list_model_deployment_monitoring_jobs 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::ModelDeploymentMonitoringJob. + # p item + # end + # + def list_model_deployment_monitoring_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest + + # 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_model_deployment_monitoring_jobs.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_model_deployment_monitoring_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_model_deployment_monitoring_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_model_deployment_monitoring_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_model_deployment_monitoring_jobs, "model_deployment_monitoring_jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a ModelDeploymentMonitoringJob. + # + # @overload update_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `update_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(model_deployment_monitoring_job: nil, update_mask: nil) + # Pass arguments to `update_model_deployment_monitoring_job` 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 model_deployment_monitoring_job [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob, ::Hash] + # Required. The model monitoring configuration which replaces the resource on + # the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask is used to specify the fields to be overwritten + # in the ModelDeploymentMonitoringJob resource by the update. The fields + # specified in the update_mask are relative to the resource, not the full + # request. A field will be overwritten if it is in the mask. If the user does + # not provide a mask then only the non-empty fields present in the request + # will be overwritten. Set the update_mask to `*` to override all fields. For + # the objective config, the user can either provide the update mask for + # model_deployment_monitoring_objective_configs or any combination of its + # nested fields, such as: + # model_deployment_monitoring_objective_configs.objective_config.training_dataset. + # + # Updatable fields: + # + # * `display_name` + # * `model_deployment_monitoring_schedule_config` + # * `model_monitoring_alert_config` + # * `logging_sampling_strategy` + # * `labels` + # * `log_ttl` + # * `enable_monitoring_pipeline_logs` + # . and + # * `model_deployment_monitoring_objective_configs` + # . or + # * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + # * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + # * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest.new + # + # # Call the update_model_deployment_monitoring_job method. + # result = client.update_model_deployment_monitoring_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.update_model_deployment_monitoring_job 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 ModelDeploymentMonitoringJob. + # + # @overload delete_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `delete_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest, ::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_model_deployment_monitoring_job(name: nil) + # Pass arguments to `delete_model_deployment_monitoring_job` 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 model monitoring job to delete. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @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::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest.new + # + # # Call the delete_model_deployment_monitoring_job method. + # result = client.delete_model_deployment_monitoring_job 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_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest + + # 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_model_deployment_monitoring_job.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_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_model_deployment_monitoring_job 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 + + ## + # Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + # makes a best effort to cancel the job. Will mark + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob#state ModelDeploymentMonitoringJob.state} + # to 'PAUSED'. + # + # @overload pause_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `pause_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest, ::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 pause_model_deployment_monitoring_job(name: nil) + # Pass arguments to `pause_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob to pause. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest.new + # + # # Call the pause_model_deployment_monitoring_job method. + # result = client.pause_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest + + # 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.pause_model_deployment_monitoring_job.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.pause_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.pause_model_deployment_monitoring_job 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 + + ## + # Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + # next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + # resumed. + # + # @overload resume_model_deployment_monitoring_job(request, options = nil) + # Pass arguments to `resume_model_deployment_monitoring_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest, ::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 resume_model_deployment_monitoring_job(name: nil) + # Pass arguments to `resume_model_deployment_monitoring_job` 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 ModelDeploymentMonitoringJob to resume. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest.new + # + # # Call the resume_model_deployment_monitoring_job method. + # result = client.resume_model_deployment_monitoring_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_model_deployment_monitoring_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest + + # 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.resume_model_deployment_monitoring_job.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.resume_model_deployment_monitoring_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_model_deployment_monitoring_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.resume_model_deployment_monitoring_job 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 JobService REST API. + # + # This class represents the configuration for JobService 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::JobService::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_custom_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_custom_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_custom_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the JobService 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_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_job + ## + # RPC-specific configuration for `get_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_job + ## + # RPC-specific configuration for `list_custom_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_jobs + ## + # RPC-specific configuration for `delete_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_job + ## + # RPC-specific configuration for `cancel_custom_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_custom_job + ## + # RPC-specific configuration for `create_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_labeling_job + ## + # RPC-specific configuration for `get_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_labeling_job + ## + # RPC-specific configuration for `list_data_labeling_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_labeling_jobs + ## + # RPC-specific configuration for `delete_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_labeling_job + ## + # RPC-specific configuration for `cancel_data_labeling_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_data_labeling_job + ## + # RPC-specific configuration for `create_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hyperparameter_tuning_job + ## + # RPC-specific configuration for `get_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hyperparameter_tuning_job + ## + # RPC-specific configuration for `list_hyperparameter_tuning_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hyperparameter_tuning_jobs + ## + # RPC-specific configuration for `delete_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_hyperparameter_tuning_job + ## + # RPC-specific configuration for `cancel_hyperparameter_tuning_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_hyperparameter_tuning_job + ## + # RPC-specific configuration for `create_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_nas_job + ## + # RPC-specific configuration for `get_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_nas_job + ## + # RPC-specific configuration for `list_nas_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nas_jobs + ## + # RPC-specific configuration for `delete_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_nas_job + ## + # RPC-specific configuration for `cancel_nas_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_nas_job + ## + # RPC-specific configuration for `get_nas_trial_detail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_nas_trial_detail + ## + # RPC-specific configuration for `list_nas_trial_details` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nas_trial_details + ## + # RPC-specific configuration for `create_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_batch_prediction_job + ## + # RPC-specific configuration for `get_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_batch_prediction_job + ## + # RPC-specific configuration for `list_batch_prediction_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_batch_prediction_jobs + ## + # RPC-specific configuration for `delete_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_batch_prediction_job + ## + # RPC-specific configuration for `cancel_batch_prediction_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_batch_prediction_job + ## + # RPC-specific configuration for `create_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model_deployment_monitoring_job + ## + # RPC-specific configuration for `search_model_deployment_monitoring_stats_anomalies` + # @return [::Gapic::Config::Method] + # + attr_reader :search_model_deployment_monitoring_stats_anomalies + ## + # RPC-specific configuration for `get_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_deployment_monitoring_job + ## + # RPC-specific configuration for `list_model_deployment_monitoring_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_deployment_monitoring_jobs + ## + # RPC-specific configuration for `update_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model_deployment_monitoring_job + ## + # RPC-specific configuration for `delete_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model_deployment_monitoring_job + ## + # RPC-specific configuration for `pause_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_model_deployment_monitoring_job + ## + # RPC-specific configuration for `resume_model_deployment_monitoring_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_model_deployment_monitoring_job + + # @private + def initialize parent_rpcs = nil + create_custom_job_config = parent_rpcs.create_custom_job if parent_rpcs.respond_to? :create_custom_job + @create_custom_job = ::Gapic::Config::Method.new create_custom_job_config + get_custom_job_config = parent_rpcs.get_custom_job if parent_rpcs.respond_to? :get_custom_job + @get_custom_job = ::Gapic::Config::Method.new get_custom_job_config + list_custom_jobs_config = parent_rpcs.list_custom_jobs if parent_rpcs.respond_to? :list_custom_jobs + @list_custom_jobs = ::Gapic::Config::Method.new list_custom_jobs_config + delete_custom_job_config = parent_rpcs.delete_custom_job if parent_rpcs.respond_to? :delete_custom_job + @delete_custom_job = ::Gapic::Config::Method.new delete_custom_job_config + cancel_custom_job_config = parent_rpcs.cancel_custom_job if parent_rpcs.respond_to? :cancel_custom_job + @cancel_custom_job = ::Gapic::Config::Method.new cancel_custom_job_config + create_data_labeling_job_config = parent_rpcs.create_data_labeling_job if parent_rpcs.respond_to? :create_data_labeling_job + @create_data_labeling_job = ::Gapic::Config::Method.new create_data_labeling_job_config + get_data_labeling_job_config = parent_rpcs.get_data_labeling_job if parent_rpcs.respond_to? :get_data_labeling_job + @get_data_labeling_job = ::Gapic::Config::Method.new get_data_labeling_job_config + list_data_labeling_jobs_config = parent_rpcs.list_data_labeling_jobs if parent_rpcs.respond_to? :list_data_labeling_jobs + @list_data_labeling_jobs = ::Gapic::Config::Method.new list_data_labeling_jobs_config + delete_data_labeling_job_config = parent_rpcs.delete_data_labeling_job if parent_rpcs.respond_to? :delete_data_labeling_job + @delete_data_labeling_job = ::Gapic::Config::Method.new delete_data_labeling_job_config + cancel_data_labeling_job_config = parent_rpcs.cancel_data_labeling_job if parent_rpcs.respond_to? :cancel_data_labeling_job + @cancel_data_labeling_job = ::Gapic::Config::Method.new cancel_data_labeling_job_config + create_hyperparameter_tuning_job_config = parent_rpcs.create_hyperparameter_tuning_job if parent_rpcs.respond_to? :create_hyperparameter_tuning_job + @create_hyperparameter_tuning_job = ::Gapic::Config::Method.new create_hyperparameter_tuning_job_config + get_hyperparameter_tuning_job_config = parent_rpcs.get_hyperparameter_tuning_job if parent_rpcs.respond_to? :get_hyperparameter_tuning_job + @get_hyperparameter_tuning_job = ::Gapic::Config::Method.new get_hyperparameter_tuning_job_config + list_hyperparameter_tuning_jobs_config = parent_rpcs.list_hyperparameter_tuning_jobs if parent_rpcs.respond_to? :list_hyperparameter_tuning_jobs + @list_hyperparameter_tuning_jobs = ::Gapic::Config::Method.new list_hyperparameter_tuning_jobs_config + delete_hyperparameter_tuning_job_config = parent_rpcs.delete_hyperparameter_tuning_job if parent_rpcs.respond_to? :delete_hyperparameter_tuning_job + @delete_hyperparameter_tuning_job = ::Gapic::Config::Method.new delete_hyperparameter_tuning_job_config + cancel_hyperparameter_tuning_job_config = parent_rpcs.cancel_hyperparameter_tuning_job if parent_rpcs.respond_to? :cancel_hyperparameter_tuning_job + @cancel_hyperparameter_tuning_job = ::Gapic::Config::Method.new cancel_hyperparameter_tuning_job_config + create_nas_job_config = parent_rpcs.create_nas_job if parent_rpcs.respond_to? :create_nas_job + @create_nas_job = ::Gapic::Config::Method.new create_nas_job_config + get_nas_job_config = parent_rpcs.get_nas_job if parent_rpcs.respond_to? :get_nas_job + @get_nas_job = ::Gapic::Config::Method.new get_nas_job_config + list_nas_jobs_config = parent_rpcs.list_nas_jobs if parent_rpcs.respond_to? :list_nas_jobs + @list_nas_jobs = ::Gapic::Config::Method.new list_nas_jobs_config + delete_nas_job_config = parent_rpcs.delete_nas_job if parent_rpcs.respond_to? :delete_nas_job + @delete_nas_job = ::Gapic::Config::Method.new delete_nas_job_config + cancel_nas_job_config = parent_rpcs.cancel_nas_job if parent_rpcs.respond_to? :cancel_nas_job + @cancel_nas_job = ::Gapic::Config::Method.new cancel_nas_job_config + get_nas_trial_detail_config = parent_rpcs.get_nas_trial_detail if parent_rpcs.respond_to? :get_nas_trial_detail + @get_nas_trial_detail = ::Gapic::Config::Method.new get_nas_trial_detail_config + list_nas_trial_details_config = parent_rpcs.list_nas_trial_details if parent_rpcs.respond_to? :list_nas_trial_details + @list_nas_trial_details = ::Gapic::Config::Method.new list_nas_trial_details_config + create_batch_prediction_job_config = parent_rpcs.create_batch_prediction_job if parent_rpcs.respond_to? :create_batch_prediction_job + @create_batch_prediction_job = ::Gapic::Config::Method.new create_batch_prediction_job_config + get_batch_prediction_job_config = parent_rpcs.get_batch_prediction_job if parent_rpcs.respond_to? :get_batch_prediction_job + @get_batch_prediction_job = ::Gapic::Config::Method.new get_batch_prediction_job_config + list_batch_prediction_jobs_config = parent_rpcs.list_batch_prediction_jobs if parent_rpcs.respond_to? :list_batch_prediction_jobs + @list_batch_prediction_jobs = ::Gapic::Config::Method.new list_batch_prediction_jobs_config + delete_batch_prediction_job_config = parent_rpcs.delete_batch_prediction_job if parent_rpcs.respond_to? :delete_batch_prediction_job + @delete_batch_prediction_job = ::Gapic::Config::Method.new delete_batch_prediction_job_config + cancel_batch_prediction_job_config = parent_rpcs.cancel_batch_prediction_job if parent_rpcs.respond_to? :cancel_batch_prediction_job + @cancel_batch_prediction_job = ::Gapic::Config::Method.new cancel_batch_prediction_job_config + create_model_deployment_monitoring_job_config = parent_rpcs.create_model_deployment_monitoring_job if parent_rpcs.respond_to? :create_model_deployment_monitoring_job + @create_model_deployment_monitoring_job = ::Gapic::Config::Method.new create_model_deployment_monitoring_job_config + search_model_deployment_monitoring_stats_anomalies_config = parent_rpcs.search_model_deployment_monitoring_stats_anomalies if parent_rpcs.respond_to? :search_model_deployment_monitoring_stats_anomalies + @search_model_deployment_monitoring_stats_anomalies = ::Gapic::Config::Method.new search_model_deployment_monitoring_stats_anomalies_config + get_model_deployment_monitoring_job_config = parent_rpcs.get_model_deployment_monitoring_job if parent_rpcs.respond_to? :get_model_deployment_monitoring_job + @get_model_deployment_monitoring_job = ::Gapic::Config::Method.new get_model_deployment_monitoring_job_config + list_model_deployment_monitoring_jobs_config = parent_rpcs.list_model_deployment_monitoring_jobs if parent_rpcs.respond_to? :list_model_deployment_monitoring_jobs + @list_model_deployment_monitoring_jobs = ::Gapic::Config::Method.new list_model_deployment_monitoring_jobs_config + update_model_deployment_monitoring_job_config = parent_rpcs.update_model_deployment_monitoring_job if parent_rpcs.respond_to? :update_model_deployment_monitoring_job + @update_model_deployment_monitoring_job = ::Gapic::Config::Method.new update_model_deployment_monitoring_job_config + delete_model_deployment_monitoring_job_config = parent_rpcs.delete_model_deployment_monitoring_job if parent_rpcs.respond_to? :delete_model_deployment_monitoring_job + @delete_model_deployment_monitoring_job = ::Gapic::Config::Method.new delete_model_deployment_monitoring_job_config + pause_model_deployment_monitoring_job_config = parent_rpcs.pause_model_deployment_monitoring_job if parent_rpcs.respond_to? :pause_model_deployment_monitoring_job + @pause_model_deployment_monitoring_job = ::Gapic::Config::Method.new pause_model_deployment_monitoring_job_config + resume_model_deployment_monitoring_job_config = parent_rpcs.resume_model_deployment_monitoring_job if parent_rpcs.respond_to? :resume_model_deployment_monitoring_job + @resume_model_deployment_monitoring_job = ::Gapic::Config::Method.new resume_model_deployment_monitoring_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb new file mode 100644 index 000000000000..80010abef573 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + 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 JobService 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 JobService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb new file mode 100644 index 000000000000..2e9e6a6bf3f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb @@ -0,0 +1,2231 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/job_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + module Rest + ## + # REST service stub for the JobService 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_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest] + # 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::CustomJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # A result object deserialized from the server's reply + def create_custom_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_job_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_custom_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CustomJob.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_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetCustomJobRequest] + # 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::CustomJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # A result object deserialized from the server's reply + def get_custom_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_job_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_custom_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CustomJob.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_custom_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest] + # 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::ListCustomJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse] + # A result object deserialized from the server's reply + def list_custom_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_jobs_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_custom_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse.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_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest] + # 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_custom_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_job_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_custom_job", + 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 cancel_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest] + # 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_custom_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_custom_job_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_custom_job", + 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 create_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest] + # 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::DataLabelingJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # A result object deserialized from the server's reply + def create_data_labeling_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_data_labeling_job_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_data_labeling_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DataLabelingJob.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_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest] + # 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::DataLabelingJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # A result object deserialized from the server's reply + def get_data_labeling_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_data_labeling_job_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_data_labeling_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DataLabelingJob.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_data_labeling_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest] + # 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::ListDataLabelingJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsResponse] + # A result object deserialized from the server's reply + def list_data_labeling_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_labeling_jobs_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_data_labeling_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsResponse.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_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest] + # 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_data_labeling_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_labeling_job_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_data_labeling_job", + 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 cancel_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest] + # 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_data_labeling_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_data_labeling_job_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_data_labeling_job", + 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 create_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest] + # 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::HyperparameterTuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # A result object deserialized from the server's reply + def create_hyperparameter_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_hyperparameter_tuning_job_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_hyperparameter_tuning_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob.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_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest] + # 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::HyperparameterTuningJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # A result object deserialized from the server's reply + def get_hyperparameter_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_hyperparameter_tuning_job_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_hyperparameter_tuning_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob.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_hyperparameter_tuning_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest] + # 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::ListHyperparameterTuningJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse] + # A result object deserialized from the server's reply + def list_hyperparameter_tuning_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_hyperparameter_tuning_jobs_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_hyperparameter_tuning_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse.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_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_hyperparameter_tuning_job_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_hyperparameter_tuning_job", + 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 cancel_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_hyperparameter_tuning_job_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_hyperparameter_tuning_job", + 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 create_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNasJobRequest] + # 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::NasJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # A result object deserialized from the server's reply + def create_nas_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_nas_job_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_nas_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NasJob.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_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNasJobRequest] + # 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::NasJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # A result object deserialized from the server's reply + def get_nas_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_nas_job_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_nas_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NasJob.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_nas_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNasJobsRequest] + # 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::ListNasJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListNasJobsResponse] + # A result object deserialized from the server's reply + def list_nas_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_nas_jobs_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_nas_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListNasJobsResponse.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_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest] + # 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_nas_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_nas_job_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_nas_job", + 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 cancel_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelNasJobRequest] + # 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_nas_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_nas_job_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_nas_job", + 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 get_nas_trial_detail REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest] + # 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::NasTrialDetail] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NasTrialDetail] + # A result object deserialized from the server's reply + def get_nas_trial_detail request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_nas_trial_detail_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_nas_trial_detail", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NasTrialDetail.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_nas_trial_details REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest] + # 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::ListNasTrialDetailsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse] + # A result object deserialized from the server's reply + def list_nas_trial_details request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_nas_trial_details_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_nas_trial_details", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest] + # 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::BatchPredictionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # A result object deserialized from the server's reply + def create_batch_prediction_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_batch_prediction_job_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_batch_prediction_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchPredictionJob.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_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest] + # 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::BatchPredictionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # A result object deserialized from the server's reply + def get_batch_prediction_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_batch_prediction_job_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_batch_prediction_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchPredictionJob.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_batch_prediction_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest] + # 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::ListBatchPredictionJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse] + # A result object deserialized from the server's reply + def list_batch_prediction_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_batch_prediction_jobs_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_batch_prediction_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse.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_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest] + # 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_batch_prediction_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_batch_prediction_job_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_batch_prediction_job", + 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 cancel_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest] + # 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_batch_prediction_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_batch_prediction_job_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_batch_prediction_job", + 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 create_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest] + # 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::ModelDeploymentMonitoringJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # A result object deserialized from the server's reply + def create_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_model_deployment_monitoring_job_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_model_deployment_monitoring_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_model_deployment_monitoring_stats_anomalies REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest] + # 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::SearchModelDeploymentMonitoringStatsAnomaliesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesResponse] + # A result object deserialized from the server's reply + def search_model_deployment_monitoring_stats_anomalies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_model_deployment_monitoring_stats_anomalies_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: "search_model_deployment_monitoring_stats_anomalies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesResponse.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_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest] + # 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::ModelDeploymentMonitoringJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # A result object deserialized from the server's reply + def get_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_deployment_monitoring_job_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_model_deployment_monitoring_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob.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_model_deployment_monitoring_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest] + # 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::ListModelDeploymentMonitoringJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsResponse] + # A result object deserialized from the server's reply + def list_model_deployment_monitoring_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_model_deployment_monitoring_jobs_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_model_deployment_monitoring_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsResponse.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_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_model_deployment_monitoring_job_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_model_deployment_monitoring_job", + 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_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest] + # 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_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_deployment_monitoring_job_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_model_deployment_monitoring_job", + 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 pause_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest] + # 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 pause_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_model_deployment_monitoring_job_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: "pause_model_deployment_monitoring_job", + 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 resume_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest] + # 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 resume_model_deployment_monitoring_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_model_deployment_monitoring_job_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: "resume_model_deployment_monitoring_job", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest] + # 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_custom_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customJobs", + body: "custom_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetCustomJobRequest] + # 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_custom_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest] + # 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_custom_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest] + # 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_custom_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_custom_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest] + # 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_custom_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest] + # 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_data_labeling_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dataLabelingJobs", + body: "data_labeling_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest] + # 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_data_labeling_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_labeling_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest] + # 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_data_labeling_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dataLabelingJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest] + # 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_data_labeling_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_data_labeling_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest] + # 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_data_labeling_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/hyperparameterTuningJobs", + body: "hyperparameter_tuning_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_hyperparameter_tuning_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest] + # 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_hyperparameter_tuning_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/hyperparameterTuningJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_hyperparameter_tuning_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest] + # 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_hyperparameter_tuning_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNasJobRequest] + # 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_nas_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/nasJobs", + body: "nas_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNasJobRequest] + # 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_nas_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/nasJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_nas_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNasJobsRequest] + # 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_nas_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/nasJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest] + # 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_nas_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/nasJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_nas_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelNasJobRequest] + # 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_nas_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/nasJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_nas_trial_detail REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest] + # 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_nas_trial_detail_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/nasJobs/[^/]+/nasTrialDetails/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_nas_trial_details REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest] + # 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_nas_trial_details_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/nasTrialDetails", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/nasJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest] + # 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_batch_prediction_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/batchPredictionJobs", + body: "batch_prediction_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest] + # 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_batch_prediction_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/batchPredictionJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_batch_prediction_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest] + # 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_batch_prediction_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/batchPredictionJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest] + # 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_batch_prediction_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/batchPredictionJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_batch_prediction_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest] + # 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_batch_prediction_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/batchPredictionJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest] + # 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_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/modelDeploymentMonitoringJobs", + body: "model_deployment_monitoring_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_model_deployment_monitoring_stats_anomalies REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_model_deployment_monitoring_stats_anomalies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model_deployment_monitoring_job}:searchModelDeploymentMonitoringStatsAnomalies", + body: "*", + matches: [ + ["model_deployment_monitoring_job", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest] + # 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_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_model_deployment_monitoring_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest] + # 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_model_deployment_monitoring_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/modelDeploymentMonitoringJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest] + # 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_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{model_deployment_monitoring_job.name}", + body: "model_deployment_monitoring_job", + matches: [ + ["model_deployment_monitoring_job.name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest] + # 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_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_model_deployment_monitoring_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_model_deployment_monitoring_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service.rb new file mode 100644 index 000000000000..3d35e75dc2cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/llm_utility_service/credentials" +require "google/cloud/ai_platform/v1/llm_utility_service/paths" +require "google/cloud/ai_platform/v1/llm_utility_service/client" +require "google/cloud/ai_platform/v1/llm_utility_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for LLM related utility functions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/llm_utility_service" + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/llm_utility_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.new + # + module LlmUtilityService + end + end + end + end +end + +helper_path = ::File.join __dir__, "llm_utility_service", "helpers.rb" +require "google/cloud/ai_platform/v1/llm_utility_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb new file mode 100644 index 000000000000..01563ae78fc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb @@ -0,0 +1,610 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/llm_utility_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + ## + # Client for the LlmUtilityService service. + # + # Service for LLM related utility functions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :llm_utility_service_stub + + ## + # Configure the LlmUtilityService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LlmUtilityService clients + # ::Google::Cloud::AIPlatform::V1::LlmUtilityService::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 LlmUtilityService 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::LlmUtilityService::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 + @llm_utility_service_stub.universe_domain + end + + ## + # Create a new LlmUtilityService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LlmUtilityService 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/llm_utility_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 + + @llm_utility_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::LlmUtilityService::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 + ) + + @llm_utility_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 = @llm_utility_service_stub.endpoint + config.universe_domain = @llm_utility_service_stub.universe_domain + config.logger = @llm_utility_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 = @llm_utility_service_stub.endpoint + config.universe_domain = @llm_utility_service_stub.universe_domain + config.logger = @llm_utility_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @llm_utility_service_stub.logger + end + + # Service calls + + ## + # Perform a token counting. + # + # @overload count_tokens(request, options = nil) + # Pass arguments to `count_tokens` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CountTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CountTokensRequest, ::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 count_tokens(endpoint: nil, model: nil, instances: nil, contents: nil, system_instruction: nil, tools: nil, generation_config: nil) + # Pass arguments to `count_tokens` 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 endpoint [::String] + # Required. The name of the Endpoint requested to perform token counting. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param model [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Optional. The instances that are the input to token counting call. + # Schema is identical to the prediction schema of the underlying model. + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config that the model will use to generate the + # response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CountTokensResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CountTokensResponse] + # + # @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::LlmUtilityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CountTokensRequest.new + # + # # Call the count_tokens method. + # result = client.count_tokens request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CountTokensResponse. + # p result + # + def count_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CountTokensRequest + + # 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.count_tokens.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.endpoint + header_params["endpoint"] = request.endpoint + 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.count_tokens.timeout, + metadata: metadata, + retry_policy: @config.rpcs.count_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @llm_utility_service_stub.call_rpc :count_tokens, 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 + + ## + # Return a list of tokens based on the input text. + # + # @overload compute_tokens(request, options = nil) + # Pass arguments to `compute_tokens` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ComputeTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ComputeTokensRequest, ::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 compute_tokens(endpoint: nil, instances: nil, model: nil, contents: nil) + # Pass arguments to `compute_tokens` 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 endpoint [::String] + # Required. The name of the Endpoint requested to get lists of tokens and + # token ids. + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Optional. The instances that are the input to token computing API call. + # Schema is identical to the prediction schema of the text model, even for + # the non-text models, like chat models, or Codey models. + # @param model [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # projects/\\{project}/locations/\\{location}/publishers/*/models/* + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ComputeTokensResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ComputeTokensResponse] + # + # @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::LlmUtilityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ComputeTokensRequest.new + # + # # Call the compute_tokens method. + # result = client.compute_tokens request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ComputeTokensResponse. + # p result + # + def compute_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ComputeTokensRequest + + # 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.compute_tokens.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.endpoint + header_params["endpoint"] = request.endpoint + 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.compute_tokens.timeout, + metadata: metadata, + retry_policy: @config.rpcs.compute_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @llm_utility_service_stub.call_rpc :compute_tokens, 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 LlmUtilityService API. + # + # This class represents the configuration for LlmUtilityService, + # 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::LlmUtilityService::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 + # # count_tokens to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.count_tokens.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.count_tokens.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the LlmUtilityService 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 `count_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :count_tokens + ## + # RPC-specific configuration for `compute_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_tokens + + # @private + def initialize parent_rpcs = nil + count_tokens_config = parent_rpcs.count_tokens if parent_rpcs.respond_to? :count_tokens + @count_tokens = ::Gapic::Config::Method.new count_tokens_config + compute_tokens_config = parent_rpcs.compute_tokens if parent_rpcs.respond_to? :compute_tokens + @compute_tokens = ::Gapic::Config::Method.new compute_tokens_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/credentials.rb new file mode 100644 index 000000000000..280e48df3e8f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + # Credentials for the LlmUtilityService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb new file mode 100644 index 000000000000..0ca65aafd940 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + # Path helper methods for the LlmUtilityService API. + module Paths + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified RagCorpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # + # @return [::String] + def rag_corpus_path project:, location:, rag_corpus: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb new file mode 100644 index 000000000000..f47939b6c3ec --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/llm_utility_service/credentials" +require "google/cloud/ai_platform/v1/llm_utility_service/paths" +require "google/cloud/ai_platform/v1/llm_utility_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for LLM related utility functions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/llm_utility_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.new + # + module LlmUtilityService + # 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/llm_utility_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb new file mode 100644 index 000000000000..3be0bf6247d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb @@ -0,0 +1,579 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/llm_utility_service_pb" +require "google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + module Rest + ## + # REST client for the LlmUtilityService service. + # + # Service for LLM related utility functions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :llm_utility_service_stub + + ## + # Configure the LlmUtilityService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LlmUtilityService clients + # ::Google::Cloud::AIPlatform::V1::LlmUtilityService::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 LlmUtilityService 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::LlmUtilityService::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 + @llm_utility_service_stub.universe_domain + end + + ## + # Create a new LlmUtilityService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LlmUtilityService 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 + + @llm_utility_service_stub = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @llm_utility_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 = @llm_utility_service_stub.endpoint + config.universe_domain = @llm_utility_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @llm_utility_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 = @llm_utility_service_stub.endpoint + config.universe_domain = @llm_utility_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @llm_utility_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @llm_utility_service_stub.logger + end + + # Service calls + + ## + # Perform a token counting. + # + # @overload count_tokens(request, options = nil) + # Pass arguments to `count_tokens` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CountTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CountTokensRequest, ::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 count_tokens(endpoint: nil, model: nil, instances: nil, contents: nil, system_instruction: nil, tools: nil, generation_config: nil) + # Pass arguments to `count_tokens` 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 endpoint [::String] + # Required. The name of the Endpoint requested to perform token counting. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param model [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Optional. The instances that are the input to token counting call. + # Schema is identical to the prediction schema of the underlying model. + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config that the model will use to generate the + # response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CountTokensResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CountTokensResponse] + # + # @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::LlmUtilityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CountTokensRequest.new + # + # # Call the count_tokens method. + # result = client.count_tokens request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CountTokensResponse. + # p result + # + def count_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CountTokensRequest + + # 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.count_tokens.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.count_tokens.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.count_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @llm_utility_service_stub.count_tokens 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 + + ## + # Return a list of tokens based on the input text. + # + # @overload compute_tokens(request, options = nil) + # Pass arguments to `compute_tokens` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ComputeTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ComputeTokensRequest, ::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 compute_tokens(endpoint: nil, instances: nil, model: nil, contents: nil) + # Pass arguments to `compute_tokens` 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 endpoint [::String] + # Required. The name of the Endpoint requested to get lists of tokens and + # token ids. + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Optional. The instances that are the input to token computing API call. + # Schema is identical to the prediction schema of the text model, even for + # the non-text models, like chat models, or Codey models. + # @param model [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # projects/\\{project}/locations/\\{location}/publishers/*/models/* + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ComputeTokensResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ComputeTokensResponse] + # + # @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::LlmUtilityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ComputeTokensRequest.new + # + # # Call the compute_tokens method. + # result = client.compute_tokens request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ComputeTokensResponse. + # p result + # + def compute_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ComputeTokensRequest + + # 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.compute_tokens.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.compute_tokens.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.compute_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @llm_utility_service_stub.compute_tokens 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 LlmUtilityService REST API. + # + # This class represents the configuration for LlmUtilityService 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::LlmUtilityService::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 + # # count_tokens to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.count_tokens.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.count_tokens.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the LlmUtilityService 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 `count_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :count_tokens + ## + # RPC-specific configuration for `compute_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_tokens + + # @private + def initialize parent_rpcs = nil + count_tokens_config = parent_rpcs.count_tokens if parent_rpcs.respond_to? :count_tokens + @count_tokens = ::Gapic::Config::Method.new count_tokens_config + compute_tokens_config = parent_rpcs.compute_tokens if parent_rpcs.respond_to? :compute_tokens + @compute_tokens = ::Gapic::Config::Method.new compute_tokens_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb new file mode 100644 index 000000000000..90d73045010f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/llm_utility_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + module Rest + ## + # REST service stub for the LlmUtilityService 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 count_tokens REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CountTokensRequest] + # 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::CountTokensResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CountTokensResponse] + # A result object deserialized from the server's reply + def count_tokens request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_count_tokens_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: "count_tokens", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CountTokensResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the compute_tokens REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ComputeTokensRequest] + # 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::ComputeTokensResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ComputeTokensResponse] + # A result object deserialized from the server's reply + def compute_tokens request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_compute_tokens_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: "compute_tokens", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ComputeTokensResponse.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 count_tokens REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CountTokensRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_count_tokens_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:countTokens", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:countTokens", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:countTokens", + body: "*", + matches: [ + ["endpoint", %r{^endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:countTokens", + body: "*", + matches: [ + ["endpoint", %r{^publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the compute_tokens REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ComputeTokensRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_compute_tokens_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:computeTokens", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:computeTokens", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:computeTokens", + body: "*", + matches: [ + ["endpoint", %r{^endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:computeTokens", + body: "*", + matches: [ + ["endpoint", %r{^publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service.rb new file mode 100644 index 000000000000..c5c7723701a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/match_service/credentials" +require "google/cloud/ai_platform/v1/match_service/paths" +require "google/cloud/ai_platform/v1/match_service/client" +require "google/cloud/ai_platform/v1/match_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/match_service" + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/match_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.new + # + module MatchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "match_service", "helpers.rb" +require "google/cloud/ai_platform/v1/match_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/client.rb new file mode 100644 index 000000000000..2a2552c807e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/client.rb @@ -0,0 +1,598 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/match_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + ## + # Client for the MatchService service. + # + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :match_service_stub + + ## + # Configure the MatchService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MatchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MatchService clients + # ::Google::Cloud::AIPlatform::V1::MatchService::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 MatchService 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::MatchService::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 + @match_service_stub.universe_domain + end + + ## + # Create a new MatchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MatchService 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/match_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 + + @match_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::MatchService::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 + ) + + @match_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 = @match_service_stub.endpoint + config.universe_domain = @match_service_stub.universe_domain + config.logger = @match_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 = @match_service_stub.endpoint + config.universe_domain = @match_service_stub.universe_domain + config.logger = @match_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @match_service_stub.logger + end + + # Service calls + + ## + # Finds the nearest neighbors of each vector within the request. + # + # @overload find_neighbors(request, options = nil) + # Pass arguments to `find_neighbors` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::FindNeighborsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest, ::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 find_neighbors(index_endpoint: nil, deployed_index_id: nil, queries: nil, return_full_datapoint: nil) + # Pass arguments to `find_neighbors` 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 index_endpoint [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # The ID of the DeployedIndex that will serve the request. This request is + # sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + # IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + # has a DeployedIndex.id field. + # The value of the field below must equal one of the DeployedIndex.id + # fields of the IndexEndpoint that is being called for this request. + # @param queries [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsRequest::Query, ::Hash>] + # The list of queries. + # @param return_full_datapoint [::Boolean] + # If set to true, the full datapoints (including all vector values and + # restricts) of the nearest neighbors are returned. + # Note that returning full datapoint will significantly increase the + # latency and cost of the query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse] + # + # @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::MatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::FindNeighborsRequest.new + # + # # Call the find_neighbors method. + # result = client.find_neighbors request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FindNeighborsResponse. + # p result + # + def find_neighbors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::FindNeighborsRequest + + # 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.find_neighbors.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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.find_neighbors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.find_neighbors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @match_service_stub.call_rpc :find_neighbors, 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 + + ## + # Reads the datapoints/vectors of the given IDs. + # A maximum of 1000 datapoints can be retrieved in a batch. + # + # @overload read_index_datapoints(request, options = nil) + # Pass arguments to `read_index_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest, ::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 read_index_datapoints(index_endpoint: nil, deployed_index_id: nil, ids: nil) + # Pass arguments to `read_index_datapoints` 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 index_endpoint [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # The ID of the DeployedIndex that will serve the request. + # @param ids [::Array<::String>] + # IDs of the datapoints to be searched for. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse] + # + # @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::MatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest.new + # + # # Call the read_index_datapoints method. + # result = client.read_index_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse. + # p result + # + def read_index_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest + + # 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.read_index_datapoints.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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.read_index_datapoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_index_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @match_service_stub.call_rpc :read_index_datapoints, 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 MatchService API. + # + # This class represents the configuration for MatchService, + # 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::MatchService::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 + # # find_neighbors to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MatchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.find_neighbors.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.find_neighbors.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the MatchService 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 `find_neighbors` + # @return [::Gapic::Config::Method] + # + attr_reader :find_neighbors + ## + # RPC-specific configuration for `read_index_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :read_index_datapoints + + # @private + def initialize parent_rpcs = nil + find_neighbors_config = parent_rpcs.find_neighbors if parent_rpcs.respond_to? :find_neighbors + @find_neighbors = ::Gapic::Config::Method.new find_neighbors_config + read_index_datapoints_config = parent_rpcs.read_index_datapoints if parent_rpcs.respond_to? :read_index_datapoints + @read_index_datapoints = ::Gapic::Config::Method.new read_index_datapoints_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/credentials.rb new file mode 100644 index 000000000000..37724a173171 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + # Credentials for the MatchService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/paths.rb new file mode 100644 index 000000000000..9ac65265287c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + # Path helper methods for the MatchService API. + module Paths + ## + # Create a fully-qualified IndexEndpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @param project [String] + # @param location [String] + # @param index_endpoint [String] + # + # @return [::String] + def index_endpoint_path project:, location:, index_endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest.rb new file mode 100644 index 000000000000..3768c84eda22 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/match_service/credentials" +require "google/cloud/ai_platform/v1/match_service/paths" +require "google/cloud/ai_platform/v1/match_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/match_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.new + # + module MatchService + # 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/match_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb new file mode 100644 index 000000000000..ada638c36522 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb @@ -0,0 +1,567 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/match_service_pb" +require "google/cloud/ai_platform/v1/match_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + module Rest + ## + # REST client for the MatchService service. + # + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :match_service_stub + + ## + # Configure the MatchService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MatchService clients + # ::Google::Cloud::AIPlatform::V1::MatchService::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 MatchService 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::MatchService::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 + @match_service_stub.universe_domain + end + + ## + # Create a new MatchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MatchService 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 + + @match_service_stub = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @match_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 = @match_service_stub.endpoint + config.universe_domain = @match_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @match_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 = @match_service_stub.endpoint + config.universe_domain = @match_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @match_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @match_service_stub.logger + end + + # Service calls + + ## + # Finds the nearest neighbors of each vector within the request. + # + # @overload find_neighbors(request, options = nil) + # Pass arguments to `find_neighbors` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::FindNeighborsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest, ::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 find_neighbors(index_endpoint: nil, deployed_index_id: nil, queries: nil, return_full_datapoint: nil) + # Pass arguments to `find_neighbors` 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 index_endpoint [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # The ID of the DeployedIndex that will serve the request. This request is + # sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + # IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + # has a DeployedIndex.id field. + # The value of the field below must equal one of the DeployedIndex.id + # fields of the IndexEndpoint that is being called for this request. + # @param queries [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsRequest::Query, ::Hash>] + # The list of queries. + # @param return_full_datapoint [::Boolean] + # If set to true, the full datapoints (including all vector values and + # restricts) of the nearest neighbors are returned. + # Note that returning full datapoint will significantly increase the + # latency and cost of the query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse] + # + # @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::MatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::FindNeighborsRequest.new + # + # # Call the find_neighbors method. + # result = client.find_neighbors request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::FindNeighborsResponse. + # p result + # + def find_neighbors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::FindNeighborsRequest + + # 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.find_neighbors.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.find_neighbors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.find_neighbors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @match_service_stub.find_neighbors 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 + + ## + # Reads the datapoints/vectors of the given IDs. + # A maximum of 1000 datapoints can be retrieved in a batch. + # + # @overload read_index_datapoints(request, options = nil) + # Pass arguments to `read_index_datapoints` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest, ::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 read_index_datapoints(index_endpoint: nil, deployed_index_id: nil, ids: nil) + # Pass arguments to `read_index_datapoints` 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 index_endpoint [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index_id [::String] + # The ID of the DeployedIndex that will serve the request. + # @param ids [::Array<::String>] + # IDs of the datapoints to be searched for. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse] + # + # @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::MatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest.new + # + # # Call the read_index_datapoints method. + # result = client.read_index_datapoints request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse. + # p result + # + def read_index_datapoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest + + # 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.read_index_datapoints.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.read_index_datapoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_index_datapoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @match_service_stub.read_index_datapoints 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 MatchService REST API. + # + # This class represents the configuration for MatchService 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::MatchService::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 + # # find_neighbors to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.find_neighbors.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MatchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.find_neighbors.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the MatchService 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 `find_neighbors` + # @return [::Gapic::Config::Method] + # + attr_reader :find_neighbors + ## + # RPC-specific configuration for `read_index_datapoints` + # @return [::Gapic::Config::Method] + # + attr_reader :read_index_datapoints + + # @private + def initialize parent_rpcs = nil + find_neighbors_config = parent_rpcs.find_neighbors if parent_rpcs.respond_to? :find_neighbors + @find_neighbors = ::Gapic::Config::Method.new find_neighbors_config + read_index_datapoints_config = parent_rpcs.read_index_datapoints if parent_rpcs.respond_to? :read_index_datapoints + @read_index_datapoints = ::Gapic::Config::Method.new read_index_datapoints_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb new file mode 100644 index 000000000000..9e334d7111f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/match_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + module Rest + ## + # REST service stub for the MatchService 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 find_neighbors REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest] + # 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::FindNeighborsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse] + # A result object deserialized from the server's reply + def find_neighbors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_find_neighbors_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: "find_neighbors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::FindNeighborsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the read_index_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest] + # 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::ReadIndexDatapointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse] + # A result object deserialized from the server's reply + def read_index_datapoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_index_datapoints_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: "read_index_datapoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse.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 find_neighbors REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_find_neighbors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:findNeighbors", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the read_index_datapoints REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_index_datapoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:readIndexDatapoints", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service.rb new file mode 100644 index 000000000000..e01393a3e44d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/metadata_service/credentials" +require "google/cloud/ai_platform/v1/metadata_service/paths" +require "google/cloud/ai_platform/v1/metadata_service/operations" +require "google/cloud/ai_platform/v1/metadata_service/client" +require "google/cloud/ai_platform/v1/metadata_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for reading and writing metadata entries. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/metadata_service" + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/metadata_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.new + # + module MetadataService + end + end + end + end +end + +helper_path = ::File.join __dir__, "metadata_service", "helpers.rb" +require "google/cloud/ai_platform/v1/metadata_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb new file mode 100644 index 000000000000..4a7792f198fd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb @@ -0,0 +1,3884 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/metadata_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + ## + # Client for the MetadataService service. + # + # Service for reading and writing metadata entries. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :metadata_service_stub + + ## + # Configure the MetadataService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MetadataService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MetadataService clients + # ::Google::Cloud::AIPlatform::V1::MetadataService::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 MetadataService 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::MetadataService::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 + @metadata_service_stub.universe_domain + end + + ## + # Create a new MetadataService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MetadataService 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/metadata_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 + + @metadata_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::MetadataService::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 + ) + + @metadata_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 = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + config.logger = @metadata_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 = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + config.logger = @metadata_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataService::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 + @metadata_service_stub.logger + end + + # Service calls + + ## + # Initializes a MetadataStore, including allocation of resources. + # + # @overload create_metadata_store(request, options = nil) + # Pass arguments to `create_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest, ::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_metadata_store(parent: nil, metadata_store: nil, metadata_store_id: nil) + # Pass arguments to `create_metadata_store` 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 where the MetadataStore should + # be created. + # Format: `projects/{project}/locations/{location}/` + # @param metadata_store [::Google::Cloud::AIPlatform::V1::MetadataStore, ::Hash] + # Required. The MetadataStore to create. + # @param metadata_store_id [::String] + # The \\{metadatastore} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataStores in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataStore.) + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest.new + # + # # Call the create_metadata_store method. + # result = client.create_metadata_store 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_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :create_metadata_store, 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 + + ## + # Retrieves a specific MetadataStore. + # + # @overload get_metadata_store(request, options = nil) + # Pass arguments to `get_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest, ::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_metadata_store(name: nil) + # Pass arguments to `get_metadata_store` 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 MetadataStore to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::MetadataStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest.new + # + # # Call the get_metadata_store method. + # result = client.get_metadata_store request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataStore. + # p result + # + def get_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :get_metadata_store, 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 MetadataStores for a Location. + # + # @overload list_metadata_stores(request, options = nil) + # Pass arguments to `list_metadata_stores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest, ::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_metadata_stores(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_metadata_stores` 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 Location whose MetadataStores should be listed. + # Format: + # `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of Metadata Stores to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_stores MetadataService.ListMetadataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataStore>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataStore>] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest.new + # + # # Call the list_metadata_stores method. + # result = client.list_metadata_stores 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::MetadataStore. + # p item + # end + # + def list_metadata_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest + + # 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_metadata_stores.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_metadata_stores.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_metadata_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :list_metadata_stores, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_metadata_stores, 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 + + ## + # Deletes a single MetadataStore and all its child resources (Artifacts, + # Executions, and Contexts). + # + # @overload delete_metadata_store(request, options = nil) + # Pass arguments to `delete_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest, ::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_metadata_store(name: nil, force: nil) + # Pass arguments to `delete_metadata_store` 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 MetadataStore to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param force [::Boolean] + # Deprecated: Field is no longer supported. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest.new + # + # # Call the delete_metadata_store method. + # result = client.delete_metadata_store 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_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :delete_metadata_store, 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 + + ## + # Creates an Artifact associated with a MetadataStore. + # + # @overload create_artifact(request, options = nil) + # Pass arguments to `create_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateArtifactRequest, ::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_artifact(parent: nil, artifact: nil, artifact_id: nil) + # Pass arguments to `create_artifact` 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 MetadataStore where the Artifact should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param artifact [::Google::Cloud::AIPlatform::V1::Artifact, ::Hash] + # Required. The Artifact to create. + # @param artifact_id [::String] + # The \\{artifact} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # If not provided, the Artifact's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Artifact.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateArtifactRequest.new + # + # # Call the create_artifact method. + # result = client.create_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def create_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :create_artifact, 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 + + ## + # Retrieves a specific Artifact. + # + # @overload get_artifact(request, options = nil) + # Pass arguments to `get_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetArtifactRequest, ::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_artifact(name: nil) + # Pass arguments to `get_artifact` 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 Artifact to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetArtifactRequest.new + # + # # Call the get_artifact method. + # result = client.get_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def get_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :get_artifact, 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 Artifacts in the MetadataStore. + # + # @overload list_artifacts(request, options = nil) + # Pass arguments to `list_artifacts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListArtifactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListArtifactsRequest, ::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_artifacts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_artifacts` 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 MetadataStore whose Artifacts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Artifacts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_artifacts MetadataService.ListArtifacts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Artifacts based on the contexts to which they belong, use the + # function operator with the full resource name + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Artifact>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Artifact>] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListArtifactsRequest.new + # + # # Call the list_artifacts method. + # result = client.list_artifacts 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::Artifact. + # p item + # end + # + def list_artifacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListArtifactsRequest + + # 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_artifacts.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_artifacts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_artifacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :list_artifacts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_artifacts, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Artifact. + # + # @overload update_artifact(request, options = nil) + # Pass arguments to `update_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest, ::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_artifact(artifact: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_artifact` 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 artifact [::Google::Cloud::AIPlatform::V1::Artifact, ::Hash] + # Required. The Artifact containing updates. + # The Artifact's {::Google::Cloud::AIPlatform::V1::Artifact#name Artifact.name} + # field is used to identify the Artifact to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateArtifactRequest.new + # + # # Call the update_artifact method. + # result = client.update_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def update_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest + + # 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_artifact.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.artifact&.name + header_params["artifact.name"] = request.artifact.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_artifact.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :update_artifact, 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 an Artifact. + # + # @overload delete_artifact(request, options = nil) + # Pass arguments to `delete_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest, ::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_artifact(name: nil, etag: nil) + # Pass arguments to `delete_artifact` 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 Artifact to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param etag [::String] + # Optional. The etag of the Artifact to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteArtifactRequest.new + # + # # Call the delete_artifact method. + # result = client.delete_artifact 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_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :delete_artifact, 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 + + ## + # Purges Artifacts. + # + # @overload purge_artifacts(request, options = nil) + # Pass arguments to `purge_artifacts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest, ::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 purge_artifacts(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_artifacts` 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 metadata store to purge Artifacts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Artifacts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Artifact names that would be deleted. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest.new + # + # # Call the purge_artifacts method. + # result = client.purge_artifacts 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 purge_artifacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest + + # 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.purge_artifacts.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.purge_artifacts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_artifacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :purge_artifacts, 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 + + ## + # Creates a Context associated with a MetadataStore. + # + # @overload create_context(request, options = nil) + # Pass arguments to `create_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateContextRequest, ::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_context(parent: nil, context: nil, context_id: nil) + # Pass arguments to `create_context` 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 MetadataStore where the Context should + # be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param context [::Google::Cloud::AIPlatform::V1::Context, ::Hash] + # Required. The Context to create. + # @param context_id [::String] + # The \\{context} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + # If not provided, the Context's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Contexts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Context.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateContextRequest.new + # + # # Call the create_context method. + # result = client.create_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def create_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateContextRequest + + # 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_context.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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :create_context, 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 + + ## + # Retrieves a specific Context. + # + # @overload get_context(request, options = nil) + # Pass arguments to `get_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetContextRequest, ::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_context(name: nil) + # Pass arguments to `get_context` 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 Context to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetContextRequest.new + # + # # Call the get_context method. + # result = client.get_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def get_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetContextRequest + + # 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_context.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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :get_context, 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 Contexts on the MetadataStore. + # + # @overload list_contexts(request, options = nil) + # Pass arguments to `list_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListContextsRequest, ::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_contexts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_contexts` 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 MetadataStore whose Contexts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Contexts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_contexts MetadataService.ListContexts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Contexts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `schema_title`, + # `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0`. + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Parent Child filtering**: + # To filter Contexts based on parent-child relationship use the HAS + # operator as follows: + # + # ``` + # parent_contexts: + # "projects//locations//metadataStores//contexts/" + # child_contexts: + # "projects//locations//metadataStores//contexts/" + # ``` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Context>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Context>] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListContextsRequest.new + # + # # Call the list_contexts method. + # result = client.list_contexts 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::Context. + # p item + # end + # + def list_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListContextsRequest + + # 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_contexts.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_contexts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :list_contexts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_contexts, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Context. + # + # @overload update_context(request, options = nil) + # Pass arguments to `update_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateContextRequest, ::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_context(context: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_context` 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 context [::Google::Cloud::AIPlatform::V1::Context, ::Hash] + # Required. The Context containing updates. + # The Context's {::Google::Cloud::AIPlatform::V1::Context#name Context.name} field + # is used to identify the Context to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Context Context} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Context Context} is created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateContextRequest.new + # + # # Call the update_context method. + # result = client.update_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def update_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateContextRequest + + # 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_context.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.context&.name + header_params["context.name"] = request.context.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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :update_context, 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 a stored Context. + # + # @overload delete_context(request, options = nil) + # Pass arguments to `delete_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteContextRequest, ::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_context(name: nil, force: nil, etag: nil) + # Pass arguments to `delete_context` 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 Context to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param force [::Boolean] + # The force deletion semantics is still undefined. + # Users should not use this field. + # @param etag [::String] + # Optional. The etag of the Context to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteContextRequest.new + # + # # Call the delete_context method. + # result = client.delete_context 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_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteContextRequest + + # 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_context.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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :delete_context, 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 + + ## + # Purges Contexts. + # + # @overload purge_contexts(request, options = nil) + # Pass arguments to `purge_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeContextsRequest, ::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 purge_contexts(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_contexts` 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 metadata store to purge Contexts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Contexts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Context names that would be deleted. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeContextsRequest.new + # + # # Call the purge_contexts method. + # result = client.purge_contexts 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 purge_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeContextsRequest + + # 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.purge_contexts.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.purge_contexts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :purge_contexts, 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 + + ## + # Adds a set of Artifacts and Executions to a Context. If any of the + # Artifacts or Executions have already been added to a Context, they are + # simply skipped. + # + # @overload add_context_artifacts_and_executions(request, options = nil) + # Pass arguments to `add_context_artifacts_and_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest, ::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 add_context_artifacts_and_executions(context: nil, artifacts: nil, executions: nil) + # Pass arguments to `add_context_artifacts_and_executions` 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 context [::String] + # Required. The resource name of the Context that the Artifacts and + # Executions belong to. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param artifacts [::Array<::String>] + # The resource names of the Artifacts to attribute to the Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param executions [::Array<::String>] + # The resource names of the Executions to associate with the + # Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest.new + # + # # Call the add_context_artifacts_and_executions method. + # result = client.add_context_artifacts_and_executions request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse. + # p result + # + def add_context_artifacts_and_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest + + # 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.add_context_artifacts_and_executions.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.context + header_params["context"] = request.context + 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.add_context_artifacts_and_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_context_artifacts_and_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :add_context_artifacts_and_executions, 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 + + ## + # Adds a set of Contexts as children to a parent Context. If any of the + # child Contexts have already been added to the parent Context, they are + # simply skipped. If this call would create a cycle or cause any Context to + # have more than 10 parents, the request will fail with an INVALID_ARGUMENT + # error. + # + # @overload add_context_children(request, options = nil) + # Pass arguments to `add_context_children` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest, ::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 add_context_children(context: nil, child_contexts: nil) + # Pass arguments to `add_context_children` 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 context [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param child_contexts [::Array<::String>] + # The resource names of the child Contexts. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddContextChildrenRequest.new + # + # # Call the add_context_children method. + # result = client.add_context_children request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextChildrenResponse. + # p result + # + def add_context_children request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest + + # 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.add_context_children.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.context + header_params["context"] = request.context + 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.add_context_children.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_context_children.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :add_context_children, 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 + + ## + # Remove a set of children contexts from a parent Context. If any of the + # child Contexts were NOT added to the parent Context, they are + # simply skipped. + # + # @overload remove_context_children(request, options = nil) + # Pass arguments to `remove_context_children` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest, ::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 remove_context_children(context: nil, child_contexts: nil) + # Pass arguments to `remove_context_children` 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 context [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param child_contexts [::Array<::String>] + # The resource names of the child Contexts. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest.new + # + # # Call the remove_context_children method. + # result = client.remove_context_children request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse. + # p result + # + def remove_context_children request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest + + # 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.remove_context_children.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.context + header_params["context"] = request.context + 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.remove_context_children.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_context_children.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :remove_context_children, 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 + + ## + # Retrieves Artifacts and Executions within the specified Context, connected + # by Event edges and returned as a LineageSubgraph. + # + # @overload query_context_lineage_subgraph(request, options = nil) + # Pass arguments to `query_context_lineage_subgraph` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_context_lineage_subgraph(context: nil) + # Pass arguments to `query_context_lineage_subgraph` 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 context [::String] + # Required. The resource name of the Context whose Artifacts and Executions + # should be retrieved as a LineageSubgraph. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest.new + # + # # Call the query_context_lineage_subgraph method. + # result = client.query_context_lineage_subgraph request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_context_lineage_subgraph request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_context_lineage_subgraph.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.context + header_params["context"] = request.context + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_context_lineage_subgraph.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_context_lineage_subgraph.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :query_context_lineage_subgraph, 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 + + ## + # Creates an Execution associated with a MetadataStore. + # + # @overload create_execution(request, options = nil) + # Pass arguments to `create_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateExecutionRequest, ::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_execution(parent: nil, execution: nil, execution_id: nil) + # Pass arguments to `create_execution` 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 MetadataStore where the Execution should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param execution [::Google::Cloud::AIPlatform::V1::Execution, ::Hash] + # Required. The Execution to create. + # @param execution_id [::String] + # The \\{execution} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # If not provided, the Execution's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Executions in the parent MetadataStore. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting Execution.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateExecutionRequest.new + # + # # Call the create_execution method. + # result = client.create_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def create_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :create_execution, 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 + + ## + # Retrieves a specific Execution. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetExecutionRequest, ::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_execution(name: nil) + # Pass arguments to `get_execution` 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 Execution to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :get_execution, 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 Executions in the MetadataStore. + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListExecutionsRequest, ::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_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_executions` 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 MetadataStore whose Executions should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Executions to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_executions MetadataService.ListExecutions} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with an + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Executions to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..` + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Executions based on the contexts to which they belong use + # the function operator with the full resource name: + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Execution>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Execution>] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions 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::Execution. + # p item + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListExecutionsRequest + + # 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_executions.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_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :list_executions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_executions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Execution. + # + # @overload update_execution(request, options = nil) + # Pass arguments to `update_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest, ::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_execution(execution: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_execution` 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 execution [::Google::Cloud::AIPlatform::V1::Execution, ::Hash] + # Required. The Execution containing updates. + # The Execution's {::Google::Cloud::AIPlatform::V1::Execution#name Execution.name} + # field is used to identify the Execution to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Execution Execution} + # is not found, a new {::Google::Cloud::AIPlatform::V1::Execution Execution} is + # created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateExecutionRequest.new + # + # # Call the update_execution method. + # result = client.update_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def update_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest + + # 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_execution.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.execution&.name + header_params["execution.name"] = request.execution.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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :update_execution, 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 an Execution. + # + # @overload delete_execution(request, options = nil) + # Pass arguments to `delete_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest, ::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_execution(name: nil, etag: nil) + # Pass arguments to `delete_execution` 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 Execution to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param etag [::String] + # Optional. The etag of the Execution to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteExecutionRequest.new + # + # # Call the delete_execution method. + # result = client.delete_execution 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_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :delete_execution, 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 + + ## + # Purges Executions. + # + # @overload purge_executions(request, options = nil) + # Pass arguments to `purge_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest, ::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 purge_executions(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_executions` 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 metadata store to purge Executions from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Executions to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Execution names that would be deleted. + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest.new + # + # # Call the purge_executions method. + # result = client.purge_executions 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 purge_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest + + # 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.purge_executions.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.purge_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :purge_executions, 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 + + ## + # Adds Events to the specified Execution. An Event indicates whether an + # Artifact was used as an input or output for an Execution. If an Event + # already exists between the Execution and the Artifact, the Event is + # skipped. + # + # @overload add_execution_events(request, options = nil) + # Pass arguments to `add_execution_events` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest, ::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 add_execution_events(execution: nil, events: nil) + # Pass arguments to `add_execution_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 execution [::String] + # Required. The resource name of the Execution that the Events connect + # Artifacts with. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param events [::Array<::Google::Cloud::AIPlatform::V1::Event, ::Hash>] + # The Events to create and add. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest.new + # + # # Call the add_execution_events method. + # result = client.add_execution_events request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse. + # p result + # + def add_execution_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest + + # 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.add_execution_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.execution + header_params["execution"] = request.execution + 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.add_execution_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_execution_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :add_execution_events, 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 + + ## + # Obtains the set of input and output Artifacts for this Execution, in the + # form of LineageSubgraph that also contains the Execution and connecting + # Events. + # + # @overload query_execution_inputs_and_outputs(request, options = nil) + # Pass arguments to `query_execution_inputs_and_outputs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_execution_inputs_and_outputs(execution: nil) + # Pass arguments to `query_execution_inputs_and_outputs` 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 execution [::String] + # Required. The resource name of the Execution whose input and output + # Artifacts should be retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest.new + # + # # Call the query_execution_inputs_and_outputs method. + # result = client.query_execution_inputs_and_outputs request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_execution_inputs_and_outputs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_execution_inputs_and_outputs.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.execution + header_params["execution"] = request.execution + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_execution_inputs_and_outputs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_execution_inputs_and_outputs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :query_execution_inputs_and_outputs, 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 + + ## + # Creates a MetadataSchema. + # + # @overload create_metadata_schema(request, options = nil) + # Pass arguments to `create_metadata_schema` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest, ::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_metadata_schema(parent: nil, metadata_schema: nil, metadata_schema_id: nil) + # Pass arguments to `create_metadata_schema` 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 MetadataStore where the MetadataSchema + # should be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param metadata_schema [::Google::Cloud::AIPlatform::V1::MetadataSchema, ::Hash] + # Required. The MetadataSchema to create. + # @param metadata_schema_id [::String] + # The \\{metadata_schema} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataSchemas in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataSchema.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest.new + # + # # Call the create_metadata_schema method. + # result = client.create_metadata_schema request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + # p result + # + def create_metadata_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest + + # 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_metadata_schema.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_metadata_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_metadata_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :create_metadata_schema, 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 + + ## + # Retrieves a specific MetadataSchema. + # + # @overload get_metadata_schema(request, options = nil) + # Pass arguments to `get_metadata_schema` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest, ::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_metadata_schema(name: nil) + # Pass arguments to `get_metadata_schema` 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 MetadataSchema to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest.new + # + # # Call the get_metadata_schema method. + # result = client.get_metadata_schema request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + # p result + # + def get_metadata_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest + + # 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_metadata_schema.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_metadata_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_metadata_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :get_metadata_schema, 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 MetadataSchemas. + # + # @overload list_metadata_schemas(request, options = nil) + # Pass arguments to `list_metadata_schemas` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest, ::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_metadata_schemas(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_metadata_schemas` 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 MetadataStore whose MetadataSchemas should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of MetadataSchemas to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_schemas MetadataService.ListMetadataSchemas} + # call. Provide this to retrieve the next page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # A query to filter available MetadataSchemas for matching results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataSchema>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataSchema>] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest.new + # + # # Call the list_metadata_schemas method. + # result = client.list_metadata_schemas 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::MetadataSchema. + # p item + # end + # + def list_metadata_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest + + # 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_metadata_schemas.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_metadata_schemas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_metadata_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :list_metadata_schemas, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_metadata_schemas, 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 + + ## + # Retrieves lineage of an Artifact represented through Artifacts and + # Executions connected by Event edges and returned as a LineageSubgraph. + # + # @overload query_artifact_lineage_subgraph(request, options = nil) + # Pass arguments to `query_artifact_lineage_subgraph` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_artifact_lineage_subgraph(artifact: nil, max_hops: nil, filter: nil) + # Pass arguments to `query_artifact_lineage_subgraph` 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 artifact [::String] + # Required. The resource name of the Artifact whose Lineage needs to be + # retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + # @param max_hops [::Integer] + # Specifies the size of the lineage graph in terms of number of hops from the + # specified artifact. + # Negative Value: INVALID_ARGUMENT error is returned + # 0: Only input artifact is returned. + # No value: Transitive closure is performed to return the complete graph. + # @param filter [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the Lineage Subgraph. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"` + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest.new + # + # # Call the query_artifact_lineage_subgraph method. + # result = client.query_artifact_lineage_subgraph request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_artifact_lineage_subgraph request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_artifact_lineage_subgraph.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.artifact + header_params["artifact"] = request.artifact + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_artifact_lineage_subgraph.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_artifact_lineage_subgraph.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.call_rpc :query_artifact_lineage_subgraph, 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 MetadataService API. + # + # This class represents the configuration for MetadataService, + # 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::MetadataService::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_metadata_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MetadataService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_metadata_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_metadata_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the MetadataService 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_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_metadata_store + ## + # RPC-specific configuration for `get_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_metadata_store + ## + # RPC-specific configuration for `list_metadata_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_metadata_stores + ## + # RPC-specific configuration for `delete_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_metadata_store + ## + # RPC-specific configuration for `create_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :create_artifact + ## + # RPC-specific configuration for `get_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :get_artifact + ## + # RPC-specific configuration for `list_artifacts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_artifacts + ## + # RPC-specific configuration for `update_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :update_artifact + ## + # RPC-specific configuration for `delete_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_artifact + ## + # RPC-specific configuration for `purge_artifacts` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_artifacts + ## + # RPC-specific configuration for `create_context` + # @return [::Gapic::Config::Method] + # + attr_reader :create_context + ## + # RPC-specific configuration for `get_context` + # @return [::Gapic::Config::Method] + # + attr_reader :get_context + ## + # RPC-specific configuration for `list_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_contexts + ## + # RPC-specific configuration for `update_context` + # @return [::Gapic::Config::Method] + # + attr_reader :update_context + ## + # RPC-specific configuration for `delete_context` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_context + ## + # RPC-specific configuration for `purge_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_contexts + ## + # RPC-specific configuration for `add_context_artifacts_and_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :add_context_artifacts_and_executions + ## + # RPC-specific configuration for `add_context_children` + # @return [::Gapic::Config::Method] + # + attr_reader :add_context_children + ## + # RPC-specific configuration for `remove_context_children` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_context_children + ## + # RPC-specific configuration for `query_context_lineage_subgraph` + # @return [::Gapic::Config::Method] + # + attr_reader :query_context_lineage_subgraph + ## + # RPC-specific configuration for `create_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :create_execution + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `list_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `update_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :update_execution + ## + # RPC-specific configuration for `delete_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_execution + ## + # RPC-specific configuration for `purge_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_executions + ## + # RPC-specific configuration for `add_execution_events` + # @return [::Gapic::Config::Method] + # + attr_reader :add_execution_events + ## + # RPC-specific configuration for `query_execution_inputs_and_outputs` + # @return [::Gapic::Config::Method] + # + attr_reader :query_execution_inputs_and_outputs + ## + # RPC-specific configuration for `create_metadata_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_metadata_schema + ## + # RPC-specific configuration for `get_metadata_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_metadata_schema + ## + # RPC-specific configuration for `list_metadata_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_metadata_schemas + ## + # RPC-specific configuration for `query_artifact_lineage_subgraph` + # @return [::Gapic::Config::Method] + # + attr_reader :query_artifact_lineage_subgraph + + # @private + def initialize parent_rpcs = nil + create_metadata_store_config = parent_rpcs.create_metadata_store if parent_rpcs.respond_to? :create_metadata_store + @create_metadata_store = ::Gapic::Config::Method.new create_metadata_store_config + get_metadata_store_config = parent_rpcs.get_metadata_store if parent_rpcs.respond_to? :get_metadata_store + @get_metadata_store = ::Gapic::Config::Method.new get_metadata_store_config + list_metadata_stores_config = parent_rpcs.list_metadata_stores if parent_rpcs.respond_to? :list_metadata_stores + @list_metadata_stores = ::Gapic::Config::Method.new list_metadata_stores_config + delete_metadata_store_config = parent_rpcs.delete_metadata_store if parent_rpcs.respond_to? :delete_metadata_store + @delete_metadata_store = ::Gapic::Config::Method.new delete_metadata_store_config + create_artifact_config = parent_rpcs.create_artifact if parent_rpcs.respond_to? :create_artifact + @create_artifact = ::Gapic::Config::Method.new create_artifact_config + get_artifact_config = parent_rpcs.get_artifact if parent_rpcs.respond_to? :get_artifact + @get_artifact = ::Gapic::Config::Method.new get_artifact_config + list_artifacts_config = parent_rpcs.list_artifacts if parent_rpcs.respond_to? :list_artifacts + @list_artifacts = ::Gapic::Config::Method.new list_artifacts_config + update_artifact_config = parent_rpcs.update_artifact if parent_rpcs.respond_to? :update_artifact + @update_artifact = ::Gapic::Config::Method.new update_artifact_config + delete_artifact_config = parent_rpcs.delete_artifact if parent_rpcs.respond_to? :delete_artifact + @delete_artifact = ::Gapic::Config::Method.new delete_artifact_config + purge_artifacts_config = parent_rpcs.purge_artifacts if parent_rpcs.respond_to? :purge_artifacts + @purge_artifacts = ::Gapic::Config::Method.new purge_artifacts_config + create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context + @create_context = ::Gapic::Config::Method.new create_context_config + get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context + @get_context = ::Gapic::Config::Method.new get_context_config + list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts + @list_contexts = ::Gapic::Config::Method.new list_contexts_config + update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context + @update_context = ::Gapic::Config::Method.new update_context_config + delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context + @delete_context = ::Gapic::Config::Method.new delete_context_config + purge_contexts_config = parent_rpcs.purge_contexts if parent_rpcs.respond_to? :purge_contexts + @purge_contexts = ::Gapic::Config::Method.new purge_contexts_config + add_context_artifacts_and_executions_config = parent_rpcs.add_context_artifacts_and_executions if parent_rpcs.respond_to? :add_context_artifacts_and_executions + @add_context_artifacts_and_executions = ::Gapic::Config::Method.new add_context_artifacts_and_executions_config + add_context_children_config = parent_rpcs.add_context_children if parent_rpcs.respond_to? :add_context_children + @add_context_children = ::Gapic::Config::Method.new add_context_children_config + remove_context_children_config = parent_rpcs.remove_context_children if parent_rpcs.respond_to? :remove_context_children + @remove_context_children = ::Gapic::Config::Method.new remove_context_children_config + query_context_lineage_subgraph_config = parent_rpcs.query_context_lineage_subgraph if parent_rpcs.respond_to? :query_context_lineage_subgraph + @query_context_lineage_subgraph = ::Gapic::Config::Method.new query_context_lineage_subgraph_config + create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution + @create_execution = ::Gapic::Config::Method.new create_execution_config + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + update_execution_config = parent_rpcs.update_execution if parent_rpcs.respond_to? :update_execution + @update_execution = ::Gapic::Config::Method.new update_execution_config + delete_execution_config = parent_rpcs.delete_execution if parent_rpcs.respond_to? :delete_execution + @delete_execution = ::Gapic::Config::Method.new delete_execution_config + purge_executions_config = parent_rpcs.purge_executions if parent_rpcs.respond_to? :purge_executions + @purge_executions = ::Gapic::Config::Method.new purge_executions_config + add_execution_events_config = parent_rpcs.add_execution_events if parent_rpcs.respond_to? :add_execution_events + @add_execution_events = ::Gapic::Config::Method.new add_execution_events_config + query_execution_inputs_and_outputs_config = parent_rpcs.query_execution_inputs_and_outputs if parent_rpcs.respond_to? :query_execution_inputs_and_outputs + @query_execution_inputs_and_outputs = ::Gapic::Config::Method.new query_execution_inputs_and_outputs_config + create_metadata_schema_config = parent_rpcs.create_metadata_schema if parent_rpcs.respond_to? :create_metadata_schema + @create_metadata_schema = ::Gapic::Config::Method.new create_metadata_schema_config + get_metadata_schema_config = parent_rpcs.get_metadata_schema if parent_rpcs.respond_to? :get_metadata_schema + @get_metadata_schema = ::Gapic::Config::Method.new get_metadata_schema_config + list_metadata_schemas_config = parent_rpcs.list_metadata_schemas if parent_rpcs.respond_to? :list_metadata_schemas + @list_metadata_schemas = ::Gapic::Config::Method.new list_metadata_schemas_config + query_artifact_lineage_subgraph_config = parent_rpcs.query_artifact_lineage_subgraph if parent_rpcs.respond_to? :query_artifact_lineage_subgraph + @query_artifact_lineage_subgraph = ::Gapic::Config::Method.new query_artifact_lineage_subgraph_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/credentials.rb new file mode 100644 index 000000000000..afba2a064f88 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + # Credentials for the MetadataService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb new file mode 100644 index 000000000000..1abb751a74b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + # 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 MetadataService 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 MetadataService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/paths.rb new file mode 100644 index 000000000000..8224ef0f06d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/paths.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + # Path helper methods for the MetadataService API. + module Paths + ## + # Create a fully-qualified Artifact resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param artifact [String] + # + # @return [::String] + def artifact_path project:, location:, metadata_store:, artifact: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/artifacts/#{artifact}" + end + + ## + # Create a fully-qualified Context resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param context [String] + # + # @return [::String] + def context_path project:, location:, metadata_store:, context: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/contexts/#{context}" + end + + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, metadata_store:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/executions/#{execution}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified MetadataSchema resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param metadata_schema [String] + # + # @return [::String] + def metadata_schema_path project:, location:, metadata_store:, metadata_schema: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/metadataSchemas/#{metadata_schema}" + end + + ## + # Create a fully-qualified MetadataStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # + # @return [::String] + def metadata_store_path project:, location:, metadata_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb new file mode 100644 index 000000000000..79a4cef27be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/metadata_service/credentials" +require "google/cloud/ai_platform/v1/metadata_service/paths" +require "google/cloud/ai_platform/v1/metadata_service/rest/operations" +require "google/cloud/ai_platform/v1/metadata_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Service for reading and writing metadata entries. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/metadata_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.new + # + module MetadataService + # 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/metadata_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb new file mode 100644 index 000000000000..0b330bb137e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb @@ -0,0 +1,3643 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/metadata_service_pb" +require "google/cloud/ai_platform/v1/metadata_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + module Rest + ## + # REST client for the MetadataService service. + # + # Service for reading and writing metadata entries. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :metadata_service_stub + + ## + # Configure the MetadataService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MetadataService clients + # ::Google::Cloud::AIPlatform::V1::MetadataService::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 MetadataService 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::MetadataService::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 + @metadata_service_stub.universe_domain + end + + ## + # Create a new MetadataService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MetadataService 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::MetadataService::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 + + @metadata_service_stub = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @metadata_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 = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @metadata_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 = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @metadata_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataService::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 + @metadata_service_stub.logger + end + + # Service calls + + ## + # Initializes a MetadataStore, including allocation of resources. + # + # @overload create_metadata_store(request, options = nil) + # Pass arguments to `create_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest, ::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_metadata_store(parent: nil, metadata_store: nil, metadata_store_id: nil) + # Pass arguments to `create_metadata_store` 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 where the MetadataStore should + # be created. + # Format: `projects/{project}/locations/{location}/` + # @param metadata_store [::Google::Cloud::AIPlatform::V1::MetadataStore, ::Hash] + # Required. The MetadataStore to create. + # @param metadata_store_id [::String] + # The \\{metadatastore} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataStores in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataStore.) + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest.new + # + # # Call the create_metadata_store method. + # result = client.create_metadata_store 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_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.create_metadata_store 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 + + ## + # Retrieves a specific MetadataStore. + # + # @overload get_metadata_store(request, options = nil) + # Pass arguments to `get_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest, ::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_metadata_store(name: nil) + # Pass arguments to `get_metadata_store` 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 MetadataStore to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::MetadataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest.new + # + # # Call the get_metadata_store method. + # result = client.get_metadata_store request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataStore. + # p result + # + def get_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.get_metadata_store 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 MetadataStores for a Location. + # + # @overload list_metadata_stores(request, options = nil) + # Pass arguments to `list_metadata_stores` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest, ::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_metadata_stores(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_metadata_stores` 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 Location whose MetadataStores should be listed. + # Format: + # `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The maximum number of Metadata Stores to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client#list_metadata_stores MetadataService.ListMetadataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataStore>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataStore>] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest.new + # + # # Call the list_metadata_stores method. + # result = client.list_metadata_stores 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::MetadataStore. + # p item + # end + # + def list_metadata_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest + + # 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_metadata_stores.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_metadata_stores.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_metadata_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.list_metadata_stores request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_metadata_stores, "metadata_stores", 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 + + ## + # Deletes a single MetadataStore and all its child resources (Artifacts, + # Executions, and Contexts). + # + # @overload delete_metadata_store(request, options = nil) + # Pass arguments to `delete_metadata_store` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest, ::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_metadata_store(name: nil, force: nil) + # Pass arguments to `delete_metadata_store` 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 MetadataStore to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param force [::Boolean] + # Deprecated: Field is no longer supported. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest.new + # + # # Call the delete_metadata_store method. + # result = client.delete_metadata_store 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_metadata_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest + + # 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_metadata_store.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_metadata_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_metadata_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.delete_metadata_store 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 + + ## + # Creates an Artifact associated with a MetadataStore. + # + # @overload create_artifact(request, options = nil) + # Pass arguments to `create_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateArtifactRequest, ::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_artifact(parent: nil, artifact: nil, artifact_id: nil) + # Pass arguments to `create_artifact` 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 MetadataStore where the Artifact should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param artifact [::Google::Cloud::AIPlatform::V1::Artifact, ::Hash] + # Required. The Artifact to create. + # @param artifact_id [::String] + # The \\{artifact} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # If not provided, the Artifact's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Artifact.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateArtifactRequest.new + # + # # Call the create_artifact method. + # result = client.create_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def create_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.create_artifact 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 + + ## + # Retrieves a specific Artifact. + # + # @overload get_artifact(request, options = nil) + # Pass arguments to `get_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetArtifactRequest, ::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_artifact(name: nil) + # Pass arguments to `get_artifact` 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 Artifact to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetArtifactRequest.new + # + # # Call the get_artifact method. + # result = client.get_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def get_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.get_artifact 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 Artifacts in the MetadataStore. + # + # @overload list_artifacts(request, options = nil) + # Pass arguments to `list_artifacts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListArtifactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListArtifactsRequest, ::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_artifacts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_artifacts` 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 MetadataStore whose Artifacts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Artifacts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client#list_artifacts MetadataService.ListArtifacts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Artifacts based on the contexts to which they belong, use the + # function operator with the full resource name + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Artifact>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Artifact>] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListArtifactsRequest.new + # + # # Call the list_artifacts method. + # result = client.list_artifacts 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::Artifact. + # p item + # end + # + def list_artifacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListArtifactsRequest + + # 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_artifacts.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_artifacts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_artifacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.list_artifacts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_artifacts, "artifacts", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Artifact. + # + # @overload update_artifact(request, options = nil) + # Pass arguments to `update_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest, ::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_artifact(artifact: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_artifact` 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 artifact [::Google::Cloud::AIPlatform::V1::Artifact, ::Hash] + # Required. The Artifact containing updates. + # The Artifact's {::Google::Cloud::AIPlatform::V1::Artifact#name Artifact.name} + # field is used to identify the Artifact to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateArtifactRequest.new + # + # # Call the update_artifact method. + # result = client.update_artifact request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + # p result + # + def update_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.update_artifact 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 an Artifact. + # + # @overload delete_artifact(request, options = nil) + # Pass arguments to `delete_artifact` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest, ::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_artifact(name: nil, etag: nil) + # Pass arguments to `delete_artifact` 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 Artifact to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param etag [::String] + # Optional. The etag of the Artifact to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteArtifactRequest.new + # + # # Call the delete_artifact method. + # result = client.delete_artifact 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_artifact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest + + # 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_artifact.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_artifact.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_artifact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.delete_artifact 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 + + ## + # Purges Artifacts. + # + # @overload purge_artifacts(request, options = nil) + # Pass arguments to `purge_artifacts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest, ::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 purge_artifacts(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_artifacts` 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 metadata store to purge Artifacts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Artifacts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Artifact names that would be deleted. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest.new + # + # # Call the purge_artifacts method. + # result = client.purge_artifacts 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 purge_artifacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest + + # 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.purge_artifacts.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.purge_artifacts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_artifacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.purge_artifacts 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 + + ## + # Creates a Context associated with a MetadataStore. + # + # @overload create_context(request, options = nil) + # Pass arguments to `create_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateContextRequest, ::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_context(parent: nil, context: nil, context_id: nil) + # Pass arguments to `create_context` 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 MetadataStore where the Context should + # be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param context [::Google::Cloud::AIPlatform::V1::Context, ::Hash] + # Required. The Context to create. + # @param context_id [::String] + # The \\{context} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + # If not provided, the Context's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Contexts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Context.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateContextRequest.new + # + # # Call the create_context method. + # result = client.create_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def create_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateContextRequest + + # 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_context.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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.create_context 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 + + ## + # Retrieves a specific Context. + # + # @overload get_context(request, options = nil) + # Pass arguments to `get_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetContextRequest, ::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_context(name: nil) + # Pass arguments to `get_context` 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 Context to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetContextRequest.new + # + # # Call the get_context method. + # result = client.get_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def get_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetContextRequest + + # 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_context.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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.get_context 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 Contexts on the MetadataStore. + # + # @overload list_contexts(request, options = nil) + # Pass arguments to `list_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListContextsRequest, ::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_contexts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_contexts` 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 MetadataStore whose Contexts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Contexts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client#list_contexts MetadataService.ListContexts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Contexts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `schema_title`, + # `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0`. + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Parent Child filtering**: + # To filter Contexts based on parent-child relationship use the HAS + # operator as follows: + # + # ``` + # parent_contexts: + # "projects//locations//metadataStores//contexts/" + # child_contexts: + # "projects//locations//metadataStores//contexts/" + # ``` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Context>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Context>] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListContextsRequest.new + # + # # Call the list_contexts method. + # result = client.list_contexts 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::Context. + # p item + # end + # + def list_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListContextsRequest + + # 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_contexts.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_contexts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.list_contexts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_contexts, "contexts", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Context. + # + # @overload update_context(request, options = nil) + # Pass arguments to `update_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateContextRequest, ::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_context(context: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_context` 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 context [::Google::Cloud::AIPlatform::V1::Context, ::Hash] + # Required. The Context containing updates. + # The Context's {::Google::Cloud::AIPlatform::V1::Context#name Context.name} field + # is used to identify the Context to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Context Context} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Context Context} is created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateContextRequest.new + # + # # Call the update_context method. + # result = client.update_context request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + # p result + # + def update_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateContextRequest + + # 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_context.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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.update_context 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 a stored Context. + # + # @overload delete_context(request, options = nil) + # Pass arguments to `delete_context` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteContextRequest, ::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_context(name: nil, force: nil, etag: nil) + # Pass arguments to `delete_context` 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 Context to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param force [::Boolean] + # The force deletion semantics is still undefined. + # Users should not use this field. + # @param etag [::String] + # Optional. The etag of the Context to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteContextRequest.new + # + # # Call the delete_context method. + # result = client.delete_context 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_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteContextRequest + + # 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_context.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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.delete_context 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 + + ## + # Purges Contexts. + # + # @overload purge_contexts(request, options = nil) + # Pass arguments to `purge_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeContextsRequest, ::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 purge_contexts(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_contexts` 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 metadata store to purge Contexts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Contexts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Context names that would be deleted. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeContextsRequest.new + # + # # Call the purge_contexts method. + # result = client.purge_contexts 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 purge_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeContextsRequest + + # 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.purge_contexts.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.purge_contexts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.purge_contexts 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 + + ## + # Adds a set of Artifacts and Executions to a Context. If any of the + # Artifacts or Executions have already been added to a Context, they are + # simply skipped. + # + # @overload add_context_artifacts_and_executions(request, options = nil) + # Pass arguments to `add_context_artifacts_and_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest, ::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 add_context_artifacts_and_executions(context: nil, artifacts: nil, executions: nil) + # Pass arguments to `add_context_artifacts_and_executions` 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 context [::String] + # Required. The resource name of the Context that the Artifacts and + # Executions belong to. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param artifacts [::Array<::String>] + # The resource names of the Artifacts to attribute to the Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @param executions [::Array<::String>] + # The resource names of the Executions to associate with the + # Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest.new + # + # # Call the add_context_artifacts_and_executions method. + # result = client.add_context_artifacts_and_executions request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse. + # p result + # + def add_context_artifacts_and_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest + + # 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.add_context_artifacts_and_executions.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.add_context_artifacts_and_executions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_context_artifacts_and_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.add_context_artifacts_and_executions 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 + + ## + # Adds a set of Contexts as children to a parent Context. If any of the + # child Contexts have already been added to the parent Context, they are + # simply skipped. If this call would create a cycle or cause any Context to + # have more than 10 parents, the request will fail with an INVALID_ARGUMENT + # error. + # + # @overload add_context_children(request, options = nil) + # Pass arguments to `add_context_children` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest, ::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 add_context_children(context: nil, child_contexts: nil) + # Pass arguments to `add_context_children` 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 context [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param child_contexts [::Array<::String>] + # The resource names of the child Contexts. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddContextChildrenRequest.new + # + # # Call the add_context_children method. + # result = client.add_context_children request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextChildrenResponse. + # p result + # + def add_context_children request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest + + # 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.add_context_children.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.add_context_children.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_context_children.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.add_context_children 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 + + ## + # Remove a set of children contexts from a parent Context. If any of the + # child Contexts were NOT added to the parent Context, they are + # simply skipped. + # + # @overload remove_context_children(request, options = nil) + # Pass arguments to `remove_context_children` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest, ::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 remove_context_children(context: nil, child_contexts: nil) + # Pass arguments to `remove_context_children` 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 context [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @param child_contexts [::Array<::String>] + # The resource names of the child Contexts. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest.new + # + # # Call the remove_context_children method. + # result = client.remove_context_children request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse. + # p result + # + def remove_context_children request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest + + # 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.remove_context_children.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.remove_context_children.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_context_children.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.remove_context_children 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 + + ## + # Retrieves Artifacts and Executions within the specified Context, connected + # by Event edges and returned as a LineageSubgraph. + # + # @overload query_context_lineage_subgraph(request, options = nil) + # Pass arguments to `query_context_lineage_subgraph` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_context_lineage_subgraph(context: nil) + # Pass arguments to `query_context_lineage_subgraph` 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 context [::String] + # Required. The resource name of the Context whose Artifacts and Executions + # should be retrieved as a LineageSubgraph. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest.new + # + # # Call the query_context_lineage_subgraph method. + # result = client.query_context_lineage_subgraph request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_context_lineage_subgraph request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_context_lineage_subgraph.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_context_lineage_subgraph.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_context_lineage_subgraph.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.query_context_lineage_subgraph 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 + + ## + # Creates an Execution associated with a MetadataStore. + # + # @overload create_execution(request, options = nil) + # Pass arguments to `create_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateExecutionRequest, ::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_execution(parent: nil, execution: nil, execution_id: nil) + # Pass arguments to `create_execution` 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 MetadataStore where the Execution should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param execution [::Google::Cloud::AIPlatform::V1::Execution, ::Hash] + # Required. The Execution to create. + # @param execution_id [::String] + # The \\{execution} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # If not provided, the Execution's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Executions in the parent MetadataStore. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting Execution.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateExecutionRequest.new + # + # # Call the create_execution method. + # result = client.create_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def create_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.create_execution 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 + + ## + # Retrieves a specific Execution. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetExecutionRequest, ::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_execution(name: nil) + # Pass arguments to `get_execution` 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 Execution to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.get_execution 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 Executions in the MetadataStore. + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListExecutionsRequest, ::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_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_executions` 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 MetadataStore whose Executions should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of Executions to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client#list_executions MetadataService.ListExecutions} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with an + # INVALID_ARGUMENT error.) + # @param filter [::String] + # Filter specifying the boolean condition for the Executions to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..` + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Executions based on the contexts to which they belong use + # the function operator with the full resource name: + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @param order_by [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Execution>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Execution>] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions 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::Execution. + # p item + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListExecutionsRequest + + # 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_executions.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_executions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.list_executions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_executions, "executions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a stored Execution. + # + # @overload update_execution(request, options = nil) + # Pass arguments to `update_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest, ::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_execution(execution: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_execution` 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 execution [::Google::Cloud::AIPlatform::V1::Execution, ::Hash] + # Required. The Execution containing updates. + # The Execution's {::Google::Cloud::AIPlatform::V1::Execution#name Execution.name} + # field is used to identify the Execution to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. A FieldMask indicating which fields should be updated. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Execution Execution} + # is not found, a new {::Google::Cloud::AIPlatform::V1::Execution Execution} is + # created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateExecutionRequest.new + # + # # Call the update_execution method. + # result = client.update_execution request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + # p result + # + def update_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.update_execution 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 an Execution. + # + # @overload delete_execution(request, options = nil) + # Pass arguments to `delete_execution` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest, ::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_execution(name: nil, etag: nil) + # Pass arguments to `delete_execution` 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 Execution to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param etag [::String] + # Optional. The etag of the Execution to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteExecutionRequest.new + # + # # Call the delete_execution method. + # result = client.delete_execution 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_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest + + # 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_execution.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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.delete_execution 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 + + ## + # Purges Executions. + # + # @overload purge_executions(request, options = nil) + # Pass arguments to `purge_executions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest, ::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 purge_executions(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_executions` 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 metadata store to purge Executions from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param filter [::String] + # Required. A required filter matching the Executions to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @param force [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Execution names that would be deleted. + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest.new + # + # # Call the purge_executions method. + # result = client.purge_executions 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 purge_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest + + # 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.purge_executions.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.purge_executions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.purge_executions 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 + + ## + # Adds Events to the specified Execution. An Event indicates whether an + # Artifact was used as an input or output for an Execution. If an Event + # already exists between the Execution and the Artifact, the Event is + # skipped. + # + # @overload add_execution_events(request, options = nil) + # Pass arguments to `add_execution_events` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest, ::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 add_execution_events(execution: nil, events: nil) + # Pass arguments to `add_execution_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 execution [::String] + # Required. The resource name of the Execution that the Events connect + # Artifacts with. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @param events [::Array<::Google::Cloud::AIPlatform::V1::Event, ::Hash>] + # The Events to create and add. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest.new + # + # # Call the add_execution_events method. + # result = client.add_execution_events request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse. + # p result + # + def add_execution_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest + + # 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.add_execution_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.add_execution_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_execution_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.add_execution_events 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 + + ## + # Obtains the set of input and output Artifacts for this Execution, in the + # form of LineageSubgraph that also contains the Execution and connecting + # Events. + # + # @overload query_execution_inputs_and_outputs(request, options = nil) + # Pass arguments to `query_execution_inputs_and_outputs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_execution_inputs_and_outputs(execution: nil) + # Pass arguments to `query_execution_inputs_and_outputs` 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 execution [::String] + # Required. The resource name of the Execution whose input and output + # Artifacts should be retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest.new + # + # # Call the query_execution_inputs_and_outputs method. + # result = client.query_execution_inputs_and_outputs request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_execution_inputs_and_outputs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_execution_inputs_and_outputs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_execution_inputs_and_outputs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_execution_inputs_and_outputs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.query_execution_inputs_and_outputs 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 + + ## + # Creates a MetadataSchema. + # + # @overload create_metadata_schema(request, options = nil) + # Pass arguments to `create_metadata_schema` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest, ::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_metadata_schema(parent: nil, metadata_schema: nil, metadata_schema_id: nil) + # Pass arguments to `create_metadata_schema` 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 MetadataStore where the MetadataSchema + # should be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param metadata_schema [::Google::Cloud::AIPlatform::V1::MetadataSchema, ::Hash] + # Required. The MetadataSchema to create. + # @param metadata_schema_id [::String] + # The \\{metadata_schema} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataSchemas in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataSchema.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest.new + # + # # Call the create_metadata_schema method. + # result = client.create_metadata_schema request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + # p result + # + def create_metadata_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest + + # 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_metadata_schema.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_metadata_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_metadata_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.create_metadata_schema 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 + + ## + # Retrieves a specific MetadataSchema. + # + # @overload get_metadata_schema(request, options = nil) + # Pass arguments to `get_metadata_schema` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest, ::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_metadata_schema(name: nil) + # Pass arguments to `get_metadata_schema` 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 MetadataSchema to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest.new + # + # # Call the get_metadata_schema method. + # result = client.get_metadata_schema request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + # p result + # + def get_metadata_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest + + # 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_metadata_schema.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_metadata_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_metadata_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.get_metadata_schema 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 MetadataSchemas. + # + # @overload list_metadata_schemas(request, options = nil) + # Pass arguments to `list_metadata_schemas` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest, ::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_metadata_schemas(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_metadata_schemas` 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 MetadataStore whose MetadataSchemas should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @param page_size [::Integer] + # The maximum number of MetadataSchemas to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client#list_metadata_schemas MetadataService.ListMetadataSchemas} + # call. Provide this to retrieve the next page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @param filter [::String] + # A query to filter available MetadataSchemas for matching results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataSchema>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MetadataSchema>] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest.new + # + # # Call the list_metadata_schemas method. + # result = client.list_metadata_schemas 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::MetadataSchema. + # p item + # end + # + def list_metadata_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest + + # 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_metadata_schemas.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_metadata_schemas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_metadata_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.list_metadata_schemas request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @metadata_service_stub, :list_metadata_schemas, "metadata_schemas", 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 + + ## + # Retrieves lineage of an Artifact represented through Artifacts and + # Executions connected by Event edges and returned as a LineageSubgraph. + # + # @overload query_artifact_lineage_subgraph(request, options = nil) + # Pass arguments to `query_artifact_lineage_subgraph` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_artifact_lineage_subgraph(artifact: nil, max_hops: nil, filter: nil) + # Pass arguments to `query_artifact_lineage_subgraph` 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 artifact [::String] + # Required. The resource name of the Artifact whose Lineage needs to be + # retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + # @param max_hops [::Integer] + # Specifies the size of the lineage graph in terms of number of hops from the + # specified artifact. + # Negative Value: INVALID_ARGUMENT error is returned + # 0: Only input artifact is returned. + # No value: Transitive closure is performed to return the complete graph. + # @param filter [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the Lineage Subgraph. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"` + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # + # @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::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest.new + # + # # Call the query_artifact_lineage_subgraph method. + # result = client.query_artifact_lineage_subgraph request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + # p result + # + def query_artifact_lineage_subgraph request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_artifact_lineage_subgraph.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_artifact_lineage_subgraph.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_artifact_lineage_subgraph.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @metadata_service_stub.query_artifact_lineage_subgraph 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 MetadataService REST API. + # + # This class represents the configuration for MetadataService 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::MetadataService::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_metadata_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_metadata_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_metadata_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the MetadataService 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_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_metadata_store + ## + # RPC-specific configuration for `get_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_metadata_store + ## + # RPC-specific configuration for `list_metadata_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_metadata_stores + ## + # RPC-specific configuration for `delete_metadata_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_metadata_store + ## + # RPC-specific configuration for `create_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :create_artifact + ## + # RPC-specific configuration for `get_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :get_artifact + ## + # RPC-specific configuration for `list_artifacts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_artifacts + ## + # RPC-specific configuration for `update_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :update_artifact + ## + # RPC-specific configuration for `delete_artifact` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_artifact + ## + # RPC-specific configuration for `purge_artifacts` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_artifacts + ## + # RPC-specific configuration for `create_context` + # @return [::Gapic::Config::Method] + # + attr_reader :create_context + ## + # RPC-specific configuration for `get_context` + # @return [::Gapic::Config::Method] + # + attr_reader :get_context + ## + # RPC-specific configuration for `list_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_contexts + ## + # RPC-specific configuration for `update_context` + # @return [::Gapic::Config::Method] + # + attr_reader :update_context + ## + # RPC-specific configuration for `delete_context` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_context + ## + # RPC-specific configuration for `purge_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_contexts + ## + # RPC-specific configuration for `add_context_artifacts_and_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :add_context_artifacts_and_executions + ## + # RPC-specific configuration for `add_context_children` + # @return [::Gapic::Config::Method] + # + attr_reader :add_context_children + ## + # RPC-specific configuration for `remove_context_children` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_context_children + ## + # RPC-specific configuration for `query_context_lineage_subgraph` + # @return [::Gapic::Config::Method] + # + attr_reader :query_context_lineage_subgraph + ## + # RPC-specific configuration for `create_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :create_execution + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `list_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `update_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :update_execution + ## + # RPC-specific configuration for `delete_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_execution + ## + # RPC-specific configuration for `purge_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_executions + ## + # RPC-specific configuration for `add_execution_events` + # @return [::Gapic::Config::Method] + # + attr_reader :add_execution_events + ## + # RPC-specific configuration for `query_execution_inputs_and_outputs` + # @return [::Gapic::Config::Method] + # + attr_reader :query_execution_inputs_and_outputs + ## + # RPC-specific configuration for `create_metadata_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_metadata_schema + ## + # RPC-specific configuration for `get_metadata_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_metadata_schema + ## + # RPC-specific configuration for `list_metadata_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_metadata_schemas + ## + # RPC-specific configuration for `query_artifact_lineage_subgraph` + # @return [::Gapic::Config::Method] + # + attr_reader :query_artifact_lineage_subgraph + + # @private + def initialize parent_rpcs = nil + create_metadata_store_config = parent_rpcs.create_metadata_store if parent_rpcs.respond_to? :create_metadata_store + @create_metadata_store = ::Gapic::Config::Method.new create_metadata_store_config + get_metadata_store_config = parent_rpcs.get_metadata_store if parent_rpcs.respond_to? :get_metadata_store + @get_metadata_store = ::Gapic::Config::Method.new get_metadata_store_config + list_metadata_stores_config = parent_rpcs.list_metadata_stores if parent_rpcs.respond_to? :list_metadata_stores + @list_metadata_stores = ::Gapic::Config::Method.new list_metadata_stores_config + delete_metadata_store_config = parent_rpcs.delete_metadata_store if parent_rpcs.respond_to? :delete_metadata_store + @delete_metadata_store = ::Gapic::Config::Method.new delete_metadata_store_config + create_artifact_config = parent_rpcs.create_artifact if parent_rpcs.respond_to? :create_artifact + @create_artifact = ::Gapic::Config::Method.new create_artifact_config + get_artifact_config = parent_rpcs.get_artifact if parent_rpcs.respond_to? :get_artifact + @get_artifact = ::Gapic::Config::Method.new get_artifact_config + list_artifacts_config = parent_rpcs.list_artifacts if parent_rpcs.respond_to? :list_artifacts + @list_artifacts = ::Gapic::Config::Method.new list_artifacts_config + update_artifact_config = parent_rpcs.update_artifact if parent_rpcs.respond_to? :update_artifact + @update_artifact = ::Gapic::Config::Method.new update_artifact_config + delete_artifact_config = parent_rpcs.delete_artifact if parent_rpcs.respond_to? :delete_artifact + @delete_artifact = ::Gapic::Config::Method.new delete_artifact_config + purge_artifacts_config = parent_rpcs.purge_artifacts if parent_rpcs.respond_to? :purge_artifacts + @purge_artifacts = ::Gapic::Config::Method.new purge_artifacts_config + create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context + @create_context = ::Gapic::Config::Method.new create_context_config + get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context + @get_context = ::Gapic::Config::Method.new get_context_config + list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts + @list_contexts = ::Gapic::Config::Method.new list_contexts_config + update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context + @update_context = ::Gapic::Config::Method.new update_context_config + delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context + @delete_context = ::Gapic::Config::Method.new delete_context_config + purge_contexts_config = parent_rpcs.purge_contexts if parent_rpcs.respond_to? :purge_contexts + @purge_contexts = ::Gapic::Config::Method.new purge_contexts_config + add_context_artifacts_and_executions_config = parent_rpcs.add_context_artifacts_and_executions if parent_rpcs.respond_to? :add_context_artifacts_and_executions + @add_context_artifacts_and_executions = ::Gapic::Config::Method.new add_context_artifacts_and_executions_config + add_context_children_config = parent_rpcs.add_context_children if parent_rpcs.respond_to? :add_context_children + @add_context_children = ::Gapic::Config::Method.new add_context_children_config + remove_context_children_config = parent_rpcs.remove_context_children if parent_rpcs.respond_to? :remove_context_children + @remove_context_children = ::Gapic::Config::Method.new remove_context_children_config + query_context_lineage_subgraph_config = parent_rpcs.query_context_lineage_subgraph if parent_rpcs.respond_to? :query_context_lineage_subgraph + @query_context_lineage_subgraph = ::Gapic::Config::Method.new query_context_lineage_subgraph_config + create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution + @create_execution = ::Gapic::Config::Method.new create_execution_config + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + update_execution_config = parent_rpcs.update_execution if parent_rpcs.respond_to? :update_execution + @update_execution = ::Gapic::Config::Method.new update_execution_config + delete_execution_config = parent_rpcs.delete_execution if parent_rpcs.respond_to? :delete_execution + @delete_execution = ::Gapic::Config::Method.new delete_execution_config + purge_executions_config = parent_rpcs.purge_executions if parent_rpcs.respond_to? :purge_executions + @purge_executions = ::Gapic::Config::Method.new purge_executions_config + add_execution_events_config = parent_rpcs.add_execution_events if parent_rpcs.respond_to? :add_execution_events + @add_execution_events = ::Gapic::Config::Method.new add_execution_events_config + query_execution_inputs_and_outputs_config = parent_rpcs.query_execution_inputs_and_outputs if parent_rpcs.respond_to? :query_execution_inputs_and_outputs + @query_execution_inputs_and_outputs = ::Gapic::Config::Method.new query_execution_inputs_and_outputs_config + create_metadata_schema_config = parent_rpcs.create_metadata_schema if parent_rpcs.respond_to? :create_metadata_schema + @create_metadata_schema = ::Gapic::Config::Method.new create_metadata_schema_config + get_metadata_schema_config = parent_rpcs.get_metadata_schema if parent_rpcs.respond_to? :get_metadata_schema + @get_metadata_schema = ::Gapic::Config::Method.new get_metadata_schema_config + list_metadata_schemas_config = parent_rpcs.list_metadata_schemas if parent_rpcs.respond_to? :list_metadata_schemas + @list_metadata_schemas = ::Gapic::Config::Method.new list_metadata_schemas_config + query_artifact_lineage_subgraph_config = parent_rpcs.query_artifact_lineage_subgraph if parent_rpcs.respond_to? :query_artifact_lineage_subgraph + @query_artifact_lineage_subgraph = ::Gapic::Config::Method.new query_artifact_lineage_subgraph_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb new file mode 100644 index 000000000000..20214ce00b3d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + 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 MetadataService 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 MetadataService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb new file mode 100644 index 000000000000..0a99b79c78bd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb @@ -0,0 +1,2048 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/metadata_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + module Rest + ## + # REST service stub for the MetadataService 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_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest] + # 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_metadata_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_metadata_store_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_metadata_store", + 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_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest] + # 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::MetadataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore] + # A result object deserialized from the server's reply + def get_metadata_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_metadata_store_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_metadata_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::MetadataStore.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_metadata_stores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest] + # 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::ListMetadataStoresResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListMetadataStoresResponse] + # A result object deserialized from the server's reply + def list_metadata_stores request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_metadata_stores_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_metadata_stores", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListMetadataStoresResponse.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_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest] + # 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_metadata_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_metadata_store_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_metadata_store", + 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 create_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateArtifactRequest] + # 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::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # A result object deserialized from the server's reply + def create_artifact request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_artifact_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_artifact", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Artifact.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_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetArtifactRequest] + # 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::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # A result object deserialized from the server's reply + def get_artifact request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_artifact_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_artifact", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Artifact.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_artifacts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListArtifactsRequest] + # 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::ListArtifactsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListArtifactsResponse] + # A result object deserialized from the server's reply + def list_artifacts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_artifacts_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_artifacts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListArtifactsResponse.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_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest] + # 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::Artifact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # A result object deserialized from the server's reply + def update_artifact request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_artifact_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_artifact", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Artifact.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_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest] + # 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_artifact request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_artifact_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_artifact", + 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 purge_artifacts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest] + # 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 purge_artifacts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_artifacts_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: "purge_artifacts", + 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 create_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateContextRequest] + # 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::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # A result object deserialized from the server's reply + def create_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_context_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Context.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_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetContextRequest] + # 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::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # A result object deserialized from the server's reply + def get_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_context_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Context.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_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListContextsRequest] + # 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::ListContextsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListContextsResponse] + # A result object deserialized from the server's reply + def list_contexts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_contexts_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_contexts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListContextsResponse.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_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateContextRequest] + # 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::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Context] + # A result object deserialized from the server's reply + def update_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_context_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Context.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_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteContextRequest] + # 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_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_context_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_context", + 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 purge_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeContextsRequest] + # 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 purge_contexts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_contexts_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: "purge_contexts", + 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 add_context_artifacts_and_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest] + # 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::AddContextArtifactsAndExecutionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse] + # A result object deserialized from the server's reply + def add_context_artifacts_and_executions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_context_artifacts_and_executions_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: "add_context_artifacts_and_executions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_context_children REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest] + # 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::AddContextChildrenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse] + # A result object deserialized from the server's reply + def add_context_children request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_context_children_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: "add_context_children", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_context_children REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest] + # 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::RemoveContextChildrenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse] + # A result object deserialized from the server's reply + def remove_context_children request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_context_children_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: "remove_context_children", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the query_context_lineage_subgraph REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest] + # 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::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # A result object deserialized from the server's reply + def query_context_lineage_subgraph request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_context_lineage_subgraph_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_context_lineage_subgraph", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::LineageSubgraph.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateExecutionRequest] + # 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::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # A result object deserialized from the server's reply + def create_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Execution.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_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetExecutionRequest] + # 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::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # A result object deserialized from the server's reply + def get_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Execution.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_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListExecutionsRequest] + # 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::ListExecutionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListExecutionsResponse] + # A result object deserialized from the server's reply + def list_executions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_executions_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_executions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListExecutionsResponse.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_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest] + # 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::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # A result object deserialized from the server's reply + def update_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Execution.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_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest] + # 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_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_execution_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_execution", + 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 purge_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest] + # 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 purge_executions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_executions_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: "purge_executions", + 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 add_execution_events REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest] + # 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::AddExecutionEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse] + # A result object deserialized from the server's reply + def add_execution_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_execution_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: "add_execution_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the query_execution_inputs_and_outputs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest] + # 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::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # A result object deserialized from the server's reply + def query_execution_inputs_and_outputs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_execution_inputs_and_outputs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_execution_inputs_and_outputs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::LineageSubgraph.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_metadata_schema REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest] + # 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::MetadataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # A result object deserialized from the server's reply + def create_metadata_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_metadata_schema_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_metadata_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::MetadataSchema.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_metadata_schema REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest] + # 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::MetadataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # A result object deserialized from the server's reply + def get_metadata_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_metadata_schema_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_metadata_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::MetadataSchema.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_metadata_schemas REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest] + # 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::ListMetadataSchemasResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListMetadataSchemasResponse] + # A result object deserialized from the server's reply + def list_metadata_schemas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_metadata_schemas_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_metadata_schemas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListMetadataSchemasResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the query_artifact_lineage_subgraph REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest] + # 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::LineageSubgraph] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::LineageSubgraph] + # A result object deserialized from the server's reply + def query_artifact_lineage_subgraph request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_artifact_lineage_subgraph_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_artifact_lineage_subgraph", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::LineageSubgraph.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_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest] + # 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_metadata_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/metadataStores", + body: "metadata_store", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest] + # 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_metadata_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_metadata_stores REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest] + # 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_metadata_stores_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/metadataStores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_metadata_store REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest] + # 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_metadata_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateArtifactRequest] + # 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_artifact_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/artifacts", + body: "artifact", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetArtifactRequest] + # 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_artifact_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_artifacts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListArtifactsRequest] + # 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_artifacts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/artifacts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest] + # 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_artifact_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{artifact.name}", + body: "artifact", + matches: [ + ["artifact.name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_artifact REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest] + # 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_artifact_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_artifacts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_artifacts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/artifacts:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/contexts", + body: "context", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListContextsRequest] + # 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_contexts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{context.name}", + body: "context", + matches: [ + ["context.name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_context REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeContextsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_contexts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/contexts:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_context_artifacts_and_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_context_artifacts_and_executions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{context}:addContextArtifactsAndExecutions", + body: "*", + matches: [ + ["context", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_context_children REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_context_children_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{context}:addContextChildren", + body: "*", + matches: [ + ["context", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_context_children REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_context_children_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{context}:removeContextChildren", + body: "*", + matches: [ + ["context", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the query_context_lineage_subgraph REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_context_lineage_subgraph_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{context}:queryContextLineageSubgraph", + matches: [ + ["context", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/executions", + body: "execution", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListExecutionsRequest] + # 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_executions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/executions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{execution.name}", + body: "execution", + matches: [ + ["execution.name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_execution REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_executions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_executions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/executions:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_execution_events REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_execution_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{execution}:addExecutionEvents", + body: "*", + matches: [ + ["execution", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the query_execution_inputs_and_outputs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_execution_inputs_and_outputs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{execution}:queryExecutionInputsAndOutputs", + matches: [ + ["execution", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_metadata_schema REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest] + # 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_metadata_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/metadataSchemas", + body: "metadata_schema", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_metadata_schema REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest] + # 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_metadata_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/metadataSchemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_metadata_schemas REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest] + # 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_metadata_schemas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/metadataSchemas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the query_artifact_lineage_subgraph REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_artifact_lineage_subgraph_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{artifact}:queryArtifactLineageSubgraph", + matches: [ + ["artifact", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service.rb new file mode 100644 index 000000000000..0aa2fec32c58 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/migration_service/credentials" +require "google/cloud/ai_platform/v1/migration_service/paths" +require "google/cloud/ai_platform/v1/migration_service/operations" +require "google/cloud/ai_platform/v1/migration_service/client" +require "google/cloud/ai_platform/v1/migration_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/migration_service" + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/migration_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new + # + module MigrationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "migration_service", "helpers.rb" +require "google/cloud/ai_platform/v1/migration_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/client.rb new file mode 100644 index 000000000000..58e3aa39a42d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/client.rb @@ -0,0 +1,633 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/migration_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + ## + # Client for the MigrationService service. + # + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :migration_service_stub + + ## + # Configure the MigrationService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MigrationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MigrationService clients + # ::Google::Cloud::AIPlatform::V1::MigrationService::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 MigrationService 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::MigrationService::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 + @migration_service_stub.universe_domain + end + + ## + # Create a new MigrationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MigrationService 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/migration_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 + + @migration_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::MigrationService::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 + ) + + @migration_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 = @migration_service_stub.endpoint + config.universe_domain = @migration_service_stub.universe_domain + config.logger = @migration_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 = @migration_service_stub.endpoint + config.universe_domain = @migration_service_stub.universe_domain + config.logger = @migration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::MigrationService::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 + @migration_service_stub.logger + end + + # Service calls + + ## + # Searches all of the resources in automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + # Vertex AI's given location. + # + # @overload search_migratable_resources(request, options = nil) + # Pass arguments to `search_migratable_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest, ::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 search_migratable_resources(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `search_migratable_resources` 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 location that the migratable resources should be searched + # from. It's the Vertex AI location that the resources can be migrated to, + # not the resources' original location. Format: + # `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The standard page size. + # The default and maximum value is 100. + # @param page_token [::String] + # The standard page token. + # @param filter [::String] + # A filter for your search. You can use the following types of filters: + # + # * Resource type filters. The following strings filter for a specific type + # of {::Google::Cloud::AIPlatform::V1::MigratableResource MigratableResource}: + # * `ml_engine_model_version:*` + # * `automl_model:*` + # * `automl_dataset:*` + # * `data_labeling_dataset:*` + # * "Migrated or not" filters. The following strings filter for resources + # that either have or have not already been migrated: + # * `last_migrate_time:*` filters for migrated resources. + # * `NOT last_migrate_time:*` filters for not yet migrated resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>] + # + # @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::MigrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest.new + # + # # Call the search_migratable_resources method. + # result = client.search_migratable_resources 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::MigratableResource. + # p item + # end + # + def search_migratable_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest + + # 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.search_migratable_resources.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.search_migratable_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_migratable_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @migration_service_stub.call_rpc :search_migratable_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @migration_service_stub, :search_migratable_resources, 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 + + ## + # Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + # and datalabeling.googleapis.com to Vertex AI. + # + # @overload batch_migrate_resources(request, options = nil) + # Pass arguments to `batch_migrate_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest, ::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 batch_migrate_resources(parent: nil, migrate_resource_requests: nil) + # Pass arguments to `batch_migrate_resources` 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 location of the migrated resource will live in. + # Format: `projects/{project}/locations/{location}` + # @param migrate_resource_requests [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceRequest, ::Hash>] + # Required. The request messages specifying the resources to migrate. + # They must be in the same location as the destination. + # Up to 50 resources can be migrated in one batch. + # + # @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::MigrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest.new + # + # # Call the batch_migrate_resources method. + # result = client.batch_migrate_resources 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 batch_migrate_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest + + # 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.batch_migrate_resources.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.batch_migrate_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_migrate_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @migration_service_stub.call_rpc :batch_migrate_resources, 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 MigrationService API. + # + # This class represents the configuration for MigrationService, + # 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::MigrationService::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 + # # search_migratable_resources to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MigrationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_migratable_resources.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_migratable_resources.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the MigrationService 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 `search_migratable_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :search_migratable_resources + ## + # RPC-specific configuration for `batch_migrate_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_migrate_resources + + # @private + def initialize parent_rpcs = nil + search_migratable_resources_config = parent_rpcs.search_migratable_resources if parent_rpcs.respond_to? :search_migratable_resources + @search_migratable_resources = ::Gapic::Config::Method.new search_migratable_resources_config + batch_migrate_resources_config = parent_rpcs.batch_migrate_resources if parent_rpcs.respond_to? :batch_migrate_resources + @batch_migrate_resources = ::Gapic::Config::Method.new batch_migrate_resources_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/credentials.rb new file mode 100644 index 000000000000..e48dd225ea06 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + # Credentials for the MigrationService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/operations.rb new file mode 100644 index 000000000000..f1c01403b890 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + # 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 MigrationService 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 MigrationService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/paths.rb new file mode 100644 index 000000000000..9db11adf4cf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/paths.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + # Path helper methods for the MigrationService API. + module Paths + ## + # Create a fully-qualified AnnotatedDataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}` + # + # @param project [String] + # @param dataset [String] + # @param annotated_dataset [String] + # + # @return [::String] + def annotated_dataset_path project:, dataset:, annotated_dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/datasets/#{dataset}/annotatedDatasets/#{annotated_dataset}" + end + + ## + # Create a fully-qualified Dataset resource string. + # + # @overload dataset_path(project:, location:, dataset:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # + # @overload dataset_path(project:, dataset:) + # The resource will be in the following format: + # + # `projects/{project}/datasets/{dataset}` + # + # @param project [String] + # @param dataset [String] + # + # @return [::String] + def dataset_path **args + resources = { + "dataset:location:project" => (proc do |project:, location:, dataset:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}" + end), + "dataset:project" => (proc do |project:, dataset:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/datasets/#{dataset}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified Version resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/models/{model}/versions/{version}` + # + # @param project [String] + # @param model [String] + # @param version [String] + # + # @return [::String] + def version_path project:, model:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/" + + "projects/#{project}/models/#{model}/versions/#{version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest.rb new file mode 100644 index 000000000000..11ef1b4ed5fc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/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/migration_service/credentials" +require "google/cloud/ai_platform/v1/migration_service/paths" +require "google/cloud/ai_platform/v1/migration_service/rest/operations" +require "google/cloud/ai_platform/v1/migration_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/migration_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new + # + module MigrationService + # 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/migration_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb new file mode 100644 index 000000000000..58699b3f8d2a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb @@ -0,0 +1,602 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/migration_service_pb" +require "google/cloud/ai_platform/v1/migration_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + module Rest + ## + # REST client for the MigrationService service. + # + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :migration_service_stub + + ## + # Configure the MigrationService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all MigrationService clients + # ::Google::Cloud::AIPlatform::V1::MigrationService::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 MigrationService 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::MigrationService::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 + @migration_service_stub.universe_domain + end + + ## + # Create a new MigrationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the MigrationService 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::MigrationService::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 + + @migration_service_stub = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @migration_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 = @migration_service_stub.endpoint + config.universe_domain = @migration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @migration_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 = @migration_service_stub.endpoint + config.universe_domain = @migration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @migration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::MigrationService::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 + @migration_service_stub.logger + end + + # Service calls + + ## + # Searches all of the resources in automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + # Vertex AI's given location. + # + # @overload search_migratable_resources(request, options = nil) + # Pass arguments to `search_migratable_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest, ::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 search_migratable_resources(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `search_migratable_resources` 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 location that the migratable resources should be searched + # from. It's the Vertex AI location that the resources can be migrated to, + # not the resources' original location. Format: + # `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The standard page size. + # The default and maximum value is 100. + # @param page_token [::String] + # The standard page token. + # @param filter [::String] + # A filter for your search. You can use the following types of filters: + # + # * Resource type filters. The following strings filter for a specific type + # of {::Google::Cloud::AIPlatform::V1::MigratableResource MigratableResource}: + # * `ml_engine_model_version:*` + # * `automl_model:*` + # * `automl_dataset:*` + # * `data_labeling_dataset:*` + # * "Migrated or not" filters. The following strings filter for resources + # that either have or have not already been migrated: + # * `last_migrate_time:*` filters for migrated resources. + # * `NOT last_migrate_time:*` filters for not yet migrated resources. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MigratableResource>] + # + # @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::MigrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest.new + # + # # Call the search_migratable_resources method. + # result = client.search_migratable_resources 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::MigratableResource. + # p item + # end + # + def search_migratable_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest + + # 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.search_migratable_resources.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.search_migratable_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_migratable_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @migration_service_stub.search_migratable_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @migration_service_stub, :search_migratable_resources, "migratable_resources", 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 + + ## + # Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + # and datalabeling.googleapis.com to Vertex AI. + # + # @overload batch_migrate_resources(request, options = nil) + # Pass arguments to `batch_migrate_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest, ::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 batch_migrate_resources(parent: nil, migrate_resource_requests: nil) + # Pass arguments to `batch_migrate_resources` 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 location of the migrated resource will live in. + # Format: `projects/{project}/locations/{location}` + # @param migrate_resource_requests [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceRequest, ::Hash>] + # Required. The request messages specifying the resources to migrate. + # They must be in the same location as the destination. + # Up to 50 resources can be migrated in one batch. + # @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::MigrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest.new + # + # # Call the batch_migrate_resources method. + # result = client.batch_migrate_resources 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 batch_migrate_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest + + # 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.batch_migrate_resources.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.batch_migrate_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_migrate_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @migration_service_stub.batch_migrate_resources 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 MigrationService REST API. + # + # This class represents the configuration for MigrationService 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::MigrationService::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 + # # search_migratable_resources to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_migratable_resources.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_migratable_resources.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the MigrationService 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 `search_migratable_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :search_migratable_resources + ## + # RPC-specific configuration for `batch_migrate_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_migrate_resources + + # @private + def initialize parent_rpcs = nil + search_migratable_resources_config = parent_rpcs.search_migratable_resources if parent_rpcs.respond_to? :search_migratable_resources + @search_migratable_resources = ::Gapic::Config::Method.new search_migratable_resources_config + batch_migrate_resources_config = parent_rpcs.batch_migrate_resources if parent_rpcs.respond_to? :batch_migrate_resources + @batch_migrate_resources = ::Gapic::Config::Method.new batch_migrate_resources_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb new file mode 100644 index 000000000000..eaea778e16c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + 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 MigrationService 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 MigrationService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb new file mode 100644 index 000000000000..1f4aa80025c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/migration_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + module Rest + ## + # REST service stub for the MigrationService 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 search_migratable_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest] + # 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::SearchMigratableResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesResponse] + # A result object deserialized from the server's reply + def search_migratable_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_migratable_resources_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: "search_migratable_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_migrate_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest] + # 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 batch_migrate_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_migrate_resources_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: "batch_migrate_resources", + 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 search_migratable_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_migratable_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/migratableResources:search", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_migrate_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_migrate_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/migratableResources:batchMigrate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service.rb new file mode 100644 index 000000000000..77e622ce0a0d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/model_garden_service/credentials" +require "google/cloud/ai_platform/v1/model_garden_service/paths" +require "google/cloud/ai_platform/v1/model_garden_service/client" +require "google/cloud/ai_platform/v1/model_garden_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The interface of Model Garden Service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/model_garden_service" + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/model_garden_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.new + # + module ModelGardenService + end + end + end + end +end + +helper_path = ::File.join __dir__, "model_garden_service", "helpers.rb" +require "google/cloud/ai_platform/v1/model_garden_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb new file mode 100644 index 000000000000..744bf3c5f62b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb @@ -0,0 +1,494 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/model_garden_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + ## + # Client for the ModelGardenService service. + # + # The interface of Model Garden Service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_garden_service_stub + + ## + # Configure the ModelGardenService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ModelGardenService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelGardenService clients + # ::Google::Cloud::AIPlatform::V1::ModelGardenService::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 ModelGardenService 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::ModelGardenService::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 + @model_garden_service_stub.universe_domain + end + + ## + # Create a new ModelGardenService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelGardenService 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/model_garden_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 + + @model_garden_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ModelGardenService::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 + ) + + @model_garden_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 = @model_garden_service_stub.endpoint + config.universe_domain = @model_garden_service_stub.universe_domain + config.logger = @model_garden_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 = @model_garden_service_stub.endpoint + config.universe_domain = @model_garden_service_stub.universe_domain + config.logger = @model_garden_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @model_garden_service_stub.logger + end + + # Service calls + + ## + # Gets a Model Garden publisher model. + # + # @overload get_publisher_model(request, options = nil) + # Pass arguments to `get_publisher_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest, ::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_publisher_model(name: nil, language_code: nil, view: nil, is_hugging_face_model: nil, hugging_face_token: nil) + # Pass arguments to `get_publisher_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PublisherModel resource. + # Format: + # `publishers/{publisher}/models/{publisher_model}` + # @param language_code [::String] + # Optional. The IETF BCP-47 language code representing the language in which + # the publisher model's text information should be written in. + # @param view [::Google::Cloud::AIPlatform::V1::PublisherModelView] + # Optional. PublisherModel view specifying which fields to read. + # @param is_hugging_face_model [::Boolean] + # Optional. Boolean indicates whether the requested model is a Hugging Face + # model. + # @param hugging_face_token [::String] + # Optional. Token used to access Hugging Face gated models. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::PublisherModel] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel] + # + # @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::ModelGardenService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPublisherModelRequest.new + # + # # Call the get_publisher_model method. + # result = client.get_publisher_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PublisherModel. + # p result + # + def get_publisher_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest + + # 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_publisher_model.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_publisher_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_publisher_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_garden_service_stub.call_rpc :get_publisher_model, 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 ModelGardenService API. + # + # This class represents the configuration for ModelGardenService, + # 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::ModelGardenService::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 + # # get_publisher_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_publisher_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_publisher_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ModelGardenService 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 `get_publisher_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_publisher_model + + # @private + def initialize parent_rpcs = nil + get_publisher_model_config = parent_rpcs.get_publisher_model if parent_rpcs.respond_to? :get_publisher_model + @get_publisher_model = ::Gapic::Config::Method.new get_publisher_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb new file mode 100644 index 000000000000..19a23f2d2ed6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + # Credentials for the ModelGardenService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb new file mode 100644 index 000000000000..5ee44fbdf992 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + # Path helper methods for the ModelGardenService API. + module Paths + ## + # Create a fully-qualified PublisherModel resource string. + # + # The resource will be in the following format: + # + # `publishers/{publisher}/models/{model}` + # + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def publisher_model_path publisher:, model: + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "publishers/#{publisher}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb new file mode 100644 index 000000000000..8102f2dae111 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/model_garden_service/credentials" +require "google/cloud/ai_platform/v1/model_garden_service/paths" +require "google/cloud/ai_platform/v1/model_garden_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The interface of Model Garden Service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/model_garden_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.new + # + module ModelGardenService + # 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/model_garden_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb new file mode 100644 index 000000000000..30e44b062207 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb @@ -0,0 +1,470 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/model_garden_service_pb" +require "google/cloud/ai_platform/v1/model_garden_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + module Rest + ## + # REST client for the ModelGardenService service. + # + # The interface of Model Garden Service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_garden_service_stub + + ## + # Configure the ModelGardenService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelGardenService clients + # ::Google::Cloud::AIPlatform::V1::ModelGardenService::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 ModelGardenService 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::ModelGardenService::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 + @model_garden_service_stub.universe_domain + end + + ## + # Create a new ModelGardenService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelGardenService 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 + + @model_garden_service_stub = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @model_garden_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 = @model_garden_service_stub.endpoint + config.universe_domain = @model_garden_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @model_garden_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 = @model_garden_service_stub.endpoint + config.universe_domain = @model_garden_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @model_garden_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @model_garden_service_stub.logger + end + + # Service calls + + ## + # Gets a Model Garden publisher model. + # + # @overload get_publisher_model(request, options = nil) + # Pass arguments to `get_publisher_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest, ::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_publisher_model(name: nil, language_code: nil, view: nil, is_hugging_face_model: nil, hugging_face_token: nil) + # Pass arguments to `get_publisher_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PublisherModel resource. + # Format: + # `publishers/{publisher}/models/{publisher_model}` + # @param language_code [::String] + # Optional. The IETF BCP-47 language code representing the language in which + # the publisher model's text information should be written in. + # @param view [::Google::Cloud::AIPlatform::V1::PublisherModelView] + # Optional. PublisherModel view specifying which fields to read. + # @param is_hugging_face_model [::Boolean] + # Optional. Boolean indicates whether the requested model is a Hugging Face + # model. + # @param hugging_face_token [::String] + # Optional. Token used to access Hugging Face gated models. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::PublisherModel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel] + # + # @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::ModelGardenService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPublisherModelRequest.new + # + # # Call the get_publisher_model method. + # result = client.get_publisher_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PublisherModel. + # p result + # + def get_publisher_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest + + # 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_publisher_model.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_publisher_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_publisher_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_garden_service_stub.get_publisher_model 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 ModelGardenService REST API. + # + # This class represents the configuration for ModelGardenService 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::ModelGardenService::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 + # # get_publisher_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_publisher_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_publisher_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ModelGardenService 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 `get_publisher_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_publisher_model + + # @private + def initialize parent_rpcs = nil + get_publisher_model_config = parent_rpcs.get_publisher_model if parent_rpcs.respond_to? :get_publisher_model + @get_publisher_model = ::Gapic::Config::Method.new get_publisher_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb new file mode 100644 index 000000000000..59445abeb3aa --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/model_garden_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + module Rest + ## + # REST service stub for the ModelGardenService 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 get_publisher_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest] + # 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::PublisherModel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel] + # A result object deserialized from the server's reply + def get_publisher_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_publisher_model_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_publisher_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::PublisherModel.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 get_publisher_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest] + # 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_publisher_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service.rb new file mode 100644 index 000000000000..b3cbcb3cdab5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/model_service/credentials" +require "google/cloud/ai_platform/v1/model_service/paths" +require "google/cloud/ai_platform/v1/model_service/operations" +require "google/cloud/ai_platform/v1/model_service/client" +require "google/cloud/ai_platform/v1/model_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's machine learning Models. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/model_service" + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/model_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.new + # + module ModelService + end + end + end + end +end + +helper_path = ::File.join __dir__, "model_service", "helpers.rb" +require "google/cloud/ai_platform/v1/model_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/client.rb new file mode 100644 index 000000000000..72fe4f457da0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/client.rb @@ -0,0 +1,2376 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/model_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + ## + # Client for the ModelService service. + # + # A service for managing Vertex AI's machine learning Models. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_service_stub + + ## + # Configure the ModelService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ModelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelService clients + # ::Google::Cloud::AIPlatform::V1::ModelService::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 ModelService 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::ModelService::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 + @model_service_stub.universe_domain + end + + ## + # Create a new ModelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelService 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/model_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 + + @model_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ModelService::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 + ) + + @model_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 = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.logger = @model_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 = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.logger = @model_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ModelService::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 + @model_service_stub.logger + end + + # Service calls + + ## + # Uploads a Model artifact into Vertex AI. + # + # @overload upload_model(request, options = nil) + # Pass arguments to `upload_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UploadModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UploadModelRequest, ::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 upload_model(parent: nil, parent_model: nil, model_id: nil, model: nil, service_account: nil) + # Pass arguments to `upload_model` 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 into which to upload the Model. + # Format: `projects/{project}/locations/{location}` + # @param parent_model [::String] + # Optional. The resource name of the model into which to upload the version. + # Only specify this field when uploading a new version. + # @param model_id [::String] + # Optional. The ID to use for the uploaded Model, which will become the final + # component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @param model [::Google::Cloud::AIPlatform::V1::Model, ::Hash] + # Required. The Model to create. + # @param service_account [::String] + # Optional. The user-provided custom service account to use to do the model + # upload. If empty, [Vertex AI Service + # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + # will be used to access resources needed to upload the model. This account + # must belong to the target project where the model is uploaded to, i.e., the + # project specified in the `parent` field of this request and have necessary + # read permissions (to Google Cloud Storage, Artifact Registry, etc.). + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UploadModelRequest.new + # + # # Call the upload_model method. + # result = client.upload_model 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 upload_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadModelRequest + + # 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.upload_model.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.upload_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :upload_model, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelRequest, ::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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # + # In order to retrieve a specific version of the model, also provide + # the version ID or version alias. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # If no version ID or alias is specified, the "default" version will be + # returned. The "default" version alias is created for the first version of + # the model, and can be moved to other versions later on. There will be + # exactly one default version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelRequest + + # 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_model.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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :get_model, 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 Models in a Location. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelsRequest, ::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_models(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Models from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `model` supports = and !=. `model` represents the Model ID, + # i.e. the last segment of the Model's [resource + # name][google.cloud.aiplatform.v1.Model.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports = + # + # Some examples: + # + # * `model=1234` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_models ModelService.ListModels} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models 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::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelsRequest + + # 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_models.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_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :list_models, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_models, 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 + + ## + # Lists versions of the specified model. + # + # @overload list_model_versions(request, options = nil) + # Pass arguments to `list_model_versions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest, ::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_model_versions(name: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_model_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model to list versions for. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse#next_page_token next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_versions ListModelVersions} + # call. + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `labels.myKey="myValue"` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # 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: `update_time asc, create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelVersionsRequest.new + # + # # Call the list_model_versions method. + # result = client.list_model_versions 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::Model. + # p item + # end + # + def list_model_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest + + # 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_model_versions.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_model_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_model_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :list_model_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Model. + # + # @overload update_model(request, options = nil) + # Pass arguments to `update_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateModelRequest, ::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_model(model: nil, update_mask: nil) + # Pass arguments to `update_model` 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 model [::Google::Cloud::AIPlatform::V1::Model, ::Hash] + # Required. The Model which replaces the resource on the server. + # When Model Versioning is enabled, the model.name will be used to determine + # whether to update the model or model version. + # 1. model.name with the @ value, e.g. models/123@1, refers to a version + # specific update. + # 2. model.name without the @ value, e.g. models/123, refers to a model + # update. + # 3. model.name with @-, e.g. models/123@-, refers to a model update. + # 4. Supported model fields: display_name, description; supported + # version-specific fields: version_description. Labels are supported in both + # scenarios. Both the model labels and the version labels are merged when a + # model is returned. When updating labels, if the request is for + # model-specific update, model label gets updated. Otherwise, version labels + # get updated. + # 5. A model name or model version name fields update mismatch will cause a + # precondition error. + # 6. One request cannot update both the model and the version fields. You + # must update them separately. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateModelRequest.new + # + # # Call the update_model method. + # result = client.update_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def update_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateModelRequest + + # 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_model.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.model&.name + header_params["model.name"] = request.model.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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :update_model, 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 + + ## + # Incrementally update the dataset used for an examples model. + # + # @overload update_explanation_dataset(request, options = nil) + # Pass arguments to `update_explanation_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest, ::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_explanation_dataset(model: nil, examples: nil) + # Pass arguments to `update_explanation_dataset` 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 model [::String] + # Required. The resource name of the Model to update. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @param examples [::Google::Cloud::AIPlatform::V1::Examples, ::Hash] + # The example config containing the location of the dataset. + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest.new + # + # # Call the update_explanation_dataset method. + # result = client.update_explanation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_explanation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest + + # 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_explanation_dataset.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.model + header_params["model"] = request.model + 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_explanation_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_explanation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :update_explanation_dataset, 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 Model. + # + # A model cannot be deleted if any + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} resource has a + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} based on the + # model in its + # {::Google::Cloud::AIPlatform::V1::Endpoint#deployed_models deployed_models} + # field. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelRequest, ::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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Model resource to be deleted. + # Format: `projects/{project}/locations/{location}/models/{model}` + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelRequest + + # 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_model.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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :delete_model, 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 Model version. + # + # Model version can only be deleted if there are no + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModels} created from it. + # Deleting the only version in the Model is not allowed. Use + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model DeleteModel} for + # deleting the Model instead. + # + # @overload delete_model_version(request, options = nil) + # Pass arguments to `delete_model_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest, ::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_model_version(name: nil) + # Pass arguments to `delete_model_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model version to be deleted, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest.new + # + # # Call the delete_model_version method. + # result = client.delete_model_version 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_model_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest + + # 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_model_version.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_model_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_model_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :delete_model_version, 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 + + ## + # Merges a set of aliases for a Model version. + # + # @overload merge_version_aliases(request, options = nil) + # Pass arguments to `merge_version_aliases` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest, ::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 merge_version_aliases(name: nil, version_aliases: nil) + # Pass arguments to `merge_version_aliases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model version to merge aliases, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + # @param version_aliases [::Array<::String>] + # Required. The set of version aliases to merge. + # The alias should be at most 128 characters, and match + # `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. + # Add the `-` prefix to an alias means removing that alias from the version. + # `-` is NOT counted in the 128 characters. Example: `-golden` means removing + # the `golden` alias from the version. + # + # There is NO ordering in aliases, which means + # 1) The aliases returned from GetModel API might not have the exactly same + # order from this MergeVersionAliases API. 2) Adding and deleting the same + # alias in the request is not recommended, and the 2 operations will be + # cancelled out. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest.new + # + # # Call the merge_version_aliases method. + # result = client.merge_version_aliases request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def merge_version_aliases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest + + # 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.merge_version_aliases.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.merge_version_aliases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.merge_version_aliases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :merge_version_aliases, 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 + + ## + # Exports a trained, exportable Model to a location specified by the + # user. A Model is considered to be exportable if it has at least one + # [supported export + # format][google.cloud.aiplatform.v1.Model.supported_export_formats]. + # + # @overload export_model(request, options = nil) + # Pass arguments to `export_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportModelRequest, ::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 export_model(name: nil, output_config: nil) + # Pass arguments to `export_model` 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 Model to export. + # The resource name may contain version id or version alias to specify the + # version, if no version is specified, the default version will be exported. + # @param output_config [::Google::Cloud::AIPlatform::V1::ExportModelRequest::OutputConfig, ::Hash] + # Required. The desired output location and configuration. + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportModelRequest.new + # + # # Call the export_model method. + # result = client.export_model 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 export_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportModelRequest + + # 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.export_model.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.export_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :export_model, 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 + + ## + # Copies an already existing Vertex AI Model into the specified Location. + # The source Model must exist in the same Project. + # When copying custom Models, the users themselves are responsible for + # {::Google::Cloud::AIPlatform::V1::Model#metadata Model.metadata} content to be + # region-agnostic, as well as making sure that any resources (e.g. files) it + # depends on remain accessible. + # + # @overload copy_model(request, options = nil) + # Pass arguments to `copy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CopyModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CopyModelRequest, ::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 copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil) + # Pass arguments to `copy_model` 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 model_id [::String] + # Optional. Copy source_model into a new Model with this ID. The ID will + # become the final component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @param parent_model [::String] + # Optional. Specify this field to copy source_model into this existing + # Model as a new version. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @param parent [::String] + # Required. The resource name of the Location into which to copy the Model. + # Format: `projects/{project}/locations/{location}` + # @param source_model [::String] + # Required. The resource name of the Model to copy. That Model must be in the + # same Project. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @param encryption_spec [::Google::Cloud::AIPlatform::V1::EncryptionSpec, ::Hash] + # Customer-managed encryption key options. If this is set, + # then the Model copy will be encrypted with the provided encryption key. + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CopyModelRequest.new + # + # # Call the copy_model method. + # result = client.copy_model 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 copy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CopyModelRequest + + # 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.copy_model.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.copy_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.copy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :copy_model, 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 + + ## + # Imports an externally generated ModelEvaluation. + # + # @overload import_model_evaluation(request, options = nil) + # Pass arguments to `import_model_evaluation` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest, ::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 import_model_evaluation(parent: nil, model_evaluation: nil) + # Pass arguments to `import_model_evaluation` 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 name of the parent model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @param model_evaluation [::Google::Cloud::AIPlatform::V1::ModelEvaluation, ::Hash] + # Required. Model evaluation resource to be imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest.new + # + # # Call the import_model_evaluation method. + # result = client.import_model_evaluation request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + # p result + # + def import_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest + + # 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.import_model_evaluation.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.import_model_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :import_model_evaluation, 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 + + ## + # Imports a list of externally generated ModelEvaluationSlice. + # + # @overload batch_import_model_evaluation_slices(request, options = nil) + # Pass arguments to `batch_import_model_evaluation_slices` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest, ::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 batch_import_model_evaluation_slices(parent: nil, model_evaluation_slices: nil) + # Pass arguments to `batch_import_model_evaluation_slices` 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 name of the parent ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @param model_evaluation_slices [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice, ::Hash>] + # Required. Model evaluation slice resource to be imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest.new + # + # # Call the batch_import_model_evaluation_slices method. + # result = client.batch_import_model_evaluation_slices request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse. + # p result + # + def batch_import_model_evaluation_slices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest + + # 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.batch_import_model_evaluation_slices.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.batch_import_model_evaluation_slices.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_import_model_evaluation_slices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :batch_import_model_evaluation_slices, 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 + + ## + # Imports a list of externally generated EvaluatedAnnotations. + # + # @overload batch_import_evaluated_annotations(request, options = nil) + # Pass arguments to `batch_import_evaluated_annotations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest, ::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 batch_import_evaluated_annotations(parent: nil, evaluated_annotations: nil) + # Pass arguments to `batch_import_evaluated_annotations` 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 name of the parent ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # @param evaluated_annotations [::Array<::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation, ::Hash>] + # Required. Evaluated annotations resource to be imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest.new + # + # # Call the batch_import_evaluated_annotations method. + # result = client.batch_import_evaluated_annotations request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse. + # p result + # + def batch_import_evaluated_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest + + # 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.batch_import_evaluated_annotations.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.batch_import_evaluated_annotations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_import_evaluated_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :batch_import_evaluated_annotations, 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 + + ## + # Gets a ModelEvaluation. + # + # @overload get_model_evaluation(request, options = nil) + # Pass arguments to `get_model_evaluation` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest, ::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_model_evaluation(name: nil) + # Pass arguments to `get_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest.new + # + # # Call the get_model_evaluation method. + # result = client.get_model_evaluation request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + # p result + # + def get_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest + + # 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_model_evaluation.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_model_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :get_model_evaluation, 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 ModelEvaluations in a Model. + # + # @overload list_model_evaluations(request, options = nil) + # Pass arguments to `list_model_evaluations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest, ::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_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_evaluations` 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 Model to list the ModelEvaluations from. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @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. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluations ModelService.ListModelEvaluations} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest.new + # + # # Call the list_model_evaluations method. + # result = client.list_model_evaluations 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::ModelEvaluation. + # p item + # end + # + def list_model_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest + + # 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_model_evaluations.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_model_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_model_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_evaluations, 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 + + ## + # Gets a ModelEvaluationSlice. + # + # @overload get_model_evaluation_slice(request, options = nil) + # Pass arguments to `get_model_evaluation_slice` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest, ::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_model_evaluation_slice(name: nil) + # Pass arguments to `get_model_evaluation_slice` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest.new + # + # # Call the get_model_evaluation_slice method. + # result = client.get_model_evaluation_slice request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. + # p result + # + def get_model_evaluation_slice request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest + + # 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_model_evaluation_slice.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_model_evaluation_slice.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model_evaluation_slice.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :get_model_evaluation_slice, 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 ModelEvaluationSlices in a ModelEvaluation. + # + # @overload list_model_evaluation_slices(request, options = nil) + # Pass arguments to `list_model_evaluation_slices` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest, ::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_model_evaluation_slices(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_evaluation_slices` 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 ModelEvaluation to list the + # ModelEvaluationSlices from. Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @param filter [::String] + # The standard list filter. + # + # * `slice.dimension` - for =. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse#next_page_token ListModelEvaluationSlicesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # + # @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::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest.new + # + # # Call the list_model_evaluation_slices method. + # result = client.list_model_evaluation_slices 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::ModelEvaluationSlice. + # p item + # end + # + def list_model_evaluation_slices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest + + # 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_model_evaluation_slices.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_model_evaluation_slices.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_model_evaluation_slices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :list_model_evaluation_slices, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_evaluation_slices, 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 + + ## + # Configuration class for the ModelService API. + # + # This class represents the configuration for ModelService, + # 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::ModelService::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 + # # upload_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ModelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.upload_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.upload_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ModelService 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 `upload_model` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_model + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `list_model_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_versions + ## + # RPC-specific configuration for `update_model` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model + ## + # RPC-specific configuration for `update_explanation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_explanation_dataset + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + ## + # RPC-specific configuration for `delete_model_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model_version + ## + # RPC-specific configuration for `merge_version_aliases` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_version_aliases + ## + # RPC-specific configuration for `export_model` + # @return [::Gapic::Config::Method] + # + attr_reader :export_model + ## + # RPC-specific configuration for `copy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :copy_model + ## + # RPC-specific configuration for `import_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :import_model_evaluation + ## + # RPC-specific configuration for `batch_import_model_evaluation_slices` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_import_model_evaluation_slices + ## + # RPC-specific configuration for `batch_import_evaluated_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_import_evaluated_annotations + ## + # RPC-specific configuration for `get_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_evaluation + ## + # RPC-specific configuration for `list_model_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_evaluations + ## + # RPC-specific configuration for `get_model_evaluation_slice` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_evaluation_slice + ## + # RPC-specific configuration for `list_model_evaluation_slices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_evaluation_slices + + # @private + def initialize parent_rpcs = nil + upload_model_config = parent_rpcs.upload_model if parent_rpcs.respond_to? :upload_model + @upload_model = ::Gapic::Config::Method.new upload_model_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + list_model_versions_config = parent_rpcs.list_model_versions if parent_rpcs.respond_to? :list_model_versions + @list_model_versions = ::Gapic::Config::Method.new list_model_versions_config + update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model + @update_model = ::Gapic::Config::Method.new update_model_config + update_explanation_dataset_config = parent_rpcs.update_explanation_dataset if parent_rpcs.respond_to? :update_explanation_dataset + @update_explanation_dataset = ::Gapic::Config::Method.new update_explanation_dataset_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + delete_model_version_config = parent_rpcs.delete_model_version if parent_rpcs.respond_to? :delete_model_version + @delete_model_version = ::Gapic::Config::Method.new delete_model_version_config + merge_version_aliases_config = parent_rpcs.merge_version_aliases if parent_rpcs.respond_to? :merge_version_aliases + @merge_version_aliases = ::Gapic::Config::Method.new merge_version_aliases_config + export_model_config = parent_rpcs.export_model if parent_rpcs.respond_to? :export_model + @export_model = ::Gapic::Config::Method.new export_model_config + copy_model_config = parent_rpcs.copy_model if parent_rpcs.respond_to? :copy_model + @copy_model = ::Gapic::Config::Method.new copy_model_config + import_model_evaluation_config = parent_rpcs.import_model_evaluation if parent_rpcs.respond_to? :import_model_evaluation + @import_model_evaluation = ::Gapic::Config::Method.new import_model_evaluation_config + batch_import_model_evaluation_slices_config = parent_rpcs.batch_import_model_evaluation_slices if parent_rpcs.respond_to? :batch_import_model_evaluation_slices + @batch_import_model_evaluation_slices = ::Gapic::Config::Method.new batch_import_model_evaluation_slices_config + batch_import_evaluated_annotations_config = parent_rpcs.batch_import_evaluated_annotations if parent_rpcs.respond_to? :batch_import_evaluated_annotations + @batch_import_evaluated_annotations = ::Gapic::Config::Method.new batch_import_evaluated_annotations_config + get_model_evaluation_config = parent_rpcs.get_model_evaluation if parent_rpcs.respond_to? :get_model_evaluation + @get_model_evaluation = ::Gapic::Config::Method.new get_model_evaluation_config + list_model_evaluations_config = parent_rpcs.list_model_evaluations if parent_rpcs.respond_to? :list_model_evaluations + @list_model_evaluations = ::Gapic::Config::Method.new list_model_evaluations_config + get_model_evaluation_slice_config = parent_rpcs.get_model_evaluation_slice if parent_rpcs.respond_to? :get_model_evaluation_slice + @get_model_evaluation_slice = ::Gapic::Config::Method.new get_model_evaluation_slice_config + list_model_evaluation_slices_config = parent_rpcs.list_model_evaluation_slices if parent_rpcs.respond_to? :list_model_evaluation_slices + @list_model_evaluation_slices = ::Gapic::Config::Method.new list_model_evaluation_slices_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/credentials.rb new file mode 100644 index 000000000000..92be0ea229e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + # Credentials for the ModelService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/operations.rb new file mode 100644 index 000000000000..cf111571dd8d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + # 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 ModelService 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 ModelService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/paths.rb new file mode 100644 index 000000000000..0d70e1c98292 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/paths.rb @@ -0,0 +1,196 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + # Path helper methods for the ModelService API. + module Paths + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified ModelEvaluation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # @param evaluation [String] + # + # @return [::String] + def model_evaluation_path project:, location:, model:, evaluation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}/evaluations/#{evaluation}" + end + + ## + # Create a fully-qualified ModelEvaluationSlice resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # @param evaluation [String] + # @param slice [String] + # + # @return [::String] + def model_evaluation_slice_path project:, location:, model:, evaluation:, slice: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/" + raise ::ArgumentError, "evaluation cannot contain /" if evaluation.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}/evaluations/#{evaluation}/slices/#{slice}" + end + + ## + # Create a fully-qualified PipelineJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @param project [String] + # @param location [String] + # @param pipeline_job [String] + # + # @return [::String] + def pipeline_job_path project:, location:, pipeline_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/pipelineJobs/#{pipeline_job}" + end + + ## + # Create a fully-qualified TrainingPipeline resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # + # @param project [String] + # @param location [String] + # @param training_pipeline [String] + # + # @return [::String] + def training_pipeline_path project:, location:, training_pipeline: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/trainingPipelines/#{training_pipeline}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest.rb new file mode 100644 index 000000000000..4059ef7eae51 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/model_service/credentials" +require "google/cloud/ai_platform/v1/model_service/paths" +require "google/cloud/ai_platform/v1/model_service/rest/operations" +require "google/cloud/ai_platform/v1/model_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's machine learning Models. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/model_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.new + # + module ModelService + # 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/model_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb new file mode 100644 index 000000000000..2f9da205e7e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb @@ -0,0 +1,2233 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/model_service_pb" +require "google/cloud/ai_platform/v1/model_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + module Rest + ## + # REST client for the ModelService service. + # + # A service for managing Vertex AI's machine learning Models. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_service_stub + + ## + # Configure the ModelService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelService clients + # ::Google::Cloud::AIPlatform::V1::ModelService::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 ModelService 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::ModelService::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 + @model_service_stub.universe_domain + end + + ## + # Create a new ModelService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelService 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::ModelService::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 + + @model_service_stub = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @model_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 = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @model_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 = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @model_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ModelService::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 + @model_service_stub.logger + end + + # Service calls + + ## + # Uploads a Model artifact into Vertex AI. + # + # @overload upload_model(request, options = nil) + # Pass arguments to `upload_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UploadModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UploadModelRequest, ::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 upload_model(parent: nil, parent_model: nil, model_id: nil, model: nil, service_account: nil) + # Pass arguments to `upload_model` 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 into which to upload the Model. + # Format: `projects/{project}/locations/{location}` + # @param parent_model [::String] + # Optional. The resource name of the model into which to upload the version. + # Only specify this field when uploading a new version. + # @param model_id [::String] + # Optional. The ID to use for the uploaded Model, which will become the final + # component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @param model [::Google::Cloud::AIPlatform::V1::Model, ::Hash] + # Required. The Model to create. + # @param service_account [::String] + # Optional. The user-provided custom service account to use to do the model + # upload. If empty, [Vertex AI Service + # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + # will be used to access resources needed to upload the model. This account + # must belong to the target project where the model is uploaded to, i.e., the + # project specified in the `parent` field of this request and have necessary + # read permissions (to Google Cloud Storage, Artifact Registry, etc.). + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UploadModelRequest.new + # + # # Call the upload_model method. + # result = client.upload_model 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 upload_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadModelRequest + + # 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.upload_model.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.upload_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upload_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.upload_model request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelRequest, ::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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # + # In order to retrieve a specific version of the model, also provide + # the version ID or version alias. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # If no version ID or alias is specified, the "default" version will be + # returned. The "default" version alias is created for the first version of + # the model, and can be moved to other versions later on. There will be + # exactly one default version. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelRequest + + # 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_model.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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.get_model 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 Models in a Location. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelsRequest, ::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_models(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Models from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `model` supports = and !=. `model` represents the Model ID, + # i.e. the last segment of the Model's [resource + # name][google.cloud.aiplatform.v1.Model.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports = + # + # Some examples: + # + # * `model=1234` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client#list_models ModelService.ListModels} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models 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::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelsRequest + + # 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_models.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_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.list_models request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_models, "models", 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 + + ## + # Lists versions of the specified model. + # + # @overload list_model_versions(request, options = nil) + # Pass arguments to `list_model_versions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest, ::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_model_versions(name: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_model_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model to list versions for. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse#next_page_token next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client#list_model_versions ListModelVersions} + # call. + # @param filter [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `labels.myKey="myValue"` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @param order_by [::String] + # 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: `update_time asc, create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelVersionsRequest.new + # + # # Call the list_model_versions method. + # result = client.list_model_versions 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::Model. + # p item + # end + # + def list_model_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest + + # 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_model_versions.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_model_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_model_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.list_model_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_versions, "models", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Model. + # + # @overload update_model(request, options = nil) + # Pass arguments to `update_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateModelRequest, ::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_model(model: nil, update_mask: nil) + # Pass arguments to `update_model` 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 model [::Google::Cloud::AIPlatform::V1::Model, ::Hash] + # Required. The Model which replaces the resource on the server. + # When Model Versioning is enabled, the model.name will be used to determine + # whether to update the model or model version. + # 1. model.name with the @ value, e.g. models/123@1, refers to a version + # specific update. + # 2. model.name without the @ value, e.g. models/123, refers to a model + # update. + # 3. model.name with @-, e.g. models/123@-, refers to a model update. + # 4. Supported model fields: display_name, description; supported + # version-specific fields: version_description. Labels are supported in both + # scenarios. Both the model labels and the version labels are merged when a + # model is returned. When updating labels, if the request is for + # model-specific update, model label gets updated. Otherwise, version labels + # get updated. + # 5. A model name or model version name fields update mismatch will cause a + # precondition error. + # 6. One request cannot update both the model and the version fields. You + # must update them separately. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateModelRequest.new + # + # # Call the update_model method. + # result = client.update_model request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def update_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateModelRequest + + # 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_model.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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.update_model 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 + + ## + # Incrementally update the dataset used for an examples model. + # + # @overload update_explanation_dataset(request, options = nil) + # Pass arguments to `update_explanation_dataset` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest, ::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_explanation_dataset(model: nil, examples: nil) + # Pass arguments to `update_explanation_dataset` 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 model [::String] + # Required. The resource name of the Model to update. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @param examples [::Google::Cloud::AIPlatform::V1::Examples, ::Hash] + # The example config containing the location of the dataset. + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest.new + # + # # Call the update_explanation_dataset method. + # result = client.update_explanation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_explanation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest + + # 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_explanation_dataset.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_explanation_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_explanation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.update_explanation_dataset 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 Model. + # + # A model cannot be deleted if any + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} resource has a + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} based on the + # model in its + # {::Google::Cloud::AIPlatform::V1::Endpoint#deployed_models deployed_models} + # field. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelRequest, ::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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Model resource to be deleted. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelRequest + + # 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_model.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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.delete_model 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 Model version. + # + # Model version can only be deleted if there are no + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModels} created from it. + # Deleting the only version in the Model is not allowed. Use + # {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client#delete_model DeleteModel} for + # deleting the Model instead. + # + # @overload delete_model_version(request, options = nil) + # Pass arguments to `delete_model_version` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest, ::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_model_version(name: nil) + # Pass arguments to `delete_model_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model version to be deleted, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest.new + # + # # Call the delete_model_version method. + # result = client.delete_model_version 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_model_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest + + # 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_model_version.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_model_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_model_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.delete_model_version 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 + + ## + # Merges a set of aliases for a Model version. + # + # @overload merge_version_aliases(request, options = nil) + # Pass arguments to `merge_version_aliases` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest, ::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 merge_version_aliases(name: nil, version_aliases: nil) + # Pass arguments to `merge_version_aliases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the model version to merge aliases, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + # @param version_aliases [::Array<::String>] + # Required. The set of version aliases to merge. + # The alias should be at most 128 characters, and match + # `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. + # Add the `-` prefix to an alias means removing that alias from the version. + # `-` is NOT counted in the 128 characters. Example: `-golden` means removing + # the `golden` alias from the version. + # + # There is NO ordering in aliases, which means + # 1) The aliases returned from GetModel API might not have the exactly same + # order from this MergeVersionAliases API. 2) Adding and deleting the same + # alias in the request is not recommended, and the 2 operations will be + # cancelled out. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest.new + # + # # Call the merge_version_aliases method. + # result = client.merge_version_aliases request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + # p result + # + def merge_version_aliases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest + + # 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.merge_version_aliases.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.merge_version_aliases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.merge_version_aliases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.merge_version_aliases 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 + + ## + # Exports a trained, exportable Model to a location specified by the + # user. A Model is considered to be exportable if it has at least one + # [supported export + # format][google.cloud.aiplatform.v1.Model.supported_export_formats]. + # + # @overload export_model(request, options = nil) + # Pass arguments to `export_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportModelRequest, ::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 export_model(name: nil, output_config: nil) + # Pass arguments to `export_model` 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 Model to export. + # The resource name may contain version id or version alias to specify the + # version, if no version is specified, the default version will be exported. + # @param output_config [::Google::Cloud::AIPlatform::V1::ExportModelRequest::OutputConfig, ::Hash] + # Required. The desired output location and configuration. + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportModelRequest.new + # + # # Call the export_model method. + # result = client.export_model 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 export_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportModelRequest + + # 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.export_model.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.export_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.export_model 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 + + ## + # Copies an already existing Vertex AI Model into the specified Location. + # The source Model must exist in the same Project. + # When copying custom Models, the users themselves are responsible for + # {::Google::Cloud::AIPlatform::V1::Model#metadata Model.metadata} content to be + # region-agnostic, as well as making sure that any resources (e.g. files) it + # depends on remain accessible. + # + # @overload copy_model(request, options = nil) + # Pass arguments to `copy_model` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CopyModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CopyModelRequest, ::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 copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil) + # Pass arguments to `copy_model` 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 model_id [::String] + # Optional. Copy source_model into a new Model with this ID. The ID will + # become the final component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @param parent_model [::String] + # Optional. Specify this field to copy source_model into this existing + # Model as a new version. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @param parent [::String] + # Required. The resource name of the Location into which to copy the Model. + # Format: `projects/{project}/locations/{location}` + # @param source_model [::String] + # Required. The resource name of the Model to copy. That Model must be in the + # same Project. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @param encryption_spec [::Google::Cloud::AIPlatform::V1::EncryptionSpec, ::Hash] + # Customer-managed encryption key options. If this is set, + # then the Model copy will be encrypted with the provided encryption key. + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CopyModelRequest.new + # + # # Call the copy_model method. + # result = client.copy_model 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 copy_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CopyModelRequest + + # 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.copy_model.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.copy_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.copy_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.copy_model 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 + + ## + # Imports an externally generated ModelEvaluation. + # + # @overload import_model_evaluation(request, options = nil) + # Pass arguments to `import_model_evaluation` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest, ::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 import_model_evaluation(parent: nil, model_evaluation: nil) + # Pass arguments to `import_model_evaluation` 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 name of the parent model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @param model_evaluation [::Google::Cloud::AIPlatform::V1::ModelEvaluation, ::Hash] + # Required. Model evaluation resource to be imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest.new + # + # # Call the import_model_evaluation method. + # result = client.import_model_evaluation request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + # p result + # + def import_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest + + # 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.import_model_evaluation.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.import_model_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.import_model_evaluation 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 + + ## + # Imports a list of externally generated ModelEvaluationSlice. + # + # @overload batch_import_model_evaluation_slices(request, options = nil) + # Pass arguments to `batch_import_model_evaluation_slices` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest, ::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 batch_import_model_evaluation_slices(parent: nil, model_evaluation_slices: nil) + # Pass arguments to `batch_import_model_evaluation_slices` 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 name of the parent ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @param model_evaluation_slices [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice, ::Hash>] + # Required. Model evaluation slice resource to be imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest.new + # + # # Call the batch_import_model_evaluation_slices method. + # result = client.batch_import_model_evaluation_slices request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse. + # p result + # + def batch_import_model_evaluation_slices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest + + # 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.batch_import_model_evaluation_slices.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.batch_import_model_evaluation_slices.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_import_model_evaluation_slices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.batch_import_model_evaluation_slices 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 + + ## + # Imports a list of externally generated EvaluatedAnnotations. + # + # @overload batch_import_evaluated_annotations(request, options = nil) + # Pass arguments to `batch_import_evaluated_annotations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest, ::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 batch_import_evaluated_annotations(parent: nil, evaluated_annotations: nil) + # Pass arguments to `batch_import_evaluated_annotations` 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 name of the parent ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # @param evaluated_annotations [::Array<::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation, ::Hash>] + # Required. Evaluated annotations resource to be imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest.new + # + # # Call the batch_import_evaluated_annotations method. + # result = client.batch_import_evaluated_annotations request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse. + # p result + # + def batch_import_evaluated_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest + + # 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.batch_import_evaluated_annotations.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.batch_import_evaluated_annotations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_import_evaluated_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.batch_import_evaluated_annotations 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 + + ## + # Gets a ModelEvaluation. + # + # @overload get_model_evaluation(request, options = nil) + # Pass arguments to `get_model_evaluation` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest, ::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_model_evaluation(name: nil) + # Pass arguments to `get_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest.new + # + # # Call the get_model_evaluation method. + # result = client.get_model_evaluation request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + # p result + # + def get_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest + + # 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_model_evaluation.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_model_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.get_model_evaluation 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 ModelEvaluations in a Model. + # + # @overload list_model_evaluations(request, options = nil) + # Pass arguments to `list_model_evaluations` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest, ::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_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_evaluations` 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 Model to list the ModelEvaluations from. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @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. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client#list_model_evaluations ModelService.ListModelEvaluations} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest.new + # + # # Call the list_model_evaluations method. + # result = client.list_model_evaluations 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::ModelEvaluation. + # p item + # end + # + def list_model_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest + + # 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_model_evaluations.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_model_evaluations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_model_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.list_model_evaluations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_evaluations, "model_evaluations", 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 a ModelEvaluationSlice. + # + # @overload get_model_evaluation_slice(request, options = nil) + # Pass arguments to `get_model_evaluation_slice` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest, ::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_model_evaluation_slice(name: nil) + # Pass arguments to `get_model_evaluation_slice` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest.new + # + # # Call the get_model_evaluation_slice method. + # result = client.get_model_evaluation_slice request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. + # p result + # + def get_model_evaluation_slice request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest + + # 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_model_evaluation_slice.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_model_evaluation_slice.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model_evaluation_slice.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.get_model_evaluation_slice 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 ModelEvaluationSlices in a ModelEvaluation. + # + # @overload list_model_evaluation_slices(request, options = nil) + # Pass arguments to `list_model_evaluation_slices` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest, ::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_model_evaluation_slices(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_model_evaluation_slices` 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 ModelEvaluation to list the + # ModelEvaluationSlices from. Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @param filter [::String] + # The standard list filter. + # + # * `slice.dimension` - for =. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse#next_page_token ListModelEvaluationSlicesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # + # @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::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest.new + # + # # Call the list_model_evaluation_slices method. + # result = client.list_model_evaluation_slices 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::ModelEvaluationSlice. + # p item + # end + # + def list_model_evaluation_slices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest + + # 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_model_evaluation_slices.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_model_evaluation_slices.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_model_evaluation_slices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.list_model_evaluation_slices request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_evaluation_slices, "model_evaluation_slices", 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 + + ## + # Configuration class for the ModelService REST API. + # + # This class represents the configuration for ModelService 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::ModelService::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 + # # upload_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.upload_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ModelService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.upload_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ModelService 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 `upload_model` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_model + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `list_model_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_versions + ## + # RPC-specific configuration for `update_model` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model + ## + # RPC-specific configuration for `update_explanation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_explanation_dataset + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + ## + # RPC-specific configuration for `delete_model_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model_version + ## + # RPC-specific configuration for `merge_version_aliases` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_version_aliases + ## + # RPC-specific configuration for `export_model` + # @return [::Gapic::Config::Method] + # + attr_reader :export_model + ## + # RPC-specific configuration for `copy_model` + # @return [::Gapic::Config::Method] + # + attr_reader :copy_model + ## + # RPC-specific configuration for `import_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :import_model_evaluation + ## + # RPC-specific configuration for `batch_import_model_evaluation_slices` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_import_model_evaluation_slices + ## + # RPC-specific configuration for `batch_import_evaluated_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_import_evaluated_annotations + ## + # RPC-specific configuration for `get_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_evaluation + ## + # RPC-specific configuration for `list_model_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_evaluations + ## + # RPC-specific configuration for `get_model_evaluation_slice` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model_evaluation_slice + ## + # RPC-specific configuration for `list_model_evaluation_slices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_model_evaluation_slices + + # @private + def initialize parent_rpcs = nil + upload_model_config = parent_rpcs.upload_model if parent_rpcs.respond_to? :upload_model + @upload_model = ::Gapic::Config::Method.new upload_model_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + list_model_versions_config = parent_rpcs.list_model_versions if parent_rpcs.respond_to? :list_model_versions + @list_model_versions = ::Gapic::Config::Method.new list_model_versions_config + update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model + @update_model = ::Gapic::Config::Method.new update_model_config + update_explanation_dataset_config = parent_rpcs.update_explanation_dataset if parent_rpcs.respond_to? :update_explanation_dataset + @update_explanation_dataset = ::Gapic::Config::Method.new update_explanation_dataset_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + delete_model_version_config = parent_rpcs.delete_model_version if parent_rpcs.respond_to? :delete_model_version + @delete_model_version = ::Gapic::Config::Method.new delete_model_version_config + merge_version_aliases_config = parent_rpcs.merge_version_aliases if parent_rpcs.respond_to? :merge_version_aliases + @merge_version_aliases = ::Gapic::Config::Method.new merge_version_aliases_config + export_model_config = parent_rpcs.export_model if parent_rpcs.respond_to? :export_model + @export_model = ::Gapic::Config::Method.new export_model_config + copy_model_config = parent_rpcs.copy_model if parent_rpcs.respond_to? :copy_model + @copy_model = ::Gapic::Config::Method.new copy_model_config + import_model_evaluation_config = parent_rpcs.import_model_evaluation if parent_rpcs.respond_to? :import_model_evaluation + @import_model_evaluation = ::Gapic::Config::Method.new import_model_evaluation_config + batch_import_model_evaluation_slices_config = parent_rpcs.batch_import_model_evaluation_slices if parent_rpcs.respond_to? :batch_import_model_evaluation_slices + @batch_import_model_evaluation_slices = ::Gapic::Config::Method.new batch_import_model_evaluation_slices_config + batch_import_evaluated_annotations_config = parent_rpcs.batch_import_evaluated_annotations if parent_rpcs.respond_to? :batch_import_evaluated_annotations + @batch_import_evaluated_annotations = ::Gapic::Config::Method.new batch_import_evaluated_annotations_config + get_model_evaluation_config = parent_rpcs.get_model_evaluation if parent_rpcs.respond_to? :get_model_evaluation + @get_model_evaluation = ::Gapic::Config::Method.new get_model_evaluation_config + list_model_evaluations_config = parent_rpcs.list_model_evaluations if parent_rpcs.respond_to? :list_model_evaluations + @list_model_evaluations = ::Gapic::Config::Method.new list_model_evaluations_config + get_model_evaluation_slice_config = parent_rpcs.get_model_evaluation_slice if parent_rpcs.respond_to? :get_model_evaluation_slice + @get_model_evaluation_slice = ::Gapic::Config::Method.new get_model_evaluation_slice_config + list_model_evaluation_slices_config = parent_rpcs.list_model_evaluation_slices if parent_rpcs.respond_to? :list_model_evaluation_slices + @list_model_evaluation_slices = ::Gapic::Config::Method.new list_model_evaluation_slices_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb new file mode 100644 index 000000000000..e80758f5af7b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + 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 ModelService 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 ModelService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb new file mode 100644 index 000000000000..c262912c7bbf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb @@ -0,0 +1,1188 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/model_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + module Rest + ## + # REST service stub for the ModelService 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 upload_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UploadModelRequest] + # 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 upload_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upload_model_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: "upload_model", + 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_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelRequest] + # 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::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # A result object deserialized from the server's reply + def get_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_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_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Model.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_models REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelsRequest] + # 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::ListModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListModelsResponse] + # A result object deserialized from the server's reply + def list_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_models_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_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListModelsResponse.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_model_versions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest] + # 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::ListModelVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse] + # A result object deserialized from the server's reply + def list_model_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_model_versions_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_model_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse.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_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateModelRequest] + # 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::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # A result object deserialized from the server's reply + def update_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_model_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_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Model.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_explanation_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_explanation_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_explanation_dataset_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_explanation_dataset", + 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_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelRequest] + # 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_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_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_model", + 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_model_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest] + # 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_model_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_version_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_model_version", + 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 merge_version_aliases REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest] + # 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::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Model] + # A result object deserialized from the server's reply + def merge_version_aliases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_merge_version_aliases_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: "merge_version_aliases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Model.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportModelRequest] + # 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 export_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_model_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: "export_model", + 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 copy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CopyModelRequest] + # 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 copy_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_copy_model_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: "copy_model", + 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 import_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest] + # 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::ModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # A result object deserialized from the server's reply + def import_model_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_model_evaluation_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: "import_model_evaluation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ModelEvaluation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_import_model_evaluation_slices REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest] + # 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::BatchImportModelEvaluationSlicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse] + # A result object deserialized from the server's reply + def batch_import_model_evaluation_slices request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_import_model_evaluation_slices_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: "batch_import_model_evaluation_slices", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_import_evaluated_annotations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest] + # 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::BatchImportEvaluatedAnnotationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse] + # A result object deserialized from the server's reply + def batch_import_evaluated_annotations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_import_evaluated_annotations_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: "batch_import_evaluated_annotations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse.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_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest] + # 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::ModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # A result object deserialized from the server's reply + def get_model_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_evaluation_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_model_evaluation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ModelEvaluation.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_model_evaluations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest] + # 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::ListModelEvaluationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse] + # A result object deserialized from the server's reply + def list_model_evaluations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_model_evaluations_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_model_evaluations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse.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_model_evaluation_slice REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest] + # 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::ModelEvaluationSlice] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice] + # A result object deserialized from the server's reply + def get_model_evaluation_slice request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_evaluation_slice_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_model_evaluation_slice", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice.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_model_evaluation_slices REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest] + # 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::ListModelEvaluationSlicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse] + # A result object deserialized from the server's reply + def list_model_evaluation_slices request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_model_evaluation_slices_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_model_evaluation_slices", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse.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 upload_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UploadModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upload_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/models:upload", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_models REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelsRequest] + # 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_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/models", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_model_versions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest] + # 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_model_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:listVersions", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{model.name}", + body: "model", + matches: [ + ["model.name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_explanation_dataset REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest] + # 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_explanation_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:updateExplanationDataset", + body: "*", + matches: [ + ["model", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_model_version REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest] + # 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_model_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}:deleteVersion", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the merge_version_aliases REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_merge_version_aliases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:mergeVersionAliases", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the copy_model REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CopyModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_copy_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/models:copy", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_model_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/evaluations:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_import_model_evaluation_slices REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_import_model_evaluation_slices_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/slices:batchImport", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_import_evaluated_annotations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_import_evaluated_annotations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:batchImport", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/slices/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest] + # 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_model_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_model_evaluations REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest] + # 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_model_evaluations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model_evaluation_slice REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest] + # 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_model_evaluation_slice_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/slices/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_model_evaluation_slices REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest] + # 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_model_evaluation_slices_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/slices", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service.rb new file mode 100644 index 000000000000..11ce5418a0d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/notebook_service/credentials" +require "google/cloud/ai_platform/v1/notebook_service/paths" +require "google/cloud/ai_platform/v1/notebook_service/operations" +require "google/cloud/ai_platform/v1/notebook_service/client" +require "google/cloud/ai_platform/v1/notebook_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/notebook_service" + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/notebook_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.new + # + module NotebookService + end + end + end + end +end + +helper_path = ::File.join __dir__, "notebook_service", "helpers.rb" +require "google/cloud/ai_platform/v1/notebook_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/client.rb new file mode 100644 index 000000000000..eb383f31ce67 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/client.rb @@ -0,0 +1,2160 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/notebook_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + ## + # Client for the NotebookService service. + # + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :notebook_service_stub + + ## + # Configure the NotebookService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::NotebookService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NotebookService clients + # ::Google::Cloud::AIPlatform::V1::NotebookService::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 NotebookService 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::NotebookService::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 + @notebook_service_stub.universe_domain + end + + ## + # Create a new NotebookService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NotebookService 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/notebook_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 + + @notebook_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::NotebookService::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 + ) + + @notebook_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 = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + config.logger = @notebook_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 = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + config.logger = @notebook_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookService::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 + @notebook_service_stub.logger + end + + # Service calls + + ## + # Creates a NotebookRuntimeTemplate. + # + # @overload create_notebook_runtime_template(request, options = nil) + # Pass arguments to `create_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(parent: nil, notebook_runtime_template: nil, notebook_runtime_template_id: nil) + # Pass arguments to `create_notebook_runtime_template` 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 + # NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` + # @param notebook_runtime_template [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate, ::Hash] + # Required. The NotebookRuntimeTemplate to create. + # @param notebook_runtime_template_id [::String] + # Optional. User specified ID for the notebook runtime template. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest.new + # + # # Call the create_notebook_runtime_template method. + # result = client.create_notebook_runtime_template 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_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :create_notebook_runtime_template, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookRuntimeTemplate. + # + # @overload get_notebook_runtime_template(request, options = nil) + # Pass arguments to `get_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) + # Pass arguments to `get_notebook_runtime_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntimeTemplate resource. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest.new + # + # # Call the get_notebook_runtime_template method. + # result = client.get_notebook_runtime_template request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate. + # p result + # + def get_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :get_notebook_runtime_template, 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 NotebookRuntimeTemplates in a Location. + # + # @overload list_notebook_runtime_templates(request, options = nil) + # Pass arguments to `list_notebook_runtime_templates` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest, ::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_notebook_runtime_templates(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_notebook_runtime_templates` 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 from which to list the + # NotebookRuntimeTemplates. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntimeTemplate=notebookRuntimeTemplate123` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `notebookRuntimeType=USER_DEFINED` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse#next_page_token ListNotebookRuntimeTemplatesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtime_templates NotebookService.ListNotebookRuntimeTemplates} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest.new + # + # # Call the list_notebook_runtime_templates method. + # result = client.list_notebook_runtime_templates 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::NotebookRuntimeTemplate. + # p item + # end + # + def list_notebook_runtime_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest + + # 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_notebook_runtime_templates.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_notebook_runtime_templates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notebook_runtime_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :list_notebook_runtime_templates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_notebook_runtime_templates, 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 + + ## + # Deletes a NotebookRuntimeTemplate. + # + # @overload delete_notebook_runtime_template(request, options = nil) + # Pass arguments to `delete_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) + # Pass arguments to `delete_notebook_runtime_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntimeTemplate resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest.new + # + # # Call the delete_notebook_runtime_template method. + # result = client.delete_notebook_runtime_template 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_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :delete_notebook_runtime_template, 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 + + ## + # Updates a NotebookRuntimeTemplate. + # + # @overload update_notebook_runtime_template(request, options = nil) + # Pass arguments to `update_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(notebook_runtime_template: nil, update_mask: nil) + # Pass arguments to `update_notebook_runtime_template` 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 notebook_runtime_template [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate, ::Hash] + # Required. The NotebookRuntimeTemplate to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Input format: + # `{paths: "${updated_filed}"}` Updatable fields: + # + # * `encryption_spec.kms_key_name` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest.new + # + # # Call the update_notebook_runtime_template method. + # result = client.update_notebook_runtime_template request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate. + # p result + # + def update_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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.notebook_runtime_template&.name + header_params["notebook_runtime_template.name"] = request.notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :update_notebook_runtime_template, 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 + + ## + # Assigns a NotebookRuntime to a user for a particular Notebook file. This + # method will either returns an existing assignment or generates a new one. + # + # @overload assign_notebook_runtime(request, options = nil) + # Pass arguments to `assign_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest, ::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 assign_notebook_runtime(parent: nil, notebook_runtime_template: nil, notebook_runtime: nil, notebook_runtime_id: nil) + # Pass arguments to `assign_notebook_runtime` 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 get the NotebookRuntime + # assignment. Format: `projects/{project}/locations/{location}` + # @param notebook_runtime_template [::String] + # Required. The resource name of the NotebookRuntimeTemplate based on which a + # NotebookRuntime will be assigned (reuse or create a new one). + # @param notebook_runtime [::Google::Cloud::AIPlatform::V1::NotebookRuntime, ::Hash] + # Required. Provide runtime specific information (e.g. runtime owner, + # notebook id) used for NotebookRuntime assignment. + # @param notebook_runtime_id [::String] + # Optional. User specified ID for the notebook runtime. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest.new + # + # # Call the assign_notebook_runtime method. + # result = client.assign_notebook_runtime 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 assign_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest + + # 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.assign_notebook_runtime.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.assign_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.assign_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :assign_notebook_runtime, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookRuntime. + # + # @overload get_notebook_runtime(request, options = nil) + # Pass arguments to `get_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) + # Pass arguments to `get_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest.new + # + # # Call the get_notebook_runtime method. + # result = client.get_notebook_runtime request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntime. + # p result + # + def get_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest + + # 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_notebook_runtime.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_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :get_notebook_runtime, 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 NotebookRuntimes in a Location. + # + # @overload list_notebook_runtimes(request, options = nil) + # Pass arguments to `list_notebook_runtimes` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest, ::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_notebook_runtimes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_notebook_runtimes` 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 from which to list the + # NotebookRuntimes. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntime` supports = and !=. `notebookRuntime` represents the + # NotebookRuntime ID, + # i.e. the last segment of the NotebookRuntime's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntime.name]. + # * `displayName` supports = and != and regex. + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, + # HEALTH_STATE_UNSPECIFIED]. + # * `runtimeState` supports = and !=. runtimeState enum: + # [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, + # STOPPED, BEING_UPGRADED, ERROR, INVALID]. + # * `runtimeUser` supports = and !=. + # * API version is UI only: `uiState` supports = and !=. uiState enum: + # [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, + # UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, + # UI_RESOURCE_STATE_CREATION_FAILED]. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntime="notebookRuntime123"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` + # * `healthState=HEALTHY` + # * `runtimeState=RUNNING` + # * `runtimeUser="test@google.com"` + # * `uiState=UI_RESOURCE_STATE_BEING_DELETED` + # * `notebookRuntimeType=USER_DEFINED` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse#next_page_token ListNotebookRuntimesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtimes NotebookService.ListNotebookRuntimes} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest.new + # + # # Call the list_notebook_runtimes method. + # result = client.list_notebook_runtimes 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::NotebookRuntime. + # p item + # end + # + def list_notebook_runtimes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest + + # 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_notebook_runtimes.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_notebook_runtimes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notebook_runtimes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :list_notebook_runtimes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_notebook_runtimes, 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 + + ## + # Deletes a NotebookRuntime. + # + # @overload delete_notebook_runtime(request, options = nil) + # Pass arguments to `delete_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) + # Pass arguments to `delete_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be deleted. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest.new + # + # # Call the delete_notebook_runtime method. + # result = client.delete_notebook_runtime 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_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest + + # 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_notebook_runtime.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_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :delete_notebook_runtime, 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 + + ## + # Upgrades a NotebookRuntime. + # + # @overload upgrade_notebook_runtime(request, options = nil) + # Pass arguments to `upgrade_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest, ::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 upgrade_notebook_runtime(name: nil) + # Pass arguments to `upgrade_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be upgrade. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest.new + # + # # Call the upgrade_notebook_runtime method. + # result = client.upgrade_notebook_runtime 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 upgrade_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest + + # 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.upgrade_notebook_runtime.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.upgrade_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :upgrade_notebook_runtime, 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 + + ## + # Starts a NotebookRuntime. + # + # @overload start_notebook_runtime(request, options = nil) + # Pass arguments to `start_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest, ::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 start_notebook_runtime(name: nil) + # Pass arguments to `start_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be started. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest.new + # + # # Call the start_notebook_runtime method. + # result = client.start_notebook_runtime 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 start_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest + + # 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.start_notebook_runtime.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.start_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :start_notebook_runtime, 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 + + ## + # Stops a NotebookRuntime. + # + # @overload stop_notebook_runtime(request, options = nil) + # Pass arguments to `stop_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest, ::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 stop_notebook_runtime(name: nil) + # Pass arguments to `stop_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be stopped. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest.new + # + # # Call the stop_notebook_runtime method. + # result = client.stop_notebook_runtime 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 stop_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest + + # 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.stop_notebook_runtime.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.stop_notebook_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :stop_notebook_runtime, 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 + + ## + # Creates a NotebookExecutionJob. + # + # @overload create_notebook_execution_job(request, options = nil) + # Pass arguments to `create_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest, ::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_notebook_execution_job(parent: nil, notebook_execution_job: nil, notebook_execution_job_id: nil) + # Pass arguments to `create_notebook_execution_job` 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 + # NotebookExecutionJob. Format: `projects/{project}/locations/{location}` + # @param notebook_execution_job [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob, ::Hash] + # Required. The NotebookExecutionJob to create. + # @param notebook_execution_job_id [::String] + # Optional. User specified ID for the NotebookExecutionJob. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest.new + # + # # Call the create_notebook_execution_job method. + # result = client.create_notebook_execution_job 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_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :create_notebook_execution_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookExecutionJob. + # + # @overload get_notebook_execution_job(request, options = nil) + # Pass arguments to `get_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest, ::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_notebook_execution_job(name: nil, view: nil) + # Pass arguments to `get_notebook_execution_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookExecutionJob resource. + # @param view [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest.new + # + # # Call the get_notebook_execution_job method. + # result = client.get_notebook_execution_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookExecutionJob. + # p result + # + def get_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :get_notebook_execution_job, 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 NotebookExecutionJobs in a Location. + # + # @overload list_notebook_execution_jobs(request, options = nil) + # Pass arguments to `list_notebook_execution_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest, ::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_notebook_execution_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, view: nil) + # Pass arguments to `list_notebook_execution_jobs` 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 from which to list the + # NotebookExecutionJobs. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookExecutionJob` supports = and !=. `notebookExecutionJob` + # represents the NotebookExecutionJob ID. + # * `displayName` supports = and != and regex. + # * `schedule` supports = and != and regex. + # + # Some examples: + # * `notebookExecutionJob="123"` + # * `notebookExecutionJob="my-execution-job"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse#next_page_token ListNotebookExecutionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_execution_jobs NotebookService.ListNotebookExecutionJobs} + # call. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @param view [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>] + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest.new + # + # # Call the list_notebook_execution_jobs method. + # result = client.list_notebook_execution_jobs 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::NotebookExecutionJob. + # p item + # end + # + def list_notebook_execution_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest + + # 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_notebook_execution_jobs.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_notebook_execution_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notebook_execution_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :list_notebook_execution_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @notebook_service_stub, :list_notebook_execution_jobs, 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 + + ## + # Deletes a NotebookExecutionJob. + # + # @overload delete_notebook_execution_job(request, options = nil) + # Pass arguments to `delete_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest, ::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_notebook_execution_job(name: nil) + # Pass arguments to `delete_notebook_execution_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookExecutionJob resource to be deleted. + # + # @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::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest.new + # + # # Call the delete_notebook_execution_job method. + # result = client.delete_notebook_execution_job 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_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :delete_notebook_execution_job, 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 NotebookService API. + # + # This class represents the configuration for NotebookService, + # 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::NotebookService::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_notebook_runtime_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::NotebookService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_notebook_runtime_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_notebook_runtime_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the NotebookService 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_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notebook_runtime_template + ## + # RPC-specific configuration for `get_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_runtime_template + ## + # RPC-specific configuration for `list_notebook_runtime_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_runtime_templates + ## + # RPC-specific configuration for `delete_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_runtime_template + ## + # RPC-specific configuration for `update_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notebook_runtime_template + ## + # RPC-specific configuration for `assign_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :assign_notebook_runtime + ## + # RPC-specific configuration for `get_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_runtime + ## + # RPC-specific configuration for `list_notebook_runtimes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_runtimes + ## + # RPC-specific configuration for `delete_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_runtime + ## + # RPC-specific configuration for `upgrade_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_notebook_runtime + ## + # RPC-specific configuration for `start_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :start_notebook_runtime + ## + # RPC-specific configuration for `stop_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_notebook_runtime + ## + # RPC-specific configuration for `create_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notebook_execution_job + ## + # RPC-specific configuration for `get_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_execution_job + ## + # RPC-specific configuration for `list_notebook_execution_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_execution_jobs + ## + # RPC-specific configuration for `delete_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_execution_job + + # @private + def initialize parent_rpcs = nil + create_notebook_runtime_template_config = parent_rpcs.create_notebook_runtime_template if parent_rpcs.respond_to? :create_notebook_runtime_template + @create_notebook_runtime_template = ::Gapic::Config::Method.new create_notebook_runtime_template_config + get_notebook_runtime_template_config = parent_rpcs.get_notebook_runtime_template if parent_rpcs.respond_to? :get_notebook_runtime_template + @get_notebook_runtime_template = ::Gapic::Config::Method.new get_notebook_runtime_template_config + list_notebook_runtime_templates_config = parent_rpcs.list_notebook_runtime_templates if parent_rpcs.respond_to? :list_notebook_runtime_templates + @list_notebook_runtime_templates = ::Gapic::Config::Method.new list_notebook_runtime_templates_config + delete_notebook_runtime_template_config = parent_rpcs.delete_notebook_runtime_template if parent_rpcs.respond_to? :delete_notebook_runtime_template + @delete_notebook_runtime_template = ::Gapic::Config::Method.new delete_notebook_runtime_template_config + update_notebook_runtime_template_config = parent_rpcs.update_notebook_runtime_template if parent_rpcs.respond_to? :update_notebook_runtime_template + @update_notebook_runtime_template = ::Gapic::Config::Method.new update_notebook_runtime_template_config + assign_notebook_runtime_config = parent_rpcs.assign_notebook_runtime if parent_rpcs.respond_to? :assign_notebook_runtime + @assign_notebook_runtime = ::Gapic::Config::Method.new assign_notebook_runtime_config + get_notebook_runtime_config = parent_rpcs.get_notebook_runtime if parent_rpcs.respond_to? :get_notebook_runtime + @get_notebook_runtime = ::Gapic::Config::Method.new get_notebook_runtime_config + list_notebook_runtimes_config = parent_rpcs.list_notebook_runtimes if parent_rpcs.respond_to? :list_notebook_runtimes + @list_notebook_runtimes = ::Gapic::Config::Method.new list_notebook_runtimes_config + delete_notebook_runtime_config = parent_rpcs.delete_notebook_runtime if parent_rpcs.respond_to? :delete_notebook_runtime + @delete_notebook_runtime = ::Gapic::Config::Method.new delete_notebook_runtime_config + upgrade_notebook_runtime_config = parent_rpcs.upgrade_notebook_runtime if parent_rpcs.respond_to? :upgrade_notebook_runtime + @upgrade_notebook_runtime = ::Gapic::Config::Method.new upgrade_notebook_runtime_config + start_notebook_runtime_config = parent_rpcs.start_notebook_runtime if parent_rpcs.respond_to? :start_notebook_runtime + @start_notebook_runtime = ::Gapic::Config::Method.new start_notebook_runtime_config + stop_notebook_runtime_config = parent_rpcs.stop_notebook_runtime if parent_rpcs.respond_to? :stop_notebook_runtime + @stop_notebook_runtime = ::Gapic::Config::Method.new stop_notebook_runtime_config + create_notebook_execution_job_config = parent_rpcs.create_notebook_execution_job if parent_rpcs.respond_to? :create_notebook_execution_job + @create_notebook_execution_job = ::Gapic::Config::Method.new create_notebook_execution_job_config + get_notebook_execution_job_config = parent_rpcs.get_notebook_execution_job if parent_rpcs.respond_to? :get_notebook_execution_job + @get_notebook_execution_job = ::Gapic::Config::Method.new get_notebook_execution_job_config + list_notebook_execution_jobs_config = parent_rpcs.list_notebook_execution_jobs if parent_rpcs.respond_to? :list_notebook_execution_jobs + @list_notebook_execution_jobs = ::Gapic::Config::Method.new list_notebook_execution_jobs_config + delete_notebook_execution_job_config = parent_rpcs.delete_notebook_execution_job if parent_rpcs.respond_to? :delete_notebook_execution_job + @delete_notebook_execution_job = ::Gapic::Config::Method.new delete_notebook_execution_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb new file mode 100644 index 000000000000..abaed402dfde --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + # Credentials for the NotebookService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb new file mode 100644 index 000000000000..d8c51b9fc4d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + # 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 NotebookService 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 NotebookService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb new file mode 100644 index 000000000000..f26c58c636cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/paths.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + # Path helper methods for the NotebookService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified NotebookExecutionJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}` + # + # @param project [String] + # @param location [String] + # @param notebook_execution_job [String] + # + # @return [::String] + def notebook_execution_job_path project:, location:, notebook_execution_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notebookExecutionJobs/#{notebook_execution_job}" + end + + ## + # Create a fully-qualified NotebookRuntime resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}` + # + # @param project [String] + # @param location [String] + # @param notebook_runtime [String] + # + # @return [::String] + def notebook_runtime_path project:, location:, notebook_runtime: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notebookRuntimes/#{notebook_runtime}" + end + + ## + # Create a fully-qualified NotebookRuntimeTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # + # @param project [String] + # @param location [String] + # @param notebook_runtime_template [String] + # + # @return [::String] + def notebook_runtime_template_path project:, location:, notebook_runtime_template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notebookRuntimeTemplates/#{notebook_runtime_template}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + ## + # Create a fully-qualified Schedule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/schedules/{schedule}` + # + # @param project [String] + # @param location [String] + # @param schedule [String] + # + # @return [::String] + def schedule_path project:, location:, schedule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/schedules/#{schedule}" + end + + ## + # Create a fully-qualified Subnetwork resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + # + # @param project [String] + # @param region [String] + # @param subnetwork [String] + # + # @return [::String] + def subnetwork_path project:, region:, subnetwork: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/subnetworks/#{subnetwork}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb new file mode 100644 index 000000000000..525f9b74d15f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/notebook_service/credentials" +require "google/cloud/ai_platform/v1/notebook_service/paths" +require "google/cloud/ai_platform/v1/notebook_service/rest/operations" +require "google/cloud/ai_platform/v1/notebook_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/notebook_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.new + # + module NotebookService + # 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/notebook_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb new file mode 100644 index 000000000000..889700360fb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb @@ -0,0 +1,2031 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/notebook_service_pb" +require "google/cloud/ai_platform/v1/notebook_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + module Rest + ## + # REST client for the NotebookService service. + # + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :notebook_service_stub + + ## + # Configure the NotebookService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NotebookService clients + # ::Google::Cloud::AIPlatform::V1::NotebookService::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 NotebookService 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::NotebookService::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 + @notebook_service_stub.universe_domain + end + + ## + # Create a new NotebookService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NotebookService 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::NotebookService::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 + + @notebook_service_stub = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @notebook_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 = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @notebook_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 = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @notebook_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookService::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 + @notebook_service_stub.logger + end + + # Service calls + + ## + # Creates a NotebookRuntimeTemplate. + # + # @overload create_notebook_runtime_template(request, options = nil) + # Pass arguments to `create_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(parent: nil, notebook_runtime_template: nil, notebook_runtime_template_id: nil) + # Pass arguments to `create_notebook_runtime_template` 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 + # NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` + # @param notebook_runtime_template [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate, ::Hash] + # Required. The NotebookRuntimeTemplate to create. + # @param notebook_runtime_template_id [::String] + # Optional. User specified ID for the notebook runtime template. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest.new + # + # # Call the create_notebook_runtime_template method. + # result = client.create_notebook_runtime_template 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_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.create_notebook_runtime_template request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookRuntimeTemplate. + # + # @overload get_notebook_runtime_template(request, options = nil) + # Pass arguments to `get_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) + # Pass arguments to `get_notebook_runtime_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntimeTemplate resource. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest.new + # + # # Call the get_notebook_runtime_template method. + # result = client.get_notebook_runtime_template request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate. + # p result + # + def get_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.get_notebook_runtime_template 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 NotebookRuntimeTemplates in a Location. + # + # @overload list_notebook_runtime_templates(request, options = nil) + # Pass arguments to `list_notebook_runtime_templates` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest, ::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_notebook_runtime_templates(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_notebook_runtime_templates` 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 from which to list the + # NotebookRuntimeTemplates. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntimeTemplate=notebookRuntimeTemplate123` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `notebookRuntimeType=USER_DEFINED` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse#next_page_token ListNotebookRuntimeTemplatesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client#list_notebook_runtime_templates NotebookService.ListNotebookRuntimeTemplates} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest.new + # + # # Call the list_notebook_runtime_templates method. + # result = client.list_notebook_runtime_templates 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::NotebookRuntimeTemplate. + # p item + # end + # + def list_notebook_runtime_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest + + # 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_notebook_runtime_templates.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_notebook_runtime_templates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notebook_runtime_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.list_notebook_runtime_templates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @notebook_service_stub, :list_notebook_runtime_templates, "notebook_runtime_templates", 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 + + ## + # Deletes a NotebookRuntimeTemplate. + # + # @overload delete_notebook_runtime_template(request, options = nil) + # Pass arguments to `delete_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(name: nil) + # Pass arguments to `delete_notebook_runtime_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntimeTemplate resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest.new + # + # # Call the delete_notebook_runtime_template method. + # result = client.delete_notebook_runtime_template 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_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.delete_notebook_runtime_template 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 + + ## + # Updates a NotebookRuntimeTemplate. + # + # @overload update_notebook_runtime_template(request, options = nil) + # Pass arguments to `update_notebook_runtime_template` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest, ::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_notebook_runtime_template(notebook_runtime_template: nil, update_mask: nil) + # Pass arguments to `update_notebook_runtime_template` 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 notebook_runtime_template [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate, ::Hash] + # Required. The NotebookRuntimeTemplate to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Input format: + # `{paths: "${updated_filed}"}` Updatable fields: + # + # * `encryption_spec.kms_key_name` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest.new + # + # # Call the update_notebook_runtime_template method. + # result = client.update_notebook_runtime_template request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate. + # p result + # + def update_notebook_runtime_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest + + # 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_notebook_runtime_template.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_notebook_runtime_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_notebook_runtime_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.update_notebook_runtime_template 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 + + ## + # Assigns a NotebookRuntime to a user for a particular Notebook file. This + # method will either returns an existing assignment or generates a new one. + # + # @overload assign_notebook_runtime(request, options = nil) + # Pass arguments to `assign_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest, ::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 assign_notebook_runtime(parent: nil, notebook_runtime_template: nil, notebook_runtime: nil, notebook_runtime_id: nil) + # Pass arguments to `assign_notebook_runtime` 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 get the NotebookRuntime + # assignment. Format: `projects/{project}/locations/{location}` + # @param notebook_runtime_template [::String] + # Required. The resource name of the NotebookRuntimeTemplate based on which a + # NotebookRuntime will be assigned (reuse or create a new one). + # @param notebook_runtime [::Google::Cloud::AIPlatform::V1::NotebookRuntime, ::Hash] + # Required. Provide runtime specific information (e.g. runtime owner, + # notebook id) used for NotebookRuntime assignment. + # @param notebook_runtime_id [::String] + # Optional. User specified ID for the notebook runtime. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest.new + # + # # Call the assign_notebook_runtime method. + # result = client.assign_notebook_runtime 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 assign_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest + + # 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.assign_notebook_runtime.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.assign_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.assign_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.assign_notebook_runtime request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookRuntime. + # + # @overload get_notebook_runtime(request, options = nil) + # Pass arguments to `get_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) + # Pass arguments to `get_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest.new + # + # # Call the get_notebook_runtime method. + # result = client.get_notebook_runtime request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookRuntime. + # p result + # + def get_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest + + # 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_notebook_runtime.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_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.get_notebook_runtime 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 NotebookRuntimes in a Location. + # + # @overload list_notebook_runtimes(request, options = nil) + # Pass arguments to `list_notebook_runtimes` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest, ::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_notebook_runtimes(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) + # Pass arguments to `list_notebook_runtimes` 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 from which to list the + # NotebookRuntimes. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntime` supports = and !=. `notebookRuntime` represents the + # NotebookRuntime ID, + # i.e. the last segment of the NotebookRuntime's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntime.name]. + # * `displayName` supports = and != and regex. + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, + # HEALTH_STATE_UNSPECIFIED]. + # * `runtimeState` supports = and !=. runtimeState enum: + # [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, + # STOPPED, BEING_UPGRADED, ERROR, INVALID]. + # * `runtimeUser` supports = and !=. + # * API version is UI only: `uiState` supports = and !=. uiState enum: + # [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, + # UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, + # UI_RESOURCE_STATE_CREATION_FAILED]. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntime="notebookRuntime123"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` + # * `healthState=HEALTHY` + # * `runtimeState=RUNNING` + # * `runtimeUser="test@google.com"` + # * `uiState=UI_RESOURCE_STATE_BEING_DELETED` + # * `notebookRuntimeType=USER_DEFINED` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse#next_page_token ListNotebookRuntimesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client#list_notebook_runtimes NotebookService.ListNotebookRuntimes} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to read. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookRuntime>] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest.new + # + # # Call the list_notebook_runtimes method. + # result = client.list_notebook_runtimes 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::NotebookRuntime. + # p item + # end + # + def list_notebook_runtimes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest + + # 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_notebook_runtimes.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_notebook_runtimes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notebook_runtimes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.list_notebook_runtimes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @notebook_service_stub, :list_notebook_runtimes, "notebook_runtimes", 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 + + ## + # Deletes a NotebookRuntime. + # + # @overload delete_notebook_runtime(request, options = nil) + # Pass arguments to `delete_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest, ::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_notebook_runtime(name: nil) + # Pass arguments to `delete_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be deleted. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest.new + # + # # Call the delete_notebook_runtime method. + # result = client.delete_notebook_runtime 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_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest + + # 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_notebook_runtime.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_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.delete_notebook_runtime 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 + + ## + # Upgrades a NotebookRuntime. + # + # @overload upgrade_notebook_runtime(request, options = nil) + # Pass arguments to `upgrade_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest, ::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 upgrade_notebook_runtime(name: nil) + # Pass arguments to `upgrade_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be upgrade. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest.new + # + # # Call the upgrade_notebook_runtime method. + # result = client.upgrade_notebook_runtime 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 upgrade_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest + + # 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.upgrade_notebook_runtime.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.upgrade_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upgrade_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.upgrade_notebook_runtime 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 + + ## + # Starts a NotebookRuntime. + # + # @overload start_notebook_runtime(request, options = nil) + # Pass arguments to `start_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest, ::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 start_notebook_runtime(name: nil) + # Pass arguments to `start_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be started. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest.new + # + # # Call the start_notebook_runtime method. + # result = client.start_notebook_runtime 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 start_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest + + # 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.start_notebook_runtime.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.start_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.start_notebook_runtime 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 + + ## + # Stops a NotebookRuntime. + # + # @overload stop_notebook_runtime(request, options = nil) + # Pass arguments to `stop_notebook_runtime` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest, ::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 stop_notebook_runtime(name: nil) + # Pass arguments to `stop_notebook_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookRuntime resource to be stopped. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest.new + # + # # Call the stop_notebook_runtime method. + # result = client.stop_notebook_runtime 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 stop_notebook_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest + + # 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.stop_notebook_runtime.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.stop_notebook_runtime.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_notebook_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.stop_notebook_runtime 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 + + ## + # Creates a NotebookExecutionJob. + # + # @overload create_notebook_execution_job(request, options = nil) + # Pass arguments to `create_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest, ::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_notebook_execution_job(parent: nil, notebook_execution_job: nil, notebook_execution_job_id: nil) + # Pass arguments to `create_notebook_execution_job` 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 + # NotebookExecutionJob. Format: `projects/{project}/locations/{location}` + # @param notebook_execution_job [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob, ::Hash] + # Required. The NotebookExecutionJob to create. + # @param notebook_execution_job_id [::String] + # Optional. User specified ID for the NotebookExecutionJob. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest.new + # + # # Call the create_notebook_execution_job method. + # result = client.create_notebook_execution_job 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_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.create_notebook_execution_job request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a NotebookExecutionJob. + # + # @overload get_notebook_execution_job(request, options = nil) + # Pass arguments to `get_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest, ::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_notebook_execution_job(name: nil, view: nil) + # Pass arguments to `get_notebook_execution_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookExecutionJob resource. + # @param view [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest.new + # + # # Call the get_notebook_execution_job method. + # result = client.get_notebook_execution_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::NotebookExecutionJob. + # p result + # + def get_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.get_notebook_execution_job 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 NotebookExecutionJobs in a Location. + # + # @overload list_notebook_execution_jobs(request, options = nil) + # Pass arguments to `list_notebook_execution_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest, ::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_notebook_execution_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, view: nil) + # Pass arguments to `list_notebook_execution_jobs` 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 from which to list the + # NotebookExecutionJobs. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookExecutionJob` supports = and !=. `notebookExecutionJob` + # represents the NotebookExecutionJob ID. + # * `displayName` supports = and != and regex. + # * `schedule` supports = and != and regex. + # + # Some examples: + # * `notebookExecutionJob="123"` + # * `notebookExecutionJob="my-execution-job"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse#next_page_token ListNotebookExecutionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client#list_notebook_execution_jobs NotebookService.ListNotebookExecutionJobs} + # call. + # @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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @param view [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>] + # + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest.new + # + # # Call the list_notebook_execution_jobs method. + # result = client.list_notebook_execution_jobs 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::NotebookExecutionJob. + # p item + # end + # + def list_notebook_execution_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest + + # 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_notebook_execution_jobs.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_notebook_execution_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notebook_execution_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.list_notebook_execution_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @notebook_service_stub, :list_notebook_execution_jobs, "notebook_execution_jobs", 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 + + ## + # Deletes a NotebookExecutionJob. + # + # @overload delete_notebook_execution_job(request, options = nil) + # Pass arguments to `delete_notebook_execution_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest, ::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_notebook_execution_job(name: nil) + # Pass arguments to `delete_notebook_execution_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the NotebookExecutionJob resource to be deleted. + # @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::NotebookService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest.new + # + # # Call the delete_notebook_execution_job method. + # result = client.delete_notebook_execution_job 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_notebook_execution_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest + + # 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_notebook_execution_job.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_notebook_execution_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notebook_execution_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.delete_notebook_execution_job 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 NotebookService REST API. + # + # This class represents the configuration for NotebookService 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::NotebookService::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_notebook_runtime_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_notebook_runtime_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_notebook_runtime_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the NotebookService 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_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notebook_runtime_template + ## + # RPC-specific configuration for `get_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_runtime_template + ## + # RPC-specific configuration for `list_notebook_runtime_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_runtime_templates + ## + # RPC-specific configuration for `delete_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_runtime_template + ## + # RPC-specific configuration for `update_notebook_runtime_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notebook_runtime_template + ## + # RPC-specific configuration for `assign_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :assign_notebook_runtime + ## + # RPC-specific configuration for `get_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_runtime + ## + # RPC-specific configuration for `list_notebook_runtimes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_runtimes + ## + # RPC-specific configuration for `delete_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_runtime + ## + # RPC-specific configuration for `upgrade_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_notebook_runtime + ## + # RPC-specific configuration for `start_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :start_notebook_runtime + ## + # RPC-specific configuration for `stop_notebook_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_notebook_runtime + ## + # RPC-specific configuration for `create_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notebook_execution_job + ## + # RPC-specific configuration for `get_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notebook_execution_job + ## + # RPC-specific configuration for `list_notebook_execution_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notebook_execution_jobs + ## + # RPC-specific configuration for `delete_notebook_execution_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notebook_execution_job + + # @private + def initialize parent_rpcs = nil + create_notebook_runtime_template_config = parent_rpcs.create_notebook_runtime_template if parent_rpcs.respond_to? :create_notebook_runtime_template + @create_notebook_runtime_template = ::Gapic::Config::Method.new create_notebook_runtime_template_config + get_notebook_runtime_template_config = parent_rpcs.get_notebook_runtime_template if parent_rpcs.respond_to? :get_notebook_runtime_template + @get_notebook_runtime_template = ::Gapic::Config::Method.new get_notebook_runtime_template_config + list_notebook_runtime_templates_config = parent_rpcs.list_notebook_runtime_templates if parent_rpcs.respond_to? :list_notebook_runtime_templates + @list_notebook_runtime_templates = ::Gapic::Config::Method.new list_notebook_runtime_templates_config + delete_notebook_runtime_template_config = parent_rpcs.delete_notebook_runtime_template if parent_rpcs.respond_to? :delete_notebook_runtime_template + @delete_notebook_runtime_template = ::Gapic::Config::Method.new delete_notebook_runtime_template_config + update_notebook_runtime_template_config = parent_rpcs.update_notebook_runtime_template if parent_rpcs.respond_to? :update_notebook_runtime_template + @update_notebook_runtime_template = ::Gapic::Config::Method.new update_notebook_runtime_template_config + assign_notebook_runtime_config = parent_rpcs.assign_notebook_runtime if parent_rpcs.respond_to? :assign_notebook_runtime + @assign_notebook_runtime = ::Gapic::Config::Method.new assign_notebook_runtime_config + get_notebook_runtime_config = parent_rpcs.get_notebook_runtime if parent_rpcs.respond_to? :get_notebook_runtime + @get_notebook_runtime = ::Gapic::Config::Method.new get_notebook_runtime_config + list_notebook_runtimes_config = parent_rpcs.list_notebook_runtimes if parent_rpcs.respond_to? :list_notebook_runtimes + @list_notebook_runtimes = ::Gapic::Config::Method.new list_notebook_runtimes_config + delete_notebook_runtime_config = parent_rpcs.delete_notebook_runtime if parent_rpcs.respond_to? :delete_notebook_runtime + @delete_notebook_runtime = ::Gapic::Config::Method.new delete_notebook_runtime_config + upgrade_notebook_runtime_config = parent_rpcs.upgrade_notebook_runtime if parent_rpcs.respond_to? :upgrade_notebook_runtime + @upgrade_notebook_runtime = ::Gapic::Config::Method.new upgrade_notebook_runtime_config + start_notebook_runtime_config = parent_rpcs.start_notebook_runtime if parent_rpcs.respond_to? :start_notebook_runtime + @start_notebook_runtime = ::Gapic::Config::Method.new start_notebook_runtime_config + stop_notebook_runtime_config = parent_rpcs.stop_notebook_runtime if parent_rpcs.respond_to? :stop_notebook_runtime + @stop_notebook_runtime = ::Gapic::Config::Method.new stop_notebook_runtime_config + create_notebook_execution_job_config = parent_rpcs.create_notebook_execution_job if parent_rpcs.respond_to? :create_notebook_execution_job + @create_notebook_execution_job = ::Gapic::Config::Method.new create_notebook_execution_job_config + get_notebook_execution_job_config = parent_rpcs.get_notebook_execution_job if parent_rpcs.respond_to? :get_notebook_execution_job + @get_notebook_execution_job = ::Gapic::Config::Method.new get_notebook_execution_job_config + list_notebook_execution_jobs_config = parent_rpcs.list_notebook_execution_jobs if parent_rpcs.respond_to? :list_notebook_execution_jobs + @list_notebook_execution_jobs = ::Gapic::Config::Method.new list_notebook_execution_jobs_config + delete_notebook_execution_job_config = parent_rpcs.delete_notebook_execution_job if parent_rpcs.respond_to? :delete_notebook_execution_job + @delete_notebook_execution_job = ::Gapic::Config::Method.new delete_notebook_execution_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb new file mode 100644 index 000000000000..cbbfb3040284 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + 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 NotebookService 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 NotebookService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb new file mode 100644 index 000000000000..1c287bf1da65 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb @@ -0,0 +1,1064 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/notebook_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + module Rest + ## + # REST service stub for the NotebookService 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_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_notebook_runtime_template_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_notebook_runtime_template", + 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_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest] + # 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::NotebookRuntimeTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # A result object deserialized from the server's reply + def get_notebook_runtime_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notebook_runtime_template_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_notebook_runtime_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate.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_notebook_runtime_templates REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest] + # 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::ListNotebookRuntimeTemplatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse] + # A result object deserialized from the server's reply + def list_notebook_runtime_templates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notebook_runtime_templates_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_notebook_runtime_templates", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse.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_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notebook_runtime_template_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_notebook_runtime_template", + 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 update_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest] + # 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::NotebookRuntimeTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # A result object deserialized from the server's reply + def update_notebook_runtime_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_notebook_runtime_template_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_notebook_runtime_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the assign_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest] + # 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 assign_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_assign_notebook_runtime_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: "assign_notebook_runtime", + 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_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest] + # 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::NotebookRuntime] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # A result object deserialized from the server's reply + def get_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notebook_runtime_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_notebook_runtime", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NotebookRuntime.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_notebook_runtimes REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest] + # 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::ListNotebookRuntimesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse] + # A result object deserialized from the server's reply + def list_notebook_runtimes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notebook_runtimes_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_notebook_runtimes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse.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_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest] + # 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_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notebook_runtime_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_notebook_runtime", + 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 upgrade_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest] + # 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 upgrade_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_notebook_runtime_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: "upgrade_notebook_runtime", + 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 start_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest] + # 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 start_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_notebook_runtime_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: "start_notebook_runtime", + 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 stop_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest] + # 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 stop_notebook_runtime request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_notebook_runtime_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: "stop_notebook_runtime", + 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 create_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest] + # 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_notebook_execution_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_notebook_execution_job_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_notebook_execution_job", + 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_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest] + # 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::NotebookExecutionJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # A result object deserialized from the server's reply + def get_notebook_execution_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notebook_execution_job_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_notebook_execution_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::NotebookExecutionJob.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_notebook_execution_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest] + # 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::ListNotebookExecutionJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse] + # A result object deserialized from the server's reply + def list_notebook_execution_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notebook_execution_jobs_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_notebook_execution_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse.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_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest] + # 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_notebook_execution_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notebook_execution_job_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_notebook_execution_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notebookRuntimeTemplates", + body: "notebook_runtime_template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notebook_runtime_templates REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest] + # 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_notebook_runtime_templates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notebookRuntimeTemplates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_notebook_runtime_template REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest] + # 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_notebook_runtime_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{notebook_runtime_template.name}", + body: "notebook_runtime_template", + matches: [ + ["notebook_runtime_template.name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the assign_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_assign_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notebookRuntimes:assign", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest] + # 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_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notebook_runtimes REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest] + # 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_notebook_runtimes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notebookRuntimes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest] + # 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_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upgrade_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upgrade_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:upgrade", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_notebook_runtime REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_notebook_runtime_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest] + # 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_notebook_execution_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notebookExecutionJobs", + body: "notebook_execution_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest] + # 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_notebook_execution_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notebook_execution_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest] + # 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_notebook_execution_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notebookExecutionJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notebook_execution_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest] + # 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_notebook_execution_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb new file mode 100644 index 000000000000..00eaf3d73131 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/persistent_resource_service/credentials" +require "google/cloud/ai_platform/v1/persistent_resource_service/paths" +require "google/cloud/ai_platform/v1/persistent_resource_service/operations" +require "google/cloud/ai_platform/v1/persistent_resource_service/client" +require "google/cloud/ai_platform/v1/persistent_resource_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's machine learning PersistentResource. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/persistent_resource_service" + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/persistent_resource_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new + # + module PersistentResourceService + end + end + end + end +end + +helper_path = ::File.join __dir__, "persistent_resource_service", "helpers.rb" +require "google/cloud/ai_platform/v1/persistent_resource_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb new file mode 100644 index 000000000000..193ca05ebe4a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb @@ -0,0 +1,1028 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/persistent_resource_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + ## + # Client for the PersistentResourceService service. + # + # A service for managing Vertex AI's machine learning PersistentResource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :persistent_resource_service_stub + + ## + # Configure the PersistentResourceService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PersistentResourceService clients + # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 PersistentResourceService 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::PersistentResourceService::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 + @persistent_resource_service_stub.universe_domain + end + + ## + # Create a new PersistentResourceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PersistentResourceService 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/persistent_resource_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 + + @persistent_resource_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 + ) + + @persistent_resource_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 = @persistent_resource_service_stub.endpoint + config.universe_domain = @persistent_resource_service_stub.universe_domain + config.logger = @persistent_resource_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 = @persistent_resource_service_stub.endpoint + config.universe_domain = @persistent_resource_service_stub.universe_domain + config.logger = @persistent_resource_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 + @persistent_resource_service_stub.logger + end + + # Service calls + + ## + # Creates a PersistentResource. + # + # @overload create_persistent_resource(request, options = nil) + # Pass arguments to `create_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest, ::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_persistent_resource(parent: nil, persistent_resource: nil, persistent_resource_id: nil) + # Pass arguments to `create_persistent_resource` 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 + # PersistentResource in. Format: `projects/{project}/locations/{location}` + # @param persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash] + # Required. The PersistentResource to create. + # @param persistent_resource_id [::String] + # Required. The ID to use for the PersistentResource, which become the final + # component of the PersistentResource's resource name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + # + # @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::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest.new + # + # # Call the create_persistent_resource method. + # result = client.create_persistent_resource 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_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :create_persistent_resource, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a PersistentResource. + # + # @overload get_persistent_resource(request, options = nil) + # Pass arguments to `get_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest, ::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_persistent_resource(name: nil) + # Pass arguments to `get_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::PersistentResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource] + # + # @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::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest.new + # + # # Call the get_persistent_resource method. + # result = client.get_persistent_resource request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PersistentResource. + # p result + # + def get_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :get_persistent_resource, 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 PersistentResources in a Location. + # + # @overload list_persistent_resources(request, options = nil) + # Pass arguments to `list_persistent_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest, ::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_persistent_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_persistent_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the PersistentResources + # from. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse#next_page_token ListPersistentResourcesResponse.next_page_token} + # of the previous [PersistentResourceService.ListPersistentResource][] call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>] + # + # @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::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest.new + # + # # Call the list_persistent_resources method. + # result = client.list_persistent_resources 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::PersistentResource. + # p item + # end + # + def list_persistent_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest + + # 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_persistent_resources.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_persistent_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_persistent_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :list_persistent_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @persistent_resource_service_stub, :list_persistent_resources, 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 + + ## + # Deletes a PersistentResource. + # + # @overload delete_persistent_resource(request, options = nil) + # Pass arguments to `delete_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest, ::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_persistent_resource(name: nil) + # Pass arguments to `delete_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource to be deleted. + # Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest.new + # + # # Call the delete_persistent_resource method. + # result = client.delete_persistent_resource 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_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :delete_persistent_resource, 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 + + ## + # Updates a PersistentResource. + # + # @overload update_persistent_resource(request, options = nil) + # Pass arguments to `update_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest, ::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_persistent_resource(persistent_resource: nil, update_mask: nil) + # Pass arguments to `update_persistent_resource` 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 persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash] + # Required. The PersistentResource to update. + # + # The PersistentResource's `name` field is used to identify the + # PersistentResource to update. Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specify the fields to be overwritten in the PersistentResource by + # the update method. + # + # @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::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest.new + # + # # Call the update_persistent_resource method. + # result = client.update_persistent_resource request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest + + # 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_persistent_resource.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.persistent_resource&.name + header_params["persistent_resource.name"] = request.persistent_resource.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_persistent_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :update_persistent_resource, 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 + + ## + # Reboots a PersistentResource. + # + # @overload reboot_persistent_resource(request, options = nil) + # Pass arguments to `reboot_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest, ::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 reboot_persistent_resource(name: nil) + # Pass arguments to `reboot_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + # + # @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::PersistentResourceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest.new + # + # # Call the reboot_persistent_resource method. + # result = client.reboot_persistent_resource 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 reboot_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest + + # 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.reboot_persistent_resource.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.reboot_persistent_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reboot_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.call_rpc :reboot_persistent_resource, 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 PersistentResourceService API. + # + # This class represents the configuration for PersistentResourceService, + # 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::PersistentResourceService::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_persistent_resource to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_persistent_resource.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_persistent_resource.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PersistentResourceService 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_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :create_persistent_resource + ## + # RPC-specific configuration for `get_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_persistent_resource + ## + # RPC-specific configuration for `list_persistent_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_persistent_resources + ## + # RPC-specific configuration for `delete_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_persistent_resource + ## + # RPC-specific configuration for `update_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :update_persistent_resource + ## + # RPC-specific configuration for `reboot_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :reboot_persistent_resource + + # @private + def initialize parent_rpcs = nil + create_persistent_resource_config = parent_rpcs.create_persistent_resource if parent_rpcs.respond_to? :create_persistent_resource + @create_persistent_resource = ::Gapic::Config::Method.new create_persistent_resource_config + get_persistent_resource_config = parent_rpcs.get_persistent_resource if parent_rpcs.respond_to? :get_persistent_resource + @get_persistent_resource = ::Gapic::Config::Method.new get_persistent_resource_config + list_persistent_resources_config = parent_rpcs.list_persistent_resources if parent_rpcs.respond_to? :list_persistent_resources + @list_persistent_resources = ::Gapic::Config::Method.new list_persistent_resources_config + delete_persistent_resource_config = parent_rpcs.delete_persistent_resource if parent_rpcs.respond_to? :delete_persistent_resource + @delete_persistent_resource = ::Gapic::Config::Method.new delete_persistent_resource_config + update_persistent_resource_config = parent_rpcs.update_persistent_resource if parent_rpcs.respond_to? :update_persistent_resource + @update_persistent_resource = ::Gapic::Config::Method.new update_persistent_resource_config + reboot_persistent_resource_config = parent_rpcs.reboot_persistent_resource if parent_rpcs.respond_to? :reboot_persistent_resource + @reboot_persistent_resource = ::Gapic::Config::Method.new reboot_persistent_resource_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb new file mode 100644 index 000000000000..074697f1093b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + # Credentials for the PersistentResourceService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb new file mode 100644 index 000000000000..736d28e49b5f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + # 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 PersistentResourceService 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 PersistentResourceService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb new file mode 100644 index 000000000000..4a3400598c96 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/paths.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + # Path helper methods for the PersistentResourceService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified PersistentResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + # + # @param project [String] + # @param location [String] + # @param persistent_resource [String] + # + # @return [::String] + def persistent_resource_path project:, location:, persistent_resource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/persistentResources/#{persistent_resource}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb new file mode 100644 index 000000000000..793929a7b2c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/persistent_resource_service/credentials" +require "google/cloud/ai_platform/v1/persistent_resource_service/paths" +require "google/cloud/ai_platform/v1/persistent_resource_service/rest/operations" +require "google/cloud/ai_platform/v1/persistent_resource_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's machine learning PersistentResource. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/persistent_resource_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new + # + module PersistentResourceService + # 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/persistent_resource_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb new file mode 100644 index 000000000000..067ab4ef9cee --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb @@ -0,0 +1,969 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/persistent_resource_service_pb" +require "google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + module Rest + ## + # REST client for the PersistentResourceService service. + # + # A service for managing Vertex AI's machine learning PersistentResource. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :persistent_resource_service_stub + + ## + # Configure the PersistentResourceService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PersistentResourceService clients + # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 PersistentResourceService 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::PersistentResourceService::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 + @persistent_resource_service_stub.universe_domain + end + + ## + # Create a new PersistentResourceService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PersistentResourceService 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::PersistentResourceService::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 + + @persistent_resource_service_stub = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @persistent_resource_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 = @persistent_resource_service_stub.endpoint + config.universe_domain = @persistent_resource_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @persistent_resource_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 = @persistent_resource_service_stub.endpoint + config.universe_domain = @persistent_resource_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @persistent_resource_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::PersistentResourceService::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 + @persistent_resource_service_stub.logger + end + + # Service calls + + ## + # Creates a PersistentResource. + # + # @overload create_persistent_resource(request, options = nil) + # Pass arguments to `create_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest, ::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_persistent_resource(parent: nil, persistent_resource: nil, persistent_resource_id: nil) + # Pass arguments to `create_persistent_resource` 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 + # PersistentResource in. Format: `projects/{project}/locations/{location}` + # @param persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash] + # Required. The PersistentResource to create. + # @param persistent_resource_id [::String] + # Required. The ID to use for the PersistentResource, which become the final + # component of the PersistentResource's resource name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + # @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::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest.new + # + # # Call the create_persistent_resource method. + # result = client.create_persistent_resource 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_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.create_persistent_resource request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a PersistentResource. + # + # @overload get_persistent_resource(request, options = nil) + # Pass arguments to `get_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest, ::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_persistent_resource(name: nil) + # Pass arguments to `get_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::PersistentResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource] + # + # @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::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest.new + # + # # Call the get_persistent_resource method. + # result = client.get_persistent_resource request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PersistentResource. + # p result + # + def get_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.get_persistent_resource 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 PersistentResources in a Location. + # + # @overload list_persistent_resources(request, options = nil) + # Pass arguments to `list_persistent_resources` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest, ::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_persistent_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_persistent_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the PersistentResources + # from. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse#next_page_token ListPersistentResourcesResponse.next_page_token} + # of the previous [PersistentResourceService.ListPersistentResource][] call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PersistentResource>] + # + # @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::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest.new + # + # # Call the list_persistent_resources method. + # result = client.list_persistent_resources 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::PersistentResource. + # p item + # end + # + def list_persistent_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest + + # 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_persistent_resources.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_persistent_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_persistent_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.list_persistent_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @persistent_resource_service_stub, :list_persistent_resources, "persistent_resources", 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 + + ## + # Deletes a PersistentResource. + # + # @overload delete_persistent_resource(request, options = nil) + # Pass arguments to `delete_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest, ::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_persistent_resource(name: nil) + # Pass arguments to `delete_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource to be deleted. + # Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest.new + # + # # Call the delete_persistent_resource method. + # result = client.delete_persistent_resource 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_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.delete_persistent_resource 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 + + ## + # Updates a PersistentResource. + # + # @overload update_persistent_resource(request, options = nil) + # Pass arguments to `update_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest, ::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_persistent_resource(persistent_resource: nil, update_mask: nil) + # Pass arguments to `update_persistent_resource` 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 persistent_resource [::Google::Cloud::AIPlatform::V1::PersistentResource, ::Hash] + # Required. The PersistentResource to update. + # + # The PersistentResource's `name` field is used to identify the + # PersistentResource to update. Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specify the fields to be overwritten in the PersistentResource by + # the update method. + # @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::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest.new + # + # # Call the update_persistent_resource method. + # result = client.update_persistent_resource request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest + + # 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_persistent_resource.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_persistent_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.update_persistent_resource 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 + + ## + # Reboots a PersistentResource. + # + # @overload reboot_persistent_resource(request, options = nil) + # Pass arguments to `reboot_persistent_resource` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest, ::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 reboot_persistent_resource(name: nil) + # Pass arguments to `reboot_persistent_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + # @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::PersistentResourceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest.new + # + # # Call the reboot_persistent_resource method. + # result = client.reboot_persistent_resource 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 reboot_persistent_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest + + # 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.reboot_persistent_resource.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.reboot_persistent_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reboot_persistent_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @persistent_resource_service_stub.reboot_persistent_resource 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 PersistentResourceService REST API. + # + # This class represents the configuration for PersistentResourceService 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::PersistentResourceService::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_persistent_resource to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_persistent_resource.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_persistent_resource.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PersistentResourceService 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_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :create_persistent_resource + ## + # RPC-specific configuration for `get_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_persistent_resource + ## + # RPC-specific configuration for `list_persistent_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_persistent_resources + ## + # RPC-specific configuration for `delete_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_persistent_resource + ## + # RPC-specific configuration for `update_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :update_persistent_resource + ## + # RPC-specific configuration for `reboot_persistent_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :reboot_persistent_resource + + # @private + def initialize parent_rpcs = nil + create_persistent_resource_config = parent_rpcs.create_persistent_resource if parent_rpcs.respond_to? :create_persistent_resource + @create_persistent_resource = ::Gapic::Config::Method.new create_persistent_resource_config + get_persistent_resource_config = parent_rpcs.get_persistent_resource if parent_rpcs.respond_to? :get_persistent_resource + @get_persistent_resource = ::Gapic::Config::Method.new get_persistent_resource_config + list_persistent_resources_config = parent_rpcs.list_persistent_resources if parent_rpcs.respond_to? :list_persistent_resources + @list_persistent_resources = ::Gapic::Config::Method.new list_persistent_resources_config + delete_persistent_resource_config = parent_rpcs.delete_persistent_resource if parent_rpcs.respond_to? :delete_persistent_resource + @delete_persistent_resource = ::Gapic::Config::Method.new delete_persistent_resource_config + update_persistent_resource_config = parent_rpcs.update_persistent_resource if parent_rpcs.respond_to? :update_persistent_resource + @update_persistent_resource = ::Gapic::Config::Method.new update_persistent_resource_config + reboot_persistent_resource_config = parent_rpcs.reboot_persistent_resource if parent_rpcs.respond_to? :reboot_persistent_resource + @reboot_persistent_resource = ::Gapic::Config::Method.new reboot_persistent_resource_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb new file mode 100644 index 000000000000..190432306ffe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + 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 PersistentResourceService 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 PersistentResourceService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb new file mode 100644 index 000000000000..c5afa7c4b3bf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/persistent_resource_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + module Rest + ## + # REST service stub for the PersistentResourceService 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_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest] + # 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_persistent_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_persistent_resource_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_persistent_resource", + 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_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest] + # 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::PersistentResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource] + # A result object deserialized from the server's reply + def get_persistent_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_persistent_resource_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_persistent_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::PersistentResource.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_persistent_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest] + # 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::ListPersistentResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse] + # A result object deserialized from the server's reply + def list_persistent_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_persistent_resources_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_persistent_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse.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_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest] + # 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_persistent_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_persistent_resource_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_persistent_resource", + 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 update_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_persistent_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_persistent_resource_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_persistent_resource", + 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 reboot_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest] + # 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 reboot_persistent_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reboot_persistent_resource_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: "reboot_persistent_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest] + # 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_persistent_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/persistentResources", + body: "persistent_resource", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest] + # 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_persistent_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_persistent_resources REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest] + # 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_persistent_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/persistentResources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest] + # 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_persistent_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest] + # 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_persistent_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{persistent_resource.name}", + body: "persistent_resource", + matches: [ + ["persistent_resource.name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reboot_persistent_resource REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reboot_persistent_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:reboot", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service.rb new file mode 100644 index 000000000000..e3c277b7d226 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/pipeline_service/credentials" +require "google/cloud/ai_platform/v1/pipeline_service/paths" +require "google/cloud/ai_platform/v1/pipeline_service/operations" +require "google/cloud/ai_platform/v1/pipeline_service/client" +require "google/cloud/ai_platform/v1/pipeline_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/pipeline_service" + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/pipeline_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new + # + module PipelineService + end + end + end + end +end + +helper_path = ::File.join __dir__, "pipeline_service", "helpers.rb" +require "google/cloud/ai_platform/v1/pipeline_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb new file mode 100644 index 000000000000..108f1ff29b13 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb @@ -0,0 +1,1723 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/pipeline_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + ## + # Client for the PipelineService service. + # + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :pipeline_service_stub + + ## + # Configure the PipelineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PipelineService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PipelineService clients + # ::Google::Cloud::AIPlatform::V1::PipelineService::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 PipelineService 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::PipelineService::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 + @pipeline_service_stub.universe_domain + end + + ## + # Create a new PipelineService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PipelineService 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/pipeline_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 + + @pipeline_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::PipelineService::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 + ) + + @pipeline_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 = @pipeline_service_stub.endpoint + config.universe_domain = @pipeline_service_stub.universe_domain + config.logger = @pipeline_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 = @pipeline_service_stub.endpoint + config.universe_domain = @pipeline_service_stub.universe_domain + config.logger = @pipeline_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineService::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 + @pipeline_service_stub.logger + end + + # Service calls + + ## + # Creates a TrainingPipeline. A created TrainingPipeline right away will be + # attempted to be run. + # + # @overload create_training_pipeline(request, options = nil) + # Pass arguments to `create_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest, ::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_training_pipeline(parent: nil, training_pipeline: nil) + # Pass arguments to `create_training_pipeline` 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 TrainingPipeline + # in. Format: `projects/{project}/locations/{location}` + # @param training_pipeline [::Google::Cloud::AIPlatform::V1::TrainingPipeline, ::Hash] + # Required. The TrainingPipeline to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest.new + # + # # Call the create_training_pipeline method. + # result = client.create_training_pipeline request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + # p result + # + def create_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :create_training_pipeline, 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 + + ## + # Gets a TrainingPipeline. + # + # @overload get_training_pipeline(request, options = nil) + # Pass arguments to `get_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `get_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline resource. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest.new + # + # # Call the get_training_pipeline method. + # result = client.get_training_pipeline request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + # p result + # + def get_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :get_training_pipeline, 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 TrainingPipelines in a Location. + # + # @overload list_training_pipelines(request, options = nil) + # Pass arguments to `list_training_pipelines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest, ::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_training_pipelines(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_training_pipelines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the TrainingPipelines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + # * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + # * `NOT display_name="my_pipeline"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `training_task_definition:"*automl_text_classification*"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse#next_page_token ListTrainingPipelinesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_training_pipelines PipelineService.ListTrainingPipelines} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TrainingPipeline>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TrainingPipeline>] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest.new + # + # # Call the list_training_pipelines method. + # result = client.list_training_pipelines 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::TrainingPipeline. + # p item + # end + # + def list_training_pipelines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest + + # 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_training_pipelines.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_training_pipelines.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_training_pipelines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :list_training_pipelines, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @pipeline_service_stub, :list_training_pipelines, 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 + + ## + # Deletes a TrainingPipeline. + # + # @overload delete_training_pipeline(request, options = nil) + # Pass arguments to `delete_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `delete_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest.new + # + # # Call the delete_training_pipeline method. + # result = client.delete_training_pipeline 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_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :delete_training_pipeline, 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 + + ## + # Cancels a TrainingPipeline. + # Starts asynchronous cancellation on the TrainingPipeline. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#get_training_pipeline PipelineService.GetTrainingPipeline} + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the TrainingPipeline is not deleted; instead it becomes a pipeline with + # a + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#error TrainingPipeline.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#state TrainingPipeline.state} + # is set to `CANCELLED`. + # + # @overload cancel_training_pipeline(request, options = nil) + # Pass arguments to `cancel_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `cancel_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline to cancel. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest.new + # + # # Call the cancel_training_pipeline method. + # result = client.cancel_training_pipeline request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :cancel_training_pipeline, 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 + + ## + # Creates a PipelineJob. A PipelineJob will run immediately when created. + # + # @overload create_pipeline_job(request, options = nil) + # Pass arguments to `create_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest, ::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_pipeline_job(parent: nil, pipeline_job: nil, pipeline_job_id: nil) + # Pass arguments to `create_pipeline_job` 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 PipelineJob in. + # Format: `projects/{project}/locations/{location}` + # @param pipeline_job [::Google::Cloud::AIPlatform::V1::PipelineJob, ::Hash] + # Required. The PipelineJob to create. + # @param pipeline_job_id [::String] + # The ID to use for the PipelineJob, which will become the final component of + # the PipelineJob name. If not provided, an ID will be automatically + # generated. + # + # This value should be less than 128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::PipelineJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest.new + # + # # Call the create_pipeline_job method. + # result = client.create_pipeline_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + # p result + # + def create_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :create_pipeline_job, 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 + + ## + # Gets a PipelineJob. + # + # @overload get_pipeline_job(request, options = nil) + # Pass arguments to `get_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `get_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob resource. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::PipelineJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPipelineJobRequest.new + # + # # Call the get_pipeline_job method. + # result = client.get_pipeline_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + # p result + # + def get_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :get_pipeline_job, 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 PipelineJobs in a Location. + # + # @overload list_pipeline_jobs(request, options = nil) + # Pass arguments to `list_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest, ::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_pipeline_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_pipeline_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the PipelineJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the PipelineJobs that match the filter expression. The following + # fields are supported: + # + # * `pipeline_name`: Supports `=` and `!=` comparisons. + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + # for example, can check if pipeline's display_name contains *step* by + # doing display_name:\"*step*\" + # * `state`: Supports `=` and `!=` comparisons. + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `template_metadata.version`: Supports `=`, `!=` comparisons, and `:` + # wildcard. + # + # Filter expressions can be combined together using logical operators + # (`AND` & `OR`). + # For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + # + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `create_time>"2021-05-18T00:00:00Z" OR + # update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + # after 2020-05-18 00:00:00 UTC. + # * `labels.env = "prod"` + # PipelineJobs with label "env" set to "prod". + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse#next_page_token ListPipelineJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_pipeline_jobs PipelineService.ListPipelineJobs} + # call. + # @param order_by [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided e.g. "create_time desc, end_time", + # "end_time, start_time, update_time" For example, using "create_time desc, + # end_time" will order results by create time in descending order, and if + # there are multiple jobs having the same create time, order them by the end + # time in ascending order. if order_by is not specified, it will order by + # default order is create time in descending order. Supported fields: + # + # * `create_time` + # * `update_time` + # * `end_time` + # * `start_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest.new + # + # # Call the list_pipeline_jobs method. + # result = client.list_pipeline_jobs 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::PipelineJob. + # p item + # end + # + def list_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest + + # 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_pipeline_jobs.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_pipeline_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :list_pipeline_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @pipeline_service_stub, :list_pipeline_jobs, 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 + + ## + # Deletes a PipelineJob. + # + # @overload delete_pipeline_job(request, options = nil) + # Pass arguments to `delete_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `delete_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest.new + # + # # Call the delete_pipeline_job method. + # result = client.delete_pipeline_job 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_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :delete_pipeline_job, 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 + + ## + # Batch deletes PipelineJobs + # The Operation is atomic. If it fails, none of the PipelineJobs are deleted. + # If it succeeds, all of the PipelineJobs are deleted. + # + # @overload batch_delete_pipeline_jobs(request, options = nil) + # Pass arguments to `batch_delete_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest, ::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 batch_delete_pipeline_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_pipeline_jobs` 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 name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @param names [::Array<::String>] + # Required. The names of the PipelineJobs to delete. + # A maximum of 32 PipelineJobs can be deleted in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest.new + # + # # Call the batch_delete_pipeline_jobs method. + # result = client.batch_delete_pipeline_jobs 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 batch_delete_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest + + # 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.batch_delete_pipeline_jobs.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.batch_delete_pipeline_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :batch_delete_pipeline_jobs, 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 + + ## + # Cancels a PipelineJob. + # Starts asynchronous cancellation on the PipelineJob. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#get_pipeline_job PipelineService.GetPipelineJob} + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the PipelineJob is not deleted; instead it becomes a pipeline with + # a {::Google::Cloud::AIPlatform::V1::PipelineJob#error PipelineJob.error} value + # with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding + # to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::PipelineJob#state PipelineJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_pipeline_job(request, options = nil) + # Pass arguments to `cancel_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `cancel_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob to cancel. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest.new + # + # # Call the cancel_pipeline_job method. + # result = client.cancel_pipeline_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :cancel_pipeline_job, 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 + + ## + # Batch cancel PipelineJobs. + # Firstly the server will check if all the jobs are in non-terminal states, + # and skip the jobs that are already terminated. + # If the operation failed, none of the pipeline jobs are cancelled. + # The server will poll the states of all the pipeline jobs periodically + # to check the cancellation status. + # This operation will return an LRO. + # + # @overload batch_cancel_pipeline_jobs(request, options = nil) + # Pass arguments to `batch_cancel_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest, ::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 batch_cancel_pipeline_jobs(parent: nil, names: nil) + # Pass arguments to `batch_cancel_pipeline_jobs` 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 name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @param names [::Array<::String>] + # Required. The names of the PipelineJobs to cancel. + # A maximum of 32 PipelineJobs can be cancelled in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + # + # @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::PipelineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest.new + # + # # Call the batch_cancel_pipeline_jobs method. + # result = client.batch_cancel_pipeline_jobs 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 batch_cancel_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest + + # 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.batch_cancel_pipeline_jobs.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.batch_cancel_pipeline_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_cancel_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.call_rpc :batch_cancel_pipeline_jobs, 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 PipelineService API. + # + # This class represents the configuration for PipelineService, + # 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::PipelineService::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_training_pipeline to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PipelineService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_training_pipeline.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_training_pipeline.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PipelineService 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_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :create_training_pipeline + ## + # RPC-specific configuration for `get_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :get_training_pipeline + ## + # RPC-specific configuration for `list_training_pipelines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_training_pipelines + ## + # RPC-specific configuration for `delete_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_training_pipeline + ## + # RPC-specific configuration for `cancel_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_training_pipeline + ## + # RPC-specific configuration for `create_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pipeline_job + ## + # RPC-specific configuration for `get_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pipeline_job + ## + # RPC-specific configuration for `list_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pipeline_jobs + ## + # RPC-specific configuration for `delete_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_pipeline_job + ## + # RPC-specific configuration for `batch_delete_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_pipeline_jobs + ## + # RPC-specific configuration for `cancel_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_pipeline_job + ## + # RPC-specific configuration for `batch_cancel_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_cancel_pipeline_jobs + + # @private + def initialize parent_rpcs = nil + create_training_pipeline_config = parent_rpcs.create_training_pipeline if parent_rpcs.respond_to? :create_training_pipeline + @create_training_pipeline = ::Gapic::Config::Method.new create_training_pipeline_config + get_training_pipeline_config = parent_rpcs.get_training_pipeline if parent_rpcs.respond_to? :get_training_pipeline + @get_training_pipeline = ::Gapic::Config::Method.new get_training_pipeline_config + list_training_pipelines_config = parent_rpcs.list_training_pipelines if parent_rpcs.respond_to? :list_training_pipelines + @list_training_pipelines = ::Gapic::Config::Method.new list_training_pipelines_config + delete_training_pipeline_config = parent_rpcs.delete_training_pipeline if parent_rpcs.respond_to? :delete_training_pipeline + @delete_training_pipeline = ::Gapic::Config::Method.new delete_training_pipeline_config + cancel_training_pipeline_config = parent_rpcs.cancel_training_pipeline if parent_rpcs.respond_to? :cancel_training_pipeline + @cancel_training_pipeline = ::Gapic::Config::Method.new cancel_training_pipeline_config + create_pipeline_job_config = parent_rpcs.create_pipeline_job if parent_rpcs.respond_to? :create_pipeline_job + @create_pipeline_job = ::Gapic::Config::Method.new create_pipeline_job_config + get_pipeline_job_config = parent_rpcs.get_pipeline_job if parent_rpcs.respond_to? :get_pipeline_job + @get_pipeline_job = ::Gapic::Config::Method.new get_pipeline_job_config + list_pipeline_jobs_config = parent_rpcs.list_pipeline_jobs if parent_rpcs.respond_to? :list_pipeline_jobs + @list_pipeline_jobs = ::Gapic::Config::Method.new list_pipeline_jobs_config + delete_pipeline_job_config = parent_rpcs.delete_pipeline_job if parent_rpcs.respond_to? :delete_pipeline_job + @delete_pipeline_job = ::Gapic::Config::Method.new delete_pipeline_job_config + batch_delete_pipeline_jobs_config = parent_rpcs.batch_delete_pipeline_jobs if parent_rpcs.respond_to? :batch_delete_pipeline_jobs + @batch_delete_pipeline_jobs = ::Gapic::Config::Method.new batch_delete_pipeline_jobs_config + cancel_pipeline_job_config = parent_rpcs.cancel_pipeline_job if parent_rpcs.respond_to? :cancel_pipeline_job + @cancel_pipeline_job = ::Gapic::Config::Method.new cancel_pipeline_job_config + batch_cancel_pipeline_jobs_config = parent_rpcs.batch_cancel_pipeline_jobs if parent_rpcs.respond_to? :batch_cancel_pipeline_jobs + @batch_cancel_pipeline_jobs = ::Gapic::Config::Method.new batch_cancel_pipeline_jobs_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/credentials.rb new file mode 100644 index 000000000000..640c3d77e905 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + # Credentials for the PipelineService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb new file mode 100644 index 000000000000..ae5ec0a6e277 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + # 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 PipelineService 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 PipelineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/paths.rb new file mode 100644 index 000000000000..2ddeb5148586 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/paths.rb @@ -0,0 +1,251 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + # Path helper methods for the PipelineService API. + module Paths + ## + # Create a fully-qualified Artifact resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param artifact [String] + # + # @return [::String] + def artifact_path project:, location:, metadata_store:, artifact: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/artifacts/#{artifact}" + end + + ## + # Create a fully-qualified Context resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param context [String] + # + # @return [::String] + def context_path project:, location:, metadata_store:, context: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/contexts/#{context}" + end + + ## + # Create a fully-qualified CustomJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @param project [String] + # @param location [String] + # @param custom_job [String] + # + # @return [::String] + def custom_job_path project:, location:, custom_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customJobs/#{custom_job}" + end + + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, metadata_store:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/executions/#{execution}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified PipelineJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @param project [String] + # @param location [String] + # @param pipeline_job [String] + # + # @return [::String] + def pipeline_job_path project:, location:, pipeline_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/pipelineJobs/#{pipeline_job}" + end + + ## + # Create a fully-qualified TrainingPipeline resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # + # @param project [String] + # @param location [String] + # @param training_pipeline [String] + # + # @return [::String] + def training_pipeline_path project:, location:, training_pipeline: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/trainingPipelines/#{training_pipeline}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb new file mode 100644 index 000000000000..6fc9ca05d15f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/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/pipeline_service/credentials" +require "google/cloud/ai_platform/v1/pipeline_service/paths" +require "google/cloud/ai_platform/v1/pipeline_service/rest/operations" +require "google/cloud/ai_platform/v1/pipeline_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/pipeline_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new + # + module PipelineService + # 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/pipeline_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb new file mode 100644 index 000000000000..5424ee829468 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb @@ -0,0 +1,1622 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/pipeline_service_pb" +require "google/cloud/ai_platform/v1/pipeline_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + module Rest + ## + # REST client for the PipelineService service. + # + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :pipeline_service_stub + + ## + # Configure the PipelineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PipelineService clients + # ::Google::Cloud::AIPlatform::V1::PipelineService::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 PipelineService 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::PipelineService::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 + @pipeline_service_stub.universe_domain + end + + ## + # Create a new PipelineService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PipelineService 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::PipelineService::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 + + @pipeline_service_stub = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @pipeline_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 = @pipeline_service_stub.endpoint + config.universe_domain = @pipeline_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @pipeline_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 = @pipeline_service_stub.endpoint + config.universe_domain = @pipeline_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @pipeline_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineService::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 + @pipeline_service_stub.logger + end + + # Service calls + + ## + # Creates a TrainingPipeline. A created TrainingPipeline right away will be + # attempted to be run. + # + # @overload create_training_pipeline(request, options = nil) + # Pass arguments to `create_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest, ::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_training_pipeline(parent: nil, training_pipeline: nil) + # Pass arguments to `create_training_pipeline` 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 TrainingPipeline + # in. Format: `projects/{project}/locations/{location}` + # @param training_pipeline [::Google::Cloud::AIPlatform::V1::TrainingPipeline, ::Hash] + # Required. The TrainingPipeline to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest.new + # + # # Call the create_training_pipeline method. + # result = client.create_training_pipeline request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + # p result + # + def create_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.create_training_pipeline 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 + + ## + # Gets a TrainingPipeline. + # + # @overload get_training_pipeline(request, options = nil) + # Pass arguments to `get_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `get_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline resource. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest.new + # + # # Call the get_training_pipeline method. + # result = client.get_training_pipeline request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + # p result + # + def get_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.get_training_pipeline 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 TrainingPipelines in a Location. + # + # @overload list_training_pipelines(request, options = nil) + # Pass arguments to `list_training_pipelines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest, ::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_training_pipelines(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_training_pipelines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the TrainingPipelines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + # * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + # * `NOT display_name="my_pipeline"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `training_task_definition:"*automl_text_classification*"` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse#next_page_token ListTrainingPipelinesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client#list_training_pipelines PipelineService.ListTrainingPipelines} + # call. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TrainingPipeline>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TrainingPipeline>] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest.new + # + # # Call the list_training_pipelines method. + # result = client.list_training_pipelines 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::TrainingPipeline. + # p item + # end + # + def list_training_pipelines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest + + # 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_training_pipelines.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_training_pipelines.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_training_pipelines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.list_training_pipelines request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @pipeline_service_stub, :list_training_pipelines, "training_pipelines", 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 + + ## + # Deletes a TrainingPipeline. + # + # @overload delete_training_pipeline(request, options = nil) + # Pass arguments to `delete_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `delete_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest.new + # + # # Call the delete_training_pipeline method. + # result = client.delete_training_pipeline 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_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.delete_training_pipeline 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 + + ## + # Cancels a TrainingPipeline. + # Starts asynchronous cancellation on the TrainingPipeline. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client#get_training_pipeline PipelineService.GetTrainingPipeline} + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the TrainingPipeline is not deleted; instead it becomes a pipeline with + # a + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#error TrainingPipeline.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#state TrainingPipeline.state} + # is set to `CANCELLED`. + # + # @overload cancel_training_pipeline(request, options = nil) + # Pass arguments to `cancel_training_pipeline` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest, ::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_training_pipeline(name: nil) + # Pass arguments to `cancel_training_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TrainingPipeline to cancel. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest.new + # + # # Call the cancel_training_pipeline method. + # result = client.cancel_training_pipeline request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_training_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest + + # 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_training_pipeline.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_training_pipeline.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_training_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.cancel_training_pipeline 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 + + ## + # Creates a PipelineJob. A PipelineJob will run immediately when created. + # + # @overload create_pipeline_job(request, options = nil) + # Pass arguments to `create_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest, ::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_pipeline_job(parent: nil, pipeline_job: nil, pipeline_job_id: nil) + # Pass arguments to `create_pipeline_job` 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 PipelineJob in. + # Format: `projects/{project}/locations/{location}` + # @param pipeline_job [::Google::Cloud::AIPlatform::V1::PipelineJob, ::Hash] + # Required. The PipelineJob to create. + # @param pipeline_job_id [::String] + # The ID to use for the PipelineJob, which will become the final component of + # the PipelineJob name. If not provided, an ID will be automatically + # generated. + # + # This value should be less than 128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::PipelineJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest.new + # + # # Call the create_pipeline_job method. + # result = client.create_pipeline_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + # p result + # + def create_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.create_pipeline_job 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 + + ## + # Gets a PipelineJob. + # + # @overload get_pipeline_job(request, options = nil) + # Pass arguments to `get_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `get_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob resource. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::PipelineJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetPipelineJobRequest.new + # + # # Call the get_pipeline_job method. + # result = client.get_pipeline_job request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + # p result + # + def get_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.get_pipeline_job 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 PipelineJobs in a Location. + # + # @overload list_pipeline_jobs(request, options = nil) + # Pass arguments to `list_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest, ::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_pipeline_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_pipeline_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the PipelineJobs from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the PipelineJobs that match the filter expression. The following + # fields are supported: + # + # * `pipeline_name`: Supports `=` and `!=` comparisons. + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + # for example, can check if pipeline's display_name contains *step* by + # doing display_name:\"*step*\" + # * `state`: Supports `=` and `!=` comparisons. + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `template_metadata.version`: Supports `=`, `!=` comparisons, and `:` + # wildcard. + # + # Filter expressions can be combined together using logical operators + # (`AND` & `OR`). + # For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + # + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `create_time>"2021-05-18T00:00:00Z" OR + # update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + # after 2020-05-18 00:00:00 UTC. + # * `labels.env = "prod"` + # PipelineJobs with label "env" set to "prod". + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse#next_page_token ListPipelineJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client#list_pipeline_jobs PipelineService.ListPipelineJobs} + # call. + # @param order_by [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided e.g. "create_time desc, end_time", + # "end_time, start_time, update_time" For example, using "create_time desc, + # end_time" will order results by create time in descending order, and if + # there are multiple jobs having the same create time, order them by the end + # time in ascending order. if order_by is not specified, it will order by + # default order is create time in descending order. Supported fields: + # + # * `create_time` + # * `update_time` + # * `end_time` + # * `start_time` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest.new + # + # # Call the list_pipeline_jobs method. + # result = client.list_pipeline_jobs 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::PipelineJob. + # p item + # end + # + def list_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest + + # 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_pipeline_jobs.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_pipeline_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.list_pipeline_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @pipeline_service_stub, :list_pipeline_jobs, "pipeline_jobs", 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 + + ## + # Deletes a PipelineJob. + # + # @overload delete_pipeline_job(request, options = nil) + # Pass arguments to `delete_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `delete_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest.new + # + # # Call the delete_pipeline_job method. + # result = client.delete_pipeline_job 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_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.delete_pipeline_job 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 + + ## + # Batch deletes PipelineJobs + # The Operation is atomic. If it fails, none of the PipelineJobs are deleted. + # If it succeeds, all of the PipelineJobs are deleted. + # + # @overload batch_delete_pipeline_jobs(request, options = nil) + # Pass arguments to `batch_delete_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest, ::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 batch_delete_pipeline_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_pipeline_jobs` 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 name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @param names [::Array<::String>] + # Required. The names of the PipelineJobs to delete. + # A maximum of 32 PipelineJobs can be deleted in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest.new + # + # # Call the batch_delete_pipeline_jobs method. + # result = client.batch_delete_pipeline_jobs 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 batch_delete_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest + + # 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.batch_delete_pipeline_jobs.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.batch_delete_pipeline_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.batch_delete_pipeline_jobs 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 + + ## + # Cancels a PipelineJob. + # Starts asynchronous cancellation on the PipelineJob. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # {::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client#get_pipeline_job PipelineService.GetPipelineJob} + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the PipelineJob is not deleted; instead it becomes a pipeline with + # a {::Google::Cloud::AIPlatform::V1::PipelineJob#error PipelineJob.error} value + # with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding + # to `Code.CANCELLED`, and + # {::Google::Cloud::AIPlatform::V1::PipelineJob#state PipelineJob.state} is set to + # `CANCELLED`. + # + # @overload cancel_pipeline_job(request, options = nil) + # Pass arguments to `cancel_pipeline_job` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest, ::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_pipeline_job(name: nil) + # Pass arguments to `cancel_pipeline_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the PipelineJob to cancel. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest.new + # + # # Call the cancel_pipeline_job method. + # result = client.cancel_pipeline_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_pipeline_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest + + # 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_pipeline_job.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_pipeline_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_pipeline_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.cancel_pipeline_job 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 + + ## + # Batch cancel PipelineJobs. + # Firstly the server will check if all the jobs are in non-terminal states, + # and skip the jobs that are already terminated. + # If the operation failed, none of the pipeline jobs are cancelled. + # The server will poll the states of all the pipeline jobs periodically + # to check the cancellation status. + # This operation will return an LRO. + # + # @overload batch_cancel_pipeline_jobs(request, options = nil) + # Pass arguments to `batch_cancel_pipeline_jobs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest, ::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 batch_cancel_pipeline_jobs(parent: nil, names: nil) + # Pass arguments to `batch_cancel_pipeline_jobs` 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 name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @param names [::Array<::String>] + # Required. The names of the PipelineJobs to cancel. + # A maximum of 32 PipelineJobs can be cancelled in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + # @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::PipelineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest.new + # + # # Call the batch_cancel_pipeline_jobs method. + # result = client.batch_cancel_pipeline_jobs 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 batch_cancel_pipeline_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest + + # 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.batch_cancel_pipeline_jobs.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.batch_cancel_pipeline_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_cancel_pipeline_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @pipeline_service_stub.batch_cancel_pipeline_jobs 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 PipelineService REST API. + # + # This class represents the configuration for PipelineService 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::PipelineService::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_training_pipeline to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_training_pipeline.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_training_pipeline.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PipelineService 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_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :create_training_pipeline + ## + # RPC-specific configuration for `get_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :get_training_pipeline + ## + # RPC-specific configuration for `list_training_pipelines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_training_pipelines + ## + # RPC-specific configuration for `delete_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_training_pipeline + ## + # RPC-specific configuration for `cancel_training_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_training_pipeline + ## + # RPC-specific configuration for `create_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pipeline_job + ## + # RPC-specific configuration for `get_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pipeline_job + ## + # RPC-specific configuration for `list_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pipeline_jobs + ## + # RPC-specific configuration for `delete_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_pipeline_job + ## + # RPC-specific configuration for `batch_delete_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_pipeline_jobs + ## + # RPC-specific configuration for `cancel_pipeline_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_pipeline_job + ## + # RPC-specific configuration for `batch_cancel_pipeline_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_cancel_pipeline_jobs + + # @private + def initialize parent_rpcs = nil + create_training_pipeline_config = parent_rpcs.create_training_pipeline if parent_rpcs.respond_to? :create_training_pipeline + @create_training_pipeline = ::Gapic::Config::Method.new create_training_pipeline_config + get_training_pipeline_config = parent_rpcs.get_training_pipeline if parent_rpcs.respond_to? :get_training_pipeline + @get_training_pipeline = ::Gapic::Config::Method.new get_training_pipeline_config + list_training_pipelines_config = parent_rpcs.list_training_pipelines if parent_rpcs.respond_to? :list_training_pipelines + @list_training_pipelines = ::Gapic::Config::Method.new list_training_pipelines_config + delete_training_pipeline_config = parent_rpcs.delete_training_pipeline if parent_rpcs.respond_to? :delete_training_pipeline + @delete_training_pipeline = ::Gapic::Config::Method.new delete_training_pipeline_config + cancel_training_pipeline_config = parent_rpcs.cancel_training_pipeline if parent_rpcs.respond_to? :cancel_training_pipeline + @cancel_training_pipeline = ::Gapic::Config::Method.new cancel_training_pipeline_config + create_pipeline_job_config = parent_rpcs.create_pipeline_job if parent_rpcs.respond_to? :create_pipeline_job + @create_pipeline_job = ::Gapic::Config::Method.new create_pipeline_job_config + get_pipeline_job_config = parent_rpcs.get_pipeline_job if parent_rpcs.respond_to? :get_pipeline_job + @get_pipeline_job = ::Gapic::Config::Method.new get_pipeline_job_config + list_pipeline_jobs_config = parent_rpcs.list_pipeline_jobs if parent_rpcs.respond_to? :list_pipeline_jobs + @list_pipeline_jobs = ::Gapic::Config::Method.new list_pipeline_jobs_config + delete_pipeline_job_config = parent_rpcs.delete_pipeline_job if parent_rpcs.respond_to? :delete_pipeline_job + @delete_pipeline_job = ::Gapic::Config::Method.new delete_pipeline_job_config + batch_delete_pipeline_jobs_config = parent_rpcs.batch_delete_pipeline_jobs if parent_rpcs.respond_to? :batch_delete_pipeline_jobs + @batch_delete_pipeline_jobs = ::Gapic::Config::Method.new batch_delete_pipeline_jobs_config + cancel_pipeline_job_config = parent_rpcs.cancel_pipeline_job if parent_rpcs.respond_to? :cancel_pipeline_job + @cancel_pipeline_job = ::Gapic::Config::Method.new cancel_pipeline_job_config + batch_cancel_pipeline_jobs_config = parent_rpcs.batch_cancel_pipeline_jobs if parent_rpcs.respond_to? :batch_cancel_pipeline_jobs + @batch_cancel_pipeline_jobs = ::Gapic::Config::Method.new batch_cancel_pipeline_jobs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb new file mode 100644 index 000000000000..1535cde7e077 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + 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 PipelineService 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 PipelineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb new file mode 100644 index 000000000000..f6b6c8501d30 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb @@ -0,0 +1,819 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/pipeline_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + module Rest + ## + # REST service stub for the PipelineService 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_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest] + # 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::TrainingPipeline] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # A result object deserialized from the server's reply + def create_training_pipeline request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_training_pipeline_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_training_pipeline", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TrainingPipeline.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_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest] + # 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::TrainingPipeline] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # A result object deserialized from the server's reply + def get_training_pipeline request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_training_pipeline_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_training_pipeline", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TrainingPipeline.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_training_pipelines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest] + # 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::ListTrainingPipelinesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse] + # A result object deserialized from the server's reply + def list_training_pipelines request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_training_pipelines_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_training_pipelines", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse.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_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest] + # 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_training_pipeline request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_training_pipeline_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_training_pipeline", + 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 cancel_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest] + # 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_training_pipeline request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_training_pipeline_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_training_pipeline", + 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 create_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest] + # 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::PipelineJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # A result object deserialized from the server's reply + def create_pipeline_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_pipeline_job_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_pipeline_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::PipelineJob.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_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest] + # 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::PipelineJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # A result object deserialized from the server's reply + def get_pipeline_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_pipeline_job_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_pipeline_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::PipelineJob.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_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest] + # 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::ListPipelineJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse] + # A result object deserialized from the server's reply + def list_pipeline_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_pipeline_jobs_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_pipeline_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse.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_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest] + # 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_pipeline_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_pipeline_job_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_pipeline_job", + 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 batch_delete_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest] + # 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 batch_delete_pipeline_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_pipeline_jobs_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: "batch_delete_pipeline_jobs", + 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 cancel_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest] + # 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_pipeline_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_pipeline_job_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_pipeline_job", + 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 batch_cancel_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest] + # 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 batch_cancel_pipeline_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_cancel_pipeline_jobs_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: "batch_cancel_pipeline_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest] + # 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_training_pipeline_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/trainingPipelines", + body: "training_pipeline", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest] + # 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_training_pipeline_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_training_pipelines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest] + # 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_training_pipelines_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/trainingPipelines", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest] + # 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_training_pipeline_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_training_pipeline REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest] + # 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_training_pipeline_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest] + # 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_pipeline_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pipelineJobs", + body: "pipeline_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest] + # 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_pipeline_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest] + # 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_pipeline_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/pipelineJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest] + # 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_pipeline_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_delete_pipeline_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pipelineJobs:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_pipeline_job REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest] + # 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_pipeline_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_cancel_pipeline_jobs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_cancel_pipeline_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pipelineJobs:batchCancel", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service.rb new file mode 100644 index 000000000000..3fd917df4329 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/prediction_service/credentials" +require "google/cloud/ai_platform/v1/prediction_service/paths" +require "google/cloud/ai_platform/v1/prediction_service/client" +require "google/cloud/ai_platform/v1/prediction_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for online predictions and explanations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/prediction_service" + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/prediction_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new + # + module PredictionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "prediction_service", "helpers.rb" +require "google/cloud/ai_platform/v1/prediction_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/client.rb new file mode 100644 index 000000000000..c9a70358039f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/client.rb @@ -0,0 +1,1780 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/prediction_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + ## + # Client for the PredictionService service. + # + # A service for online predictions and explanations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_service_stub + + ## + # Configure the PredictionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PredictionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionService clients + # ::Google::Cloud::AIPlatform::V1::PredictionService::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 PredictionService 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::PredictionService::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 + @prediction_service_stub.universe_domain + end + + ## + # Create a new PredictionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionService 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/prediction_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 + + @prediction_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::PredictionService::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 + ) + + @prediction_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 = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + config.logger = @prediction_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 = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + config.logger = @prediction_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @prediction_service_stub.logger + end + + # Service calls + + ## + # Perform an online prediction. + # + # @overload predict(request, options = nil) + # Pass arguments to `predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PredictRequest, ::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 predict(endpoint: nil, instances: nil, parameters: nil) + # Pass arguments to `predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Required. The instances that are the input to the prediction call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the prediction call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @param parameters [::Google::Protobuf::Value, ::Hash] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::PredictResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::PredictResponse] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PredictResponse. + # p result + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PredictRequest + + # 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.predict.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.endpoint + header_params["endpoint"] = request.endpoint + 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.predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :predict, 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 + + ## + # Perform an online prediction with an arbitrary HTTP payload. + # + # The response includes the following HTTP headers: + # + # * `X-Vertex-AI-Endpoint-Id`: ID of the + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} that served this + # prediction. + # + # * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} that served this + # prediction. + # + # @overload raw_predict(request, options = nil) + # Pass arguments to `raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RawPredictRequest, ::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 raw_predict(endpoint: nil, http_body: nil) + # Pass arguments to `raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param http_body [::Google::Api::HttpBody, ::Hash] + # The prediction input. Supports HTTP headers and arbitrary data payload. + # + # A {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} may have an + # upper limit on the number of instances it supports per request. When this + # limit it is exceeded for an AutoML model, the + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#raw_predict RawPredict} + # method returns an error. When this limit is exceeded for a custom-trained + # model, the behavior varies depending on the model. + # + # You can specify the schema for each instance in the + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri predict_schemata.instance_schema_uri} + # field when you create a {::Google::Cloud::AIPlatform::V1::Model Model}. This + # schema applies when you deploy the `Model` as a `DeployedModel` to an + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} and use the `RawPredict` + # method. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Api::HttpBody] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RawPredictRequest.new + # + # # Call the raw_predict method. + # result = client.raw_predict request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RawPredictRequest + + # 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.raw_predict.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.endpoint + header_params["endpoint"] = request.endpoint + 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.raw_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :raw_predict, 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 + + ## + # Perform a streaming online prediction with an arbitrary HTTP payload. + # + # @overload stream_raw_predict(request, options = nil) + # Pass arguments to `stream_raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_raw_predict(endpoint: nil, http_body: nil) + # Pass arguments to `stream_raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param http_body [::Google::Api::HttpBody, ::Hash] + # The prediction input. Supports HTTP headers and arbitrary data payload. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Api::HttpBody>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamRawPredictRequest.new + # + # # Call the stream_raw_predict method to start streaming. + # output = client.stream_raw_predict request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_raw_predict.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.endpoint + header_params["endpoint"] = request.endpoint + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_raw_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :stream_raw_predict, 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 + + ## + # Perform an unary online prediction request to a gRPC model server for + # Vertex first-party products and frameworks. + # + # @overload direct_predict(request, options = nil) + # Pass arguments to `direct_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DirectPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DirectPredictRequest, ::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 direct_predict(endpoint: nil, inputs: nil, parameters: nil) + # Pass arguments to `direct_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param inputs [::Array<::Google::Cloud::AIPlatform::V1::Tensor, ::Hash>] + # The prediction input. + # @param parameters [::Google::Cloud::AIPlatform::V1::Tensor, ::Hash] + # The parameters that govern the prediction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DirectPredictResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectPredictResponse] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DirectPredictRequest.new + # + # # Call the direct_predict method. + # result = client.direct_predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DirectPredictResponse. + # p result + # + def direct_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectPredictRequest + + # 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.direct_predict.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.endpoint + header_params["endpoint"] = request.endpoint + 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.direct_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.direct_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :direct_predict, 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 + + ## + # Perform an unary online prediction request to a gRPC model server for + # custom containers. + # + # @overload direct_raw_predict(request, options = nil) + # Pass arguments to `direct_raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest, ::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 direct_raw_predict(endpoint: nil, method_name: nil, input: nil) + # Pass arguments to `direct_raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param method_name [::String] + # Fully qualified name of the API method being invoked to perform + # predictions. + # + # Format: + # `/namespace.Service/Method/` + # Example: + # `/tensorflow.serving.PredictionService/Predict` + # @param input [::String] + # The prediction input. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DirectRawPredictRequest.new + # + # # Call the direct_raw_predict method. + # result = client.direct_raw_predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DirectRawPredictResponse. + # p result + # + def direct_raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest + + # 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.direct_raw_predict.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.endpoint + header_params["endpoint"] = request.endpoint + 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.direct_raw_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.direct_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :direct_raw_predict, 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 + + ## + # Perform a streaming online prediction request to a gRPC model server for + # Vertex first-party products and frameworks. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest, ::Hash>] + # An enumerable of {::Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectPredictResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectPredictResponse>] + # + # @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::PredictionService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the stream_direct_predict method to start streaming. + # output = client.stream_direct_predict input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest.new + # input << Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamDirectPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_direct_predict request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_direct_predict.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 + + options.apply_defaults timeout: @config.rpcs.stream_direct_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_direct_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :stream_direct_predict, 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 + + ## + # Perform a streaming online prediction request to a gRPC model server for + # custom containers. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest, ::Hash>] + # An enumerable of {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictResponse>] + # + # @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::PredictionService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the stream_direct_raw_predict method to start streaming. + # output = client.stream_direct_raw_predict input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest.new + # input << Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_direct_raw_predict request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_direct_raw_predict.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 + + options.apply_defaults timeout: @config.rpcs.stream_direct_raw_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_direct_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :stream_direct_raw_predict, 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 + + ## + # Perform a streaming online prediction request for Vertex first-party + # products and frameworks. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictRequest, ::Hash>] + # An enumerable of {::Google::Cloud::AIPlatform::V1::StreamingPredictRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>] + # + # @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::PredictionService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_predict method to start streaming. + # output = client.streaming_predict input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new + # input << Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamingPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_predict request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamingPredictRequest + end + + # 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.streaming_predict.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 + + options.apply_defaults timeout: @config.rpcs.streaming_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :streaming_predict, 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 + + ## + # Perform a server-side streaming online prediction request for Vertex + # LLM streaming. + # + # @overload server_streaming_predict(request, options = nil) + # Pass arguments to `server_streaming_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamingPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamingPredictRequest, ::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 server_streaming_predict(endpoint: nil, inputs: nil, parameters: nil) + # Pass arguments to `server_streaming_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param inputs [::Array<::Google::Cloud::AIPlatform::V1::Tensor, ::Hash>] + # The prediction input. + # @param parameters [::Google::Cloud::AIPlatform::V1::Tensor, ::Hash] + # The parameters that govern the prediction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new + # + # # Call the server_streaming_predict method to start streaming. + # output = client.server_streaming_predict request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamingPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def server_streaming_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamingPredictRequest + + # 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.server_streaming_predict.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.endpoint + header_params["endpoint"] = request.endpoint + 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.server_streaming_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.server_streaming_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :server_streaming_predict, 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 + + ## + # Perform a streaming online prediction request through gRPC. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest, ::Hash>] + # An enumerable of {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse>] + # + # @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::PredictionService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_raw_predict method to start streaming. + # output = client.streaming_raw_predict input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest.new + # input << Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_raw_predict request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest + end + + # 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.streaming_raw_predict.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 + + options.apply_defaults timeout: @config.rpcs.streaming_raw_predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :streaming_raw_predict, 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 + + ## + # Perform an online explanation. + # + # If + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#deployed_model_id deployed_model_id} + # is specified, the corresponding DeployModel must have + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # populated. If + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#deployed_model_id deployed_model_id} + # is not specified, all DeployedModels must have + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # populated. + # + # @overload explain(request, options = nil) + # Pass arguments to `explain` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExplainRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExplainRequest, ::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 explain(endpoint: nil, instances: nil, parameters: nil, explanation_spec_override: nil, deployed_model_id: nil) + # Pass arguments to `explain` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the explanation. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Required. The instances that are the input to the explanation call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the explanation call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @param parameters [::Google::Protobuf::Value, ::Hash] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # @param explanation_spec_override [::Google::Cloud::AIPlatform::V1::ExplanationSpecOverride, ::Hash] + # If specified, overrides the + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # of the DeployedModel. Can be used for explaining prediction results with + # different configurations, such as: + # - Explaining top-5 predictions results as opposed to top-1; + # - Increasing path count or step count of the attribution methods to reduce + # approximate errors; + # - Using different baselines for explaining the prediction results. + # @param deployed_model_id [::String] + # If specified, this ExplainRequest will be served by the chosen + # DeployedModel, overriding + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ExplainResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ExplainResponse] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExplainRequest.new + # + # # Call the explain method. + # result = client.explain request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ExplainResponse. + # p result + # + def explain request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExplainRequest + + # 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.explain.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.endpoint + header_params["endpoint"] = request.endpoint + 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.explain.timeout, + metadata: metadata, + retry_policy: @config.rpcs.explain.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :explain, 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 + + ## + # Generate content with multimodal inputs. + # + # @overload generate_content(request, options = nil) + # Pass arguments to `generate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GenerateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::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 generate_content(model: nil, contents: nil, system_instruction: nil, cached_content: nil, tools: nil, tool_config: nil, labels: nil, safety_settings: nil, generation_config: nil) + # Pass arguments to `generate_content` 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 model [::String] + # Required. The fully qualified name of the publisher model or tuned model + # endpoint to use. + # + # Publisher model format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # + # Tuned model endpoint format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Required. The content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param cached_content [::String] + # Optional. The name of the cached content used as context to serve the + # prediction. Note: only used in explicit caching, where users can have + # control over caching (e.g. what content to cache) and enjoy guaranteed cost + # savings. Format: + # `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param tool_config [::Google::Cloud::AIPlatform::V1::ToolConfig, ::Hash] + # Optional. Tool config. This config is shared for all tools provided in the + # request. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. It is used + # for billing and reporting only. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @param safety_settings [::Array<::Google::Cloud::AIPlatform::V1::SafetySetting, ::Hash>] + # Optional. Per request settings for blocking unsafe content. + # Enforced on GenerateContentResponse.candidates. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::GenerateContentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GenerateContentRequest.new + # + # # Call the generate_content method. + # result = client.generate_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::GenerateContentResponse. + # p result + # + def generate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GenerateContentRequest + + # 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.generate_content.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.model + header_params["model"] = request.model + 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.generate_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :generate_content, 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 + + ## + # Generate content with multimodal inputs with streaming support. + # + # @overload stream_generate_content(request, options = nil) + # Pass arguments to `stream_generate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GenerateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_generate_content(model: nil, contents: nil, system_instruction: nil, cached_content: nil, tools: nil, tool_config: nil, labels: nil, safety_settings: nil, generation_config: nil) + # Pass arguments to `stream_generate_content` 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 model [::String] + # Required. The fully qualified name of the publisher model or tuned model + # endpoint to use. + # + # Publisher model format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # + # Tuned model endpoint format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Required. The content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param cached_content [::String] + # Optional. The name of the cached content used as context to serve the + # prediction. Note: only used in explicit caching, where users can have + # control over caching (e.g. what content to cache) and enjoy guaranteed cost + # savings. Format: + # `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param tool_config [::Google::Cloud::AIPlatform::V1::ToolConfig, ::Hash] + # Optional. Tool config. This config is shared for all tools provided in the + # request. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. It is used + # for billing and reporting only. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @param safety_settings [::Array<::Google::Cloud::AIPlatform::V1::SafetySetting, ::Hash>] + # Optional. Per request settings for blocking unsafe content. + # Enforced on GenerateContentResponse.candidates. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::GenerateContentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::GenerateContentResponse>] + # + # @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::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GenerateContentRequest.new + # + # # Call the stream_generate_content method to start streaming. + # output = client.stream_generate_content request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::GenerateContentResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_generate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GenerateContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_generate_content.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.model + header_params["model"] = request.model + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_generate_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_generate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :stream_generate_content, 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 PredictionService API. + # + # This class represents the configuration for PredictionService, + # 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::PredictionService::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 + # # predict to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PredictionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PredictionService 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 `predict` + # @return [::Gapic::Config::Method] + # + attr_reader :predict + ## + # RPC-specific configuration for `raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_predict + ## + # RPC-specific configuration for `stream_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_raw_predict + ## + # RPC-specific configuration for `direct_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :direct_predict + ## + # RPC-specific configuration for `direct_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :direct_raw_predict + ## + # RPC-specific configuration for `stream_direct_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_direct_predict + ## + # RPC-specific configuration for `stream_direct_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_direct_raw_predict + ## + # RPC-specific configuration for `streaming_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_predict + ## + # RPC-specific configuration for `server_streaming_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :server_streaming_predict + ## + # RPC-specific configuration for `streaming_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_raw_predict + ## + # RPC-specific configuration for `explain` + # @return [::Gapic::Config::Method] + # + attr_reader :explain + ## + # RPC-specific configuration for `generate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_content + ## + # RPC-specific configuration for `stream_generate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_generate_content + + # @private + def initialize parent_rpcs = nil + predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict + @predict = ::Gapic::Config::Method.new predict_config + raw_predict_config = parent_rpcs.raw_predict if parent_rpcs.respond_to? :raw_predict + @raw_predict = ::Gapic::Config::Method.new raw_predict_config + stream_raw_predict_config = parent_rpcs.stream_raw_predict if parent_rpcs.respond_to? :stream_raw_predict + @stream_raw_predict = ::Gapic::Config::Method.new stream_raw_predict_config + direct_predict_config = parent_rpcs.direct_predict if parent_rpcs.respond_to? :direct_predict + @direct_predict = ::Gapic::Config::Method.new direct_predict_config + direct_raw_predict_config = parent_rpcs.direct_raw_predict if parent_rpcs.respond_to? :direct_raw_predict + @direct_raw_predict = ::Gapic::Config::Method.new direct_raw_predict_config + stream_direct_predict_config = parent_rpcs.stream_direct_predict if parent_rpcs.respond_to? :stream_direct_predict + @stream_direct_predict = ::Gapic::Config::Method.new stream_direct_predict_config + stream_direct_raw_predict_config = parent_rpcs.stream_direct_raw_predict if parent_rpcs.respond_to? :stream_direct_raw_predict + @stream_direct_raw_predict = ::Gapic::Config::Method.new stream_direct_raw_predict_config + streaming_predict_config = parent_rpcs.streaming_predict if parent_rpcs.respond_to? :streaming_predict + @streaming_predict = ::Gapic::Config::Method.new streaming_predict_config + server_streaming_predict_config = parent_rpcs.server_streaming_predict if parent_rpcs.respond_to? :server_streaming_predict + @server_streaming_predict = ::Gapic::Config::Method.new server_streaming_predict_config + streaming_raw_predict_config = parent_rpcs.streaming_raw_predict if parent_rpcs.respond_to? :streaming_raw_predict + @streaming_raw_predict = ::Gapic::Config::Method.new streaming_raw_predict_config + explain_config = parent_rpcs.explain if parent_rpcs.respond_to? :explain + @explain = ::Gapic::Config::Method.new explain_config + generate_content_config = parent_rpcs.generate_content if parent_rpcs.respond_to? :generate_content + @generate_content = ::Gapic::Config::Method.new generate_content_config + stream_generate_content_config = parent_rpcs.stream_generate_content if parent_rpcs.respond_to? :stream_generate_content + @stream_generate_content = ::Gapic::Config::Method.new stream_generate_content_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/credentials.rb new file mode 100644 index 000000000000..d01ab517df62 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/credentials.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + # Credentials for the PredictionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb new file mode 100644 index 000000000000..7d83a71058a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + # Path helper methods for the PredictionService API. + module Paths + ## + # Create a fully-qualified CachedContent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cachedContents/{cached_content}` + # + # @param project [String] + # @param location [String] + # @param cached_content [String] + # + # @return [::String] + def cached_content_path project:, location:, cached_content: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cachedContents/#{cached_content}" + end + + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified RagCorpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # + # @return [::String] + def rag_corpus_path project:, location:, rag_corpus: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb new file mode 100644 index 000000000000..21ea4356843f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/prediction_service/credentials" +require "google/cloud/ai_platform/v1/prediction_service/paths" +require "google/cloud/ai_platform/v1/prediction_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for online predictions and explanations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/prediction_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new + # + module PredictionService + # 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/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb new file mode 100644 index 000000000000..0c7b50c8b4b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb @@ -0,0 +1,1363 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/prediction_service_pb" +require "google/cloud/ai_platform/v1/prediction_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + module Rest + ## + # REST client for the PredictionService service. + # + # A service for online predictions and explanations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_service_stub + + ## + # Configure the PredictionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionService clients + # ::Google::Cloud::AIPlatform::V1::PredictionService::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 PredictionService 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::PredictionService::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 + @prediction_service_stub.universe_domain + end + + ## + # Create a new PredictionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionService 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 + + @prediction_service_stub = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @prediction_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 = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @prediction_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 = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @prediction_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @prediction_service_stub.logger + end + + # Service calls + + ## + # Perform an online prediction. + # + # @overload predict(request, options = nil) + # Pass arguments to `predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PredictRequest, ::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 predict(endpoint: nil, instances: nil, parameters: nil) + # Pass arguments to `predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Required. The instances that are the input to the prediction call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the prediction call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @param parameters [::Google::Protobuf::Value, ::Hash] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::PredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PredictResponse] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::PredictResponse. + # p result + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PredictRequest + + # 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.predict.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.predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.predict 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 + + ## + # Perform an online prediction with an arbitrary HTTP payload. + # + # The response includes the following HTTP headers: + # + # * `X-Vertex-AI-Endpoint-Id`: ID of the + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} that served this + # prediction. + # + # * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} that served this + # prediction. + # + # @overload raw_predict(request, options = nil) + # Pass arguments to `raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RawPredictRequest, ::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 raw_predict(endpoint: nil, http_body: nil) + # Pass arguments to `raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param http_body [::Google::Api::HttpBody, ::Hash] + # The prediction input. Supports HTTP headers and arbitrary data payload. + # + # A {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} may have an + # upper limit on the number of instances it supports per request. When this + # limit it is exceeded for an AutoML model, the + # {::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client#raw_predict RawPredict} + # method returns an error. When this limit is exceeded for a custom-trained + # model, the behavior varies depending on the model. + # + # You can specify the schema for each instance in the + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri predict_schemata.instance_schema_uri} + # field when you create a {::Google::Cloud::AIPlatform::V1::Model Model}. This + # schema applies when you deploy the `Model` as a `DeployedModel` to an + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} and use the `RawPredict` + # method. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RawPredictRequest.new + # + # # Call the raw_predict method. + # result = client.raw_predict request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RawPredictRequest + + # 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.raw_predict.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.raw_predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.raw_predict 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 + + ## + # Perform a streaming online prediction with an arbitrary HTTP payload. + # + # @overload stream_raw_predict(request, options = nil) + # Pass arguments to `stream_raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_raw_predict(endpoint: nil, http_body: nil) + # Pass arguments to `stream_raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param http_body [::Google::Api::HttpBody, ::Hash] + # The prediction input. Supports HTTP headers and arbitrary data payload. + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamRawPredictRequest.new + # + # # Call the stream_raw_predict method to start streaming. + # output = client.stream_raw_predict request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_raw_predict.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_raw_predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Api::HttpBody, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @prediction_service_stub.stream_raw_predict request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Perform an unary online prediction request to a gRPC model server for + # Vertex first-party products and frameworks. + # + # @overload direct_predict(request, options = nil) + # Pass arguments to `direct_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DirectPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DirectPredictRequest, ::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 direct_predict(endpoint: nil, inputs: nil, parameters: nil) + # Pass arguments to `direct_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param inputs [::Array<::Google::Cloud::AIPlatform::V1::Tensor, ::Hash>] + # The prediction input. + # @param parameters [::Google::Cloud::AIPlatform::V1::Tensor, ::Hash] + # The parameters that govern the prediction. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DirectPredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectPredictResponse] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DirectPredictRequest.new + # + # # Call the direct_predict method. + # result = client.direct_predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DirectPredictResponse. + # p result + # + def direct_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectPredictRequest + + # 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.direct_predict.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.direct_predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.direct_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.direct_predict 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 + + ## + # Perform an unary online prediction request to a gRPC model server for + # custom containers. + # + # @overload direct_raw_predict(request, options = nil) + # Pass arguments to `direct_raw_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest, ::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 direct_raw_predict(endpoint: nil, method_name: nil, input: nil) + # Pass arguments to `direct_raw_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param method_name [::String] + # Fully qualified name of the API method being invoked to perform + # predictions. + # + # Format: + # `/namespace.Service/Method/` + # Example: + # `/tensorflow.serving.PredictionService/Predict` + # @param input [::String] + # The prediction input. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DirectRawPredictRequest.new + # + # # Call the direct_raw_predict method. + # result = client.direct_raw_predict request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::DirectRawPredictResponse. + # p result + # + def direct_raw_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest + + # 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.direct_raw_predict.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.direct_raw_predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.direct_raw_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.direct_raw_predict 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 + + ## + # Perform a server-side streaming online prediction request for Vertex + # LLM streaming. + # + # @overload server_streaming_predict(request, options = nil) + # Pass arguments to `server_streaming_predict` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamingPredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamingPredictRequest, ::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 server_streaming_predict(endpoint: nil, inputs: nil, parameters: nil) + # Pass arguments to `server_streaming_predict` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param inputs [::Array<::Google::Cloud::AIPlatform::V1::Tensor, ::Hash>] + # The prediction input. + # @param parameters [::Google::Cloud::AIPlatform::V1::Tensor, ::Hash] + # The parameters that govern the prediction. + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new + # + # # Call the server_streaming_predict method to start streaming. + # output = client.server_streaming_predict request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::StreamingPredictResponse + # output.each do |current_response| + # p current_response + # end + # + def server_streaming_predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamingPredictRequest + + # 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.server_streaming_predict.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.server_streaming_predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.server_streaming_predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::AIPlatform::V1::StreamingPredictResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @prediction_service_stub.server_streaming_predict request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Perform an online explanation. + # + # If + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#deployed_model_id deployed_model_id} + # is specified, the corresponding DeployModel must have + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # populated. If + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#deployed_model_id deployed_model_id} + # is not specified, all DeployedModels must have + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # populated. + # + # @overload explain(request, options = nil) + # Pass arguments to `explain` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExplainRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExplainRequest, ::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 explain(endpoint: nil, instances: nil, parameters: nil, explanation_spec_override: nil, deployed_model_id: nil) + # Pass arguments to `explain` 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 endpoint [::String] + # Required. The name of the Endpoint requested to serve the explanation. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param instances [::Array<::Google::Protobuf::Value, ::Hash>] + # Required. The instances that are the input to the explanation call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the explanation call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @param parameters [::Google::Protobuf::Value, ::Hash] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # @param explanation_spec_override [::Google::Cloud::AIPlatform::V1::ExplanationSpecOverride, ::Hash] + # If specified, overrides the + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # of the DeployedModel. Can be used for explaining prediction results with + # different configurations, such as: + # - Explaining top-5 predictions results as opposed to top-1; + # - Increasing path count or step count of the attribution methods to reduce + # approximate errors; + # - Using different baselines for explaining the prediction results. + # @param deployed_model_id [::String] + # If specified, this ExplainRequest will be served by the chosen + # DeployedModel, overriding + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ExplainResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ExplainResponse] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExplainRequest.new + # + # # Call the explain method. + # result = client.explain request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ExplainResponse. + # p result + # + def explain request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExplainRequest + + # 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.explain.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.explain.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.explain.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.explain 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 + + ## + # Generate content with multimodal inputs. + # + # @overload generate_content(request, options = nil) + # Pass arguments to `generate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GenerateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::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 generate_content(model: nil, contents: nil, system_instruction: nil, cached_content: nil, tools: nil, tool_config: nil, labels: nil, safety_settings: nil, generation_config: nil) + # Pass arguments to `generate_content` 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 model [::String] + # Required. The fully qualified name of the publisher model or tuned model + # endpoint to use. + # + # Publisher model format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # + # Tuned model endpoint format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Required. The content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param cached_content [::String] + # Optional. The name of the cached content used as context to serve the + # prediction. Note: only used in explicit caching, where users can have + # control over caching (e.g. what content to cache) and enjoy guaranteed cost + # savings. Format: + # `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param tool_config [::Google::Cloud::AIPlatform::V1::ToolConfig, ::Hash] + # Optional. Tool config. This config is shared for all tools provided in the + # request. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. It is used + # for billing and reporting only. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @param safety_settings [::Array<::Google::Cloud::AIPlatform::V1::SafetySetting, ::Hash>] + # Optional. Per request settings for blocking unsafe content. + # Enforced on GenerateContentResponse.candidates. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::GenerateContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GenerateContentRequest.new + # + # # Call the generate_content method. + # result = client.generate_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::GenerateContentResponse. + # p result + # + def generate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GenerateContentRequest + + # 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.generate_content.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.generate_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.generate_content 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 + + ## + # Generate content with multimodal inputs with streaming support. + # + # @overload stream_generate_content(request, options = nil) + # Pass arguments to `stream_generate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GenerateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_generate_content(model: nil, contents: nil, system_instruction: nil, cached_content: nil, tools: nil, tool_config: nil, labels: nil, safety_settings: nil, generation_config: nil) + # Pass arguments to `stream_generate_content` 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 model [::String] + # Required. The fully qualified name of the publisher model or tuned model + # endpoint to use. + # + # Publisher model format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # + # Tuned model endpoint format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Required. The content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param system_instruction [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @param cached_content [::String] + # Optional. The name of the cached content used as context to serve the + # prediction. Note: only used in explicit caching, where users can have + # control over caching (e.g. what content to cache) and enjoy guaranteed cost + # savings. Format: + # `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + # @param tools [::Array<::Google::Cloud::AIPlatform::V1::Tool, ::Hash>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @param tool_config [::Google::Cloud::AIPlatform::V1::ToolConfig, ::Hash] + # Optional. Tool config. This config is shared for all tools provided in the + # request. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. It is used + # for billing and reporting only. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @param safety_settings [::Array<::Google::Cloud::AIPlatform::V1::SafetySetting, ::Hash>] + # Optional. Per request settings for blocking unsafe content. + # Enforced on GenerateContentResponse.candidates. + # @param generation_config [::Google::Cloud::AIPlatform::V1::GenerationConfig, ::Hash] + # Optional. Generation config. + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::GenerateContentResponse>] + # + # @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::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GenerateContentRequest.new + # + # # Call the stream_generate_content method to start streaming. + # output = client.stream_generate_content request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::GenerateContentResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_generate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GenerateContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_generate_content.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_generate_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_generate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::AIPlatform::V1::GenerateContentResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @prediction_service_stub.stream_generate_content request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PredictionService REST API. + # + # This class represents the configuration for PredictionService 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::PredictionService::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 + # # predict to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PredictionService 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 `predict` + # @return [::Gapic::Config::Method] + # + attr_reader :predict + ## + # RPC-specific configuration for `raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_predict + ## + # RPC-specific configuration for `stream_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_raw_predict + ## + # RPC-specific configuration for `direct_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :direct_predict + ## + # RPC-specific configuration for `direct_raw_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :direct_raw_predict + ## + # RPC-specific configuration for `server_streaming_predict` + # @return [::Gapic::Config::Method] + # + attr_reader :server_streaming_predict + ## + # RPC-specific configuration for `explain` + # @return [::Gapic::Config::Method] + # + attr_reader :explain + ## + # RPC-specific configuration for `generate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_content + ## + # RPC-specific configuration for `stream_generate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_generate_content + + # @private + def initialize parent_rpcs = nil + predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict + @predict = ::Gapic::Config::Method.new predict_config + raw_predict_config = parent_rpcs.raw_predict if parent_rpcs.respond_to? :raw_predict + @raw_predict = ::Gapic::Config::Method.new raw_predict_config + stream_raw_predict_config = parent_rpcs.stream_raw_predict if parent_rpcs.respond_to? :stream_raw_predict + @stream_raw_predict = ::Gapic::Config::Method.new stream_raw_predict_config + direct_predict_config = parent_rpcs.direct_predict if parent_rpcs.respond_to? :direct_predict + @direct_predict = ::Gapic::Config::Method.new direct_predict_config + direct_raw_predict_config = parent_rpcs.direct_raw_predict if parent_rpcs.respond_to? :direct_raw_predict + @direct_raw_predict = ::Gapic::Config::Method.new direct_raw_predict_config + server_streaming_predict_config = parent_rpcs.server_streaming_predict if parent_rpcs.respond_to? :server_streaming_predict + @server_streaming_predict = ::Gapic::Config::Method.new server_streaming_predict_config + explain_config = parent_rpcs.explain if parent_rpcs.respond_to? :explain + @explain = ::Gapic::Config::Method.new explain_config + generate_content_config = parent_rpcs.generate_content if parent_rpcs.respond_to? :generate_content + @generate_content = ::Gapic::Config::Method.new generate_content_config + stream_generate_content_config = parent_rpcs.stream_generate_content if parent_rpcs.respond_to? :stream_generate_content + @stream_generate_content = ::Gapic::Config::Method.new stream_generate_content_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb new file mode 100644 index 000000000000..c9924612bc9f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb @@ -0,0 +1,701 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/prediction_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + module Rest + ## + # REST service stub for the PredictionService 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 predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PredictRequest] + # 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::PredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::PredictResponse] + # A result object deserialized from the server's reply + def predict request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_predict_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: "predict", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::PredictResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RawPredictRequest] + # 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::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # A result object deserialized from the server's reply + def raw_predict request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_raw_predict_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: "raw_predict", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stream_raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_raw_predict request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_raw_predict_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_raw_predict", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the direct_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DirectPredictRequest] + # 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::DirectPredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectPredictResponse] + # A result object deserialized from the server's reply + def direct_predict request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_direct_predict_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: "direct_predict", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DirectPredictResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the direct_raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest] + # 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::DirectRawPredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse] + # A result object deserialized from the server's reply + def direct_raw_predict request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_direct_raw_predict_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: "direct_raw_predict", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the server_streaming_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamingPredictRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def server_streaming_predict request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_server_streaming_predict_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: "server_streaming_predict", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the explain REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExplainRequest] + # 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::ExplainResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ExplainResponse] + # A result object deserialized from the server's reply + def explain request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_explain_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: "explain", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ExplainResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GenerateContentRequest] + # 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::GenerateContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse] + # A result object deserialized from the server's reply + def generate_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_content_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: "generate_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::GenerateContentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stream_generate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GenerateContentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_generate_content request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_generate_content_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_generate_content", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # @private + # + # GRPC transcoding helper method for the predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:predict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:predict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RawPredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_raw_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:rawPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:rawPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_raw_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:streamRawPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:streamRawPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the direct_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DirectPredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_direct_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:directPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the direct_raw_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_direct_raw_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:directRawPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the server_streaming_predict REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamingPredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_server_streaming_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:serverStreamingPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:serverStreamingPredict", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the explain REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExplainRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_explain_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{endpoint}:explain", + body: "*", + matches: [ + ["endpoint", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GenerateContentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:generateContent", + body: "*", + matches: [ + ["model", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:generateContent", + body: "*", + matches: [ + ["model", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:generateContent", + body: "*", + matches: [ + ["model", %r{^endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:generateContent", + body: "*", + matches: [ + ["model", %r{^publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_generate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GenerateContentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_generate_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:streamGenerateContent", + body: "*", + matches: [ + ["model", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:streamGenerateContent", + body: "*", + matches: [ + ["model", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:streamGenerateContent", + body: "*", + matches: [ + ["model", %r{^endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{model}:streamGenerateContent", + body: "*", + matches: [ + ["model", %r{^publishers/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb new file mode 100644 index 000000000000..ff9ca72cb6a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/client" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for executing queries on Reasoning Engine. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + module ReasoningEngineExecutionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "reasoning_engine_execution_service", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb new file mode 100644 index 000000000000..d8c579fd9272 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + ## + # Client for the ReasoningEngineExecutionService service. + # + # A service for executing queries on Reasoning Engine. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_execution_service_stub + + ## + # Configure the ReasoningEngineExecutionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineExecutionService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineExecutionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_execution_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineExecutionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineExecutionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @reasoning_engine_execution_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @reasoning_engine_execution_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_execution_service_stub.logger + end + + # Service calls + + ## + # Queries using a reasoning engine. + # + # @overload query_reasoning_engine(request, options = nil) + # Pass arguments to `query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new + # + # # Call the query_reasoning_engine method. + # result = client.query_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse. + # p result + # + def query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.call_rpc :query_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Streams queries using a reasoning engine. + # + # @overload stream_query_reasoning_engine(request, options = nil) + # Pass arguments to `stream_query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `stream_query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Api::HttpBody>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new + # + # # Call the stream_query_reasoning_engine method to start streaming. + # output = client.stream_query_reasoning_engine request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_query_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.call_rpc :stream_query_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineExecutionService API. + # + # This class represents the configuration for ReasoningEngineExecutionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # query_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReasoningEngineExecutionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :query_reasoning_engine + ## + # RPC-specific configuration for `stream_query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_query_reasoning_engine + + # @private + def initialize parent_rpcs = nil + query_reasoning_engine_config = parent_rpcs.query_reasoning_engine if parent_rpcs.respond_to? :query_reasoning_engine + @query_reasoning_engine = ::Gapic::Config::Method.new query_reasoning_engine_config + stream_query_reasoning_engine_config = parent_rpcs.stream_query_reasoning_engine if parent_rpcs.respond_to? :stream_query_reasoning_engine + @stream_query_reasoning_engine = ::Gapic::Config::Method.new stream_query_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb new file mode 100644 index 000000000000..f590472d9f4e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # Credentials for the ReasoningEngineExecutionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb new file mode 100644 index 000000000000..7b9349865376 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # Path helper methods for the ReasoningEngineExecutionService API. + module Paths + ## + # Create a fully-qualified ReasoningEngine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # + # @return [::String] + def reasoning_engine_path project:, location:, reasoning_engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb new file mode 100644 index 000000000000..0a12b5841df3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for executing queries on Reasoning Engine. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + module ReasoningEngineExecutionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb new file mode 100644 index 000000000000..ee4a54eddcaf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb @@ -0,0 +1,564 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + module Rest + ## + # REST client for the ReasoningEngineExecutionService service. + # + # A service for executing queries on Reasoning Engine. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_execution_service_stub + + ## + # Configure the ReasoningEngineExecutionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineExecutionService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineExecutionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_execution_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineExecutionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineExecutionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @reasoning_engine_execution_service_stub = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @reasoning_engine_execution_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_execution_service_stub.logger + end + + # Service calls + + ## + # Queries using a reasoning engine. + # + # @overload query_reasoning_engine(request, options = nil) + # Pass arguments to `query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new + # + # # Call the query_reasoning_engine method. + # result = client.query_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse. + # p result + # + def query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.query_reasoning_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Streams queries using a reasoning engine. + # + # @overload stream_query_reasoning_engine(request, options = nil) + # Pass arguments to `stream_query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `stream_query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new + # + # # Call the stream_query_reasoning_engine method to start streaming. + # output = client.stream_query_reasoning_engine request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_query_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Api::HttpBody, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @reasoning_engine_execution_service_stub.stream_query_reasoning_engine request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineExecutionService REST API. + # + # This class represents the configuration for ReasoningEngineExecutionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # query_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ReasoningEngineExecutionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :query_reasoning_engine + ## + # RPC-specific configuration for `stream_query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_query_reasoning_engine + + # @private + def initialize parent_rpcs = nil + query_reasoning_engine_config = parent_rpcs.query_reasoning_engine if parent_rpcs.respond_to? :query_reasoning_engine + @query_reasoning_engine = ::Gapic::Config::Method.new query_reasoning_engine_config + stream_query_reasoning_engine_config = parent_rpcs.stream_query_reasoning_engine if parent_rpcs.respond_to? :stream_query_reasoning_engine + @stream_query_reasoning_engine = ::Gapic::Config::Method.new stream_query_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb new file mode 100644 index 000000000000..918445e5724c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + module Rest + ## + # REST service stub for the ReasoningEngineExecutionService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # A result object deserialized from the server's reply + def query_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stream_query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_query_reasoning_engine request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_query_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_query_reasoning_engine", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # @private + # + # GRPC transcoding helper method for the query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:query", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_query_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:streamQuery", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb new file mode 100644 index 000000000000..d8d5009c32a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/reasoning_engine_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_service/operations" +require "google/cloud/ai_platform/v1/reasoning_engine_service/client" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Reasoning Engines. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + module ReasoningEngineService + end + end + end + end +end + +helper_path = ::File.join __dir__, "reasoning_engine_service", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb new file mode 100644 index 000000000000..5fada823d79e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb @@ -0,0 +1,914 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + ## + # Client for the ReasoningEngineService service. + # + # A service for managing Vertex AI's Reasoning Engines. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_service_stub + + ## + # Configure the ReasoningEngineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/aiplatform/v1/reasoning_engine_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @reasoning_engine_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @reasoning_engine_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_service_stub.logger + end + + # Service calls + + ## + # Creates a reasoning engine. + # + # @overload create_reasoning_engine(request, options = nil) + # Pass arguments to `create_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_reasoning_engine(parent: nil, reasoning_engine: nil) + # Pass arguments to `create_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new + # + # # Call the create_reasoning_engine method. + # result = client.create_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :create_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a reasoning engine. + # + # @overload get_reasoning_engine(request, options = nil) + # Pass arguments to `get_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_reasoning_engine(name: nil) + # Pass arguments to `get_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new + # + # # Call the get_reasoning_engine method. + # result = client.get_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p result + # + def get_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :get_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reasoning engines in a location. + # + # @overload list_reasoning_engines(request, options = nil) + # Pass arguments to `list_reasoning_engines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_reasoning_engines(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reasoning_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new + # + # # Call the list_reasoning_engines method. + # result = client.list_reasoning_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p item + # end + # + def list_reasoning_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_reasoning_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_reasoning_engines.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reasoning_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :list_reasoning_engines, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reasoning_engine_service_stub, :list_reasoning_engines, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a reasoning engine. + # + # @overload update_reasoning_engine(request, options = nil) + # Pass arguments to `update_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_reasoning_engine(reasoning_engine: nil, update_mask: nil) + # Pass arguments to `update_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new + # + # # Call the update_reasoning_engine method. + # result = client.update_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.reasoning_engine&.name + header_params["reasoning_engine.name"] = request.reasoning_engine.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :update_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reasoning engine. + # + # @overload delete_reasoning_engine(request, options = nil) + # Pass arguments to `delete_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_reasoning_engine(name: nil) + # Pass arguments to `delete_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new + # + # # Call the delete_reasoning_engine method. + # result = client.delete_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :delete_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineService API. + # + # This class represents the configuration for ReasoningEngineService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReasoningEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reasoning_engine + ## + # RPC-specific configuration for `get_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reasoning_engine + ## + # RPC-specific configuration for `list_reasoning_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reasoning_engines + ## + # RPC-specific configuration for `update_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reasoning_engine + ## + # RPC-specific configuration for `delete_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reasoning_engine + + # @private + def initialize parent_rpcs = nil + create_reasoning_engine_config = parent_rpcs.create_reasoning_engine if parent_rpcs.respond_to? :create_reasoning_engine + @create_reasoning_engine = ::Gapic::Config::Method.new create_reasoning_engine_config + get_reasoning_engine_config = parent_rpcs.get_reasoning_engine if parent_rpcs.respond_to? :get_reasoning_engine + @get_reasoning_engine = ::Gapic::Config::Method.new get_reasoning_engine_config + list_reasoning_engines_config = parent_rpcs.list_reasoning_engines if parent_rpcs.respond_to? :list_reasoning_engines + @list_reasoning_engines = ::Gapic::Config::Method.new list_reasoning_engines_config + update_reasoning_engine_config = parent_rpcs.update_reasoning_engine if parent_rpcs.respond_to? :update_reasoning_engine + @update_reasoning_engine = ::Gapic::Config::Method.new update_reasoning_engine_config + delete_reasoning_engine_config = parent_rpcs.delete_reasoning_engine if parent_rpcs.respond_to? :delete_reasoning_engine + @delete_reasoning_engine = ::Gapic::Config::Method.new delete_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb new file mode 100644 index 000000000000..286ee59b610d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Credentials for the ReasoningEngineService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb new file mode 100644 index 000000000000..19d66bd8a1fb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ReasoningEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb new file mode 100644 index 000000000000..b1fda620a119 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Path helper methods for the ReasoningEngineService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified ReasoningEngine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # + # @return [::String] + def reasoning_engine_path project:, location:, reasoning_engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb new file mode 100644 index 000000000000..4196ebfbf94f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/reasoning_engine_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Reasoning Engines. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + module ReasoningEngineService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb new file mode 100644 index 000000000000..7f4e23bb9b02 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb @@ -0,0 +1,862 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + ## + # REST client for the ReasoningEngineService service. + # + # A service for managing Vertex AI's Reasoning Engines. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_service_stub + + ## + # Configure the ReasoningEngineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @reasoning_engine_service_stub = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @reasoning_engine_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_service_stub.logger + end + + # Service calls + + ## + # Creates a reasoning engine. + # + # @overload create_reasoning_engine(request, options = nil) + # Pass arguments to `create_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_reasoning_engine(parent: nil, reasoning_engine: nil) + # Pass arguments to `create_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new + # + # # Call the create_reasoning_engine method. + # result = client.create_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.create_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a reasoning engine. + # + # @overload get_reasoning_engine(request, options = nil) + # Pass arguments to `get_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_reasoning_engine(name: nil) + # Pass arguments to `get_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new + # + # # Call the get_reasoning_engine method. + # result = client.get_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p result + # + def get_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.get_reasoning_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reasoning engines in a location. + # + # @overload list_reasoning_engines(request, options = nil) + # Pass arguments to `list_reasoning_engines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_reasoning_engines(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reasoning_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new + # + # # Call the list_reasoning_engines method. + # result = client.list_reasoning_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p item + # end + # + def list_reasoning_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_reasoning_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_reasoning_engines.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reasoning_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.list_reasoning_engines request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reasoning_engine_service_stub, :list_reasoning_engines, "reasoning_engines", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a reasoning engine. + # + # @overload update_reasoning_engine(request, options = nil) + # Pass arguments to `update_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_reasoning_engine(reasoning_engine: nil, update_mask: nil) + # Pass arguments to `update_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new + # + # # Call the update_reasoning_engine method. + # result = client.update_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.update_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reasoning engine. + # + # @overload delete_reasoning_engine(request, options = nil) + # Pass arguments to `delete_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_reasoning_engine(name: nil) + # Pass arguments to `delete_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new + # + # # Call the delete_reasoning_engine method. + # result = client.delete_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.delete_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineService REST API. + # + # This class represents the configuration for ReasoningEngineService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ReasoningEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reasoning_engine + ## + # RPC-specific configuration for `get_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reasoning_engine + ## + # RPC-specific configuration for `list_reasoning_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reasoning_engines + ## + # RPC-specific configuration for `update_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reasoning_engine + ## + # RPC-specific configuration for `delete_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reasoning_engine + + # @private + def initialize parent_rpcs = nil + create_reasoning_engine_config = parent_rpcs.create_reasoning_engine if parent_rpcs.respond_to? :create_reasoning_engine + @create_reasoning_engine = ::Gapic::Config::Method.new create_reasoning_engine_config + get_reasoning_engine_config = parent_rpcs.get_reasoning_engine if parent_rpcs.respond_to? :get_reasoning_engine + @get_reasoning_engine = ::Gapic::Config::Method.new get_reasoning_engine_config + list_reasoning_engines_config = parent_rpcs.list_reasoning_engines if parent_rpcs.respond_to? :list_reasoning_engines + @list_reasoning_engines = ::Gapic::Config::Method.new list_reasoning_engines_config + update_reasoning_engine_config = parent_rpcs.update_reasoning_engine if parent_rpcs.respond_to? :update_reasoning_engine + @update_reasoning_engine = ::Gapic::Config::Method.new update_reasoning_engine_config + delete_reasoning_engine_config = parent_rpcs.delete_reasoning_engine if parent_rpcs.respond_to? :delete_reasoning_engine + @delete_reasoning_engine = ::Gapic::Config::Method.new delete_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb new file mode 100644 index 000000000000..a0acb5e012fd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ReasoningEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb new file mode 100644 index 000000000000..c6299a9b54db --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + ## + # REST service stub for the ReasoningEngineService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # A result object deserialized from the server's reply + def get_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReasoningEngine.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_reasoning_engines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse] + # A result object deserialized from the server's reply + def list_reasoning_engines request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reasoning_engines_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_reasoning_engines", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reasoningEngines", + body: "reasoning_engine", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reasoning_engines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_reasoning_engines_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reasoningEngines", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{reasoning_engine.name}", + body: "reasoning_engine", + matches: [ + ["reasoning_engine.name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb new file mode 100644 index 000000000000..540a4894dea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/ai_platform/v1/dataset_service/rest" +require "google/cloud/ai_platform/v1/deployment_resource_pool_service/rest" +require "google/cloud/ai_platform/v1/endpoint_service/rest" +require "google/cloud/ai_platform/v1/evaluation_service/rest" +require "google/cloud/ai_platform/v1/feature_online_store_admin_service/rest" +require "google/cloud/ai_platform/v1/featurestore_online_serving_service/rest" +require "google/cloud/ai_platform/v1/feature_online_store_service/rest" +require "google/cloud/ai_platform/v1/featurestore_service/rest" +require "google/cloud/ai_platform/v1/feature_registry_service/rest" +require "google/cloud/ai_platform/v1/gen_ai_cache_service/rest" +require "google/cloud/ai_platform/v1/gen_ai_tuning_service/rest" +require "google/cloud/ai_platform/v1/index_endpoint_service/rest" +require "google/cloud/ai_platform/v1/index_service/rest" +require "google/cloud/ai_platform/v1/job_service/rest" +require "google/cloud/ai_platform/v1/prediction_service/rest" +require "google/cloud/ai_platform/v1/llm_utility_service/rest" +require "google/cloud/ai_platform/v1/match_service/rest" +require "google/cloud/ai_platform/v1/metadata_service/rest" +require "google/cloud/ai_platform/v1/migration_service/rest" +require "google/cloud/ai_platform/v1/model_garden_service/rest" +require "google/cloud/ai_platform/v1/model_service/rest" +require "google/cloud/ai_platform/v1/notebook_service/rest" +require "google/cloud/ai_platform/v1/persistent_resource_service/rest" +require "google/cloud/ai_platform/v1/pipeline_service/rest" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" +require "google/cloud/ai_platform/v1/schedule_service/rest" +require "google/cloud/ai_platform/v1/specialist_pool_service/rest" +require "google/cloud/ai_platform/v1/tensorboard_service/rest" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest" +require "google/cloud/ai_platform/v1/vertex_rag_service/rest" +require "google/cloud/ai_platform/v1/vizier_service/rest" +require "google/cloud/ai_platform/v1/bindings_override" +require "google/cloud/ai_platform/v1/version" + +module Google + module Cloud + module AIPlatform + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/ai_platform/v1/rest" + # client = ::Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service.rb new file mode 100644 index 000000000000..498d8281900e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/schedule_service/credentials" +require "google/cloud/ai_platform/v1/schedule_service/paths" +require "google/cloud/ai_platform/v1/schedule_service/operations" +require "google/cloud/ai_platform/v1/schedule_service/client" +require "google/cloud/ai_platform/v1/schedule_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/schedule_service" + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/schedule_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new + # + module ScheduleService + end + end + end + end +end + +helper_path = ::File.join __dir__, "schedule_service", "helpers.rb" +require "google/cloud/ai_platform/v1/schedule_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/client.rb new file mode 100644 index 000000000000..5472a4dba061 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/client.rb @@ -0,0 +1,1166 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/schedule_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + ## + # Client for the ScheduleService service. + # + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :schedule_service_stub + + ## + # Configure the ScheduleService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ScheduleService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ScheduleService clients + # ::Google::Cloud::AIPlatform::V1::ScheduleService::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 ScheduleService 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::ScheduleService::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 + @schedule_service_stub.universe_domain + end + + ## + # Create a new ScheduleService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ScheduleService 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/schedule_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 + + @schedule_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ScheduleService::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 + ) + + @schedule_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 = @schedule_service_stub.endpoint + config.universe_domain = @schedule_service_stub.universe_domain + config.logger = @schedule_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 = @schedule_service_stub.endpoint + config.universe_domain = @schedule_service_stub.universe_domain + config.logger = @schedule_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ScheduleService::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 + @schedule_service_stub.logger + end + + # Service calls + + ## + # Creates a Schedule. + # + # @overload create_schedule(request, options = nil) + # Pass arguments to `create_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateScheduleRequest, ::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_schedule(parent: nil, schedule: nil) + # Pass arguments to `create_schedule` 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 Schedule in. + # Format: `projects/{project}/locations/{location}` + # @param schedule [::Google::Cloud::AIPlatform::V1::Schedule, ::Hash] + # Required. The Schedule to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateScheduleRequest.new + # + # # Call the create_schedule method. + # result = client.create_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def create_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :create_schedule, 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 a Schedule. + # + # @overload delete_schedule(request, options = nil) + # Pass arguments to `delete_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest, ::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_schedule(name: nil) + # Pass arguments to `delete_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # + # @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::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteScheduleRequest.new + # + # # Call the delete_schedule method. + # result = client.delete_schedule 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_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :delete_schedule, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Schedule. + # + # @overload get_schedule(request, options = nil) + # Pass arguments to `get_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetScheduleRequest, ::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_schedule(name: nil) + # Pass arguments to `get_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetScheduleRequest.new + # + # # Call the get_schedule method. + # result = client.get_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def get_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :get_schedule, 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 Schedules in a Location. + # + # @overload list_schedules(request, options = nil) + # Pass arguments to `list_schedules` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSchedulesRequest, ::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_schedules(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_schedules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Schedules from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the Schedules that match the filter expression. The following + # fields are supported: + # + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `state`: Supports `=` and `!=` comparisons. + # * `request`: Supports existence of the check. + # (e.g. `create_pipeline_job_request:*` --> Schedule has + # create_pipeline_job_request). + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + # existence check. Values must be in RFC 3339 format. + # * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + # comparisons. Values must be in RFC 3339 format. + # + # + # Filter expressions can be combined together using logical operators + # (`NOT`, `AND` & `OR`). + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `state="ACTIVE" AND display_name:"my_schedule_*"` + # * `NOT display_name="my_schedule"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + # * `create_pipeline_job_request:*` + # @param page_size [::Integer] + # The standard list page size. + # Default to 100 if not specified. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListSchedulesResponse#next_page_token ListSchedulesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#list_schedules ScheduleService.ListSchedules} + # call. + # @param order_by [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided. + # + # For example, using "create_time desc, end_time" will order results by + # create time in descending order, and if there are multiple schedules having + # the same create time, order them by the end time in ascending order. + # + # If order_by is not specified, it will order by default with create_time in + # descending order. + # + # Supported fields: + # + # * `create_time` + # * `start_time` + # * `end_time` + # * `next_run_time` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Schedule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Schedule>] + # + # @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::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSchedulesRequest.new + # + # # Call the list_schedules method. + # result = client.list_schedules 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::Schedule. + # p item + # end + # + def list_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSchedulesRequest + + # 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_schedules.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_schedules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :list_schedules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @schedule_service_stub, :list_schedules, 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 + + ## + # Pauses a Schedule. Will mark + # {::Google::Cloud::AIPlatform::V1::Schedule#state Schedule.state} to 'PAUSED'. If + # the schedule is paused, no new runs will be created. Already created runs + # will NOT be paused or canceled. + # + # @overload pause_schedule(request, options = nil) + # Pass arguments to `pause_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PauseScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PauseScheduleRequest, ::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 pause_schedule(name: nil) + # Pass arguments to `pause_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be paused. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PauseScheduleRequest.new + # + # # Call the pause_schedule method. + # result = client.pause_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PauseScheduleRequest + + # 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.pause_schedule.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.pause_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :pause_schedule, 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 + + ## + # Resumes a paused Schedule to start scheduling new runs. Will mark + # {::Google::Cloud::AIPlatform::V1::Schedule#state Schedule.state} to 'ACTIVE'. + # Only paused Schedule can be resumed. + # + # When the Schedule is resumed, new runs will be scheduled starting from the + # next execution time after the current time based on the time_specification + # in the Schedule. If + # {::Google::Cloud::AIPlatform::V1::Schedule#catch_up Schedule.catch_up} is set up + # true, all missed runs will be scheduled for backfill first. + # + # @overload resume_schedule(request, options = nil) + # Pass arguments to `resume_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest, ::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 resume_schedule(name: nil, catch_up: nil) + # Pass arguments to `resume_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be resumed. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @param catch_up [::Boolean] + # Optional. Whether to backfill missed runs when the schedule is resumed from + # PAUSED state. If set to true, all missed runs will be scheduled. New runs + # will be scheduled after the backfill is complete. This will also update + # {::Google::Cloud::AIPlatform::V1::Schedule#catch_up Schedule.catch_up} field. + # Default to false. + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ResumeScheduleRequest.new + # + # # Call the resume_schedule method. + # result = client.resume_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest + + # 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.resume_schedule.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.resume_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :resume_schedule, 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 + + ## + # Updates an active or paused Schedule. + # + # When the Schedule is updated, new runs will be scheduled starting from the + # updated next execution time after the update time based on the + # time_specification in the updated Schedule. All unstarted runs before the + # update time will be skipped while already created runs will NOT be paused + # or canceled. + # + # @overload update_schedule(request, options = nil) + # Pass arguments to `update_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest, ::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_schedule(schedule: nil, update_mask: nil) + # Pass arguments to `update_schedule` 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 schedule [::Google::Cloud::AIPlatform::V1::Schedule, ::Hash] + # Required. The Schedule which replaces the resource on the server. + # The following restrictions will be applied: + # + # * The scheduled request type cannot be changed. + # * The non-empty fields cannot be unset. + # * The output_only fields will be ignored if specified. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateScheduleRequest.new + # + # # Call the update_schedule method. + # result = client.update_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def update_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest + + # 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_schedule.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.schedule&.name + header_params["schedule.name"] = request.schedule.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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.call_rpc :update_schedule, 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 ScheduleService API. + # + # This class represents the configuration for ScheduleService, + # 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::ScheduleService::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_schedule to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ScheduleService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_schedule.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_schedule.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ScheduleService 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_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_schedule + ## + # RPC-specific configuration for `delete_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schedule + ## + # RPC-specific configuration for `get_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_schedule + ## + # RPC-specific configuration for `list_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schedules + ## + # RPC-specific configuration for `pause_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_schedule + ## + # RPC-specific configuration for `resume_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_schedule + ## + # RPC-specific configuration for `update_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_schedule + + # @private + def initialize parent_rpcs = nil + create_schedule_config = parent_rpcs.create_schedule if parent_rpcs.respond_to? :create_schedule + @create_schedule = ::Gapic::Config::Method.new create_schedule_config + delete_schedule_config = parent_rpcs.delete_schedule if parent_rpcs.respond_to? :delete_schedule + @delete_schedule = ::Gapic::Config::Method.new delete_schedule_config + get_schedule_config = parent_rpcs.get_schedule if parent_rpcs.respond_to? :get_schedule + @get_schedule = ::Gapic::Config::Method.new get_schedule_config + list_schedules_config = parent_rpcs.list_schedules if parent_rpcs.respond_to? :list_schedules + @list_schedules = ::Gapic::Config::Method.new list_schedules_config + pause_schedule_config = parent_rpcs.pause_schedule if parent_rpcs.respond_to? :pause_schedule + @pause_schedule = ::Gapic::Config::Method.new pause_schedule_config + resume_schedule_config = parent_rpcs.resume_schedule if parent_rpcs.respond_to? :resume_schedule + @resume_schedule = ::Gapic::Config::Method.new resume_schedule_config + update_schedule_config = parent_rpcs.update_schedule if parent_rpcs.respond_to? :update_schedule + @update_schedule = ::Gapic::Config::Method.new update_schedule_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/credentials.rb new file mode 100644 index 000000000000..1403624d014b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + # Credentials for the ScheduleService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb new file mode 100644 index 000000000000..f88346ae45d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + # 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 ScheduleService 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 ScheduleService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb new file mode 100644 index 000000000000..4c3451cda38b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + # Path helper methods for the ScheduleService API. + module Paths + ## + # Create a fully-qualified Artifact resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param artifact [String] + # + # @return [::String] + def artifact_path project:, location:, metadata_store:, artifact: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/artifacts/#{artifact}" + end + + ## + # Create a fully-qualified Context resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param context [String] + # + # @return [::String] + def context_path project:, location:, metadata_store:, context: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/contexts/#{context}" + end + + ## + # Create a fully-qualified CustomJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @param project [String] + # @param location [String] + # @param custom_job [String] + # + # @return [::String] + def custom_job_path project:, location:, custom_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customJobs/#{custom_job}" + end + + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param metadata_store [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, metadata_store:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "metadata_store cannot contain /" if metadata_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/metadataStores/#{metadata_store}/executions/#{execution}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified NotebookExecutionJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}` + # + # @param project [String] + # @param location [String] + # @param notebook_execution_job [String] + # + # @return [::String] + def notebook_execution_job_path project:, location:, notebook_execution_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notebookExecutionJobs/#{notebook_execution_job}" + end + + ## + # Create a fully-qualified NotebookRuntimeTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + # + # @param project [String] + # @param location [String] + # @param notebook_runtime_template [String] + # + # @return [::String] + def notebook_runtime_template_path project:, location:, notebook_runtime_template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notebookRuntimeTemplates/#{notebook_runtime_template}" + end + + ## + # Create a fully-qualified PipelineJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + # + # @param project [String] + # @param location [String] + # @param pipeline_job [String] + # + # @return [::String] + def pipeline_job_path project:, location:, pipeline_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/pipelineJobs/#{pipeline_job}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}` + # + # @param project_id_or_number [String] + # @param zone [String] + # @param reservation_name [String] + # + # @return [::String] + def reservation_path project_id_or_number:, zone:, reservation_name: + raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/" + raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/" + + "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}" + end + + ## + # Create a fully-qualified Schedule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/schedules/{schedule}` + # + # @param project [String] + # @param location [String] + # @param schedule [String] + # + # @return [::String] + def schedule_path project:, location:, schedule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/schedules/#{schedule}" + end + + ## + # Create a fully-qualified Subnetwork resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + # + # @param project [String] + # @param region [String] + # @param subnetwork [String] + # + # @return [::String] + def subnetwork_path project:, region:, subnetwork: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/subnetworks/#{subnetwork}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb new file mode 100644 index 000000000000..cb01d264c3a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/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/schedule_service/credentials" +require "google/cloud/ai_platform/v1/schedule_service/paths" +require "google/cloud/ai_platform/v1/schedule_service/rest/operations" +require "google/cloud/ai_platform/v1/schedule_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/schedule_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new + # + module ScheduleService + # 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/schedule_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb new file mode 100644 index 000000000000..ed351c3b5424 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb @@ -0,0 +1,1100 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/schedule_service_pb" +require "google/cloud/ai_platform/v1/schedule_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + module Rest + ## + # REST client for the ScheduleService service. + # + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :schedule_service_stub + + ## + # Configure the ScheduleService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ScheduleService clients + # ::Google::Cloud::AIPlatform::V1::ScheduleService::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 ScheduleService 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::ScheduleService::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 + @schedule_service_stub.universe_domain + end + + ## + # Create a new ScheduleService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ScheduleService 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::ScheduleService::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 + + @schedule_service_stub = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @schedule_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 = @schedule_service_stub.endpoint + config.universe_domain = @schedule_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @schedule_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 = @schedule_service_stub.endpoint + config.universe_domain = @schedule_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @schedule_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ScheduleService::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 + @schedule_service_stub.logger + end + + # Service calls + + ## + # Creates a Schedule. + # + # @overload create_schedule(request, options = nil) + # Pass arguments to `create_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateScheduleRequest, ::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_schedule(parent: nil, schedule: nil) + # Pass arguments to `create_schedule` 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 Schedule in. + # Format: `projects/{project}/locations/{location}` + # @param schedule [::Google::Cloud::AIPlatform::V1::Schedule, ::Hash] + # Required. The Schedule to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateScheduleRequest.new + # + # # Call the create_schedule method. + # result = client.create_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def create_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.create_schedule 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 a Schedule. + # + # @overload delete_schedule(request, options = nil) + # Pass arguments to `delete_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest, ::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_schedule(name: nil) + # Pass arguments to `delete_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @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::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteScheduleRequest.new + # + # # Call the delete_schedule method. + # result = client.delete_schedule 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_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.delete_schedule request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Schedule. + # + # @overload get_schedule(request, options = nil) + # Pass arguments to `get_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetScheduleRequest, ::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_schedule(name: nil) + # Pass arguments to `get_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetScheduleRequest.new + # + # # Call the get_schedule method. + # result = client.get_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def get_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.get_schedule 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 Schedules in a Location. + # + # @overload list_schedules(request, options = nil) + # Pass arguments to `list_schedules` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSchedulesRequest, ::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_schedules(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_schedules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Schedules from. + # Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the Schedules that match the filter expression. The following + # fields are supported: + # + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `state`: Supports `=` and `!=` comparisons. + # * `request`: Supports existence of the check. + # (e.g. `create_pipeline_job_request:*` --> Schedule has + # create_pipeline_job_request). + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + # existence check. Values must be in RFC 3339 format. + # * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + # comparisons. Values must be in RFC 3339 format. + # + # + # Filter expressions can be combined together using logical operators + # (`NOT`, `AND` & `OR`). + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `state="ACTIVE" AND display_name:"my_schedule_*"` + # * `NOT display_name="my_schedule"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + # * `create_pipeline_job_request:*` + # @param page_size [::Integer] + # The standard list page size. + # Default to 100 if not specified. + # @param page_token [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListSchedulesResponse#next_page_token ListSchedulesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client#list_schedules ScheduleService.ListSchedules} + # call. + # @param order_by [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided. + # + # For example, using "create_time desc, end_time" will order results by + # create time in descending order, and if there are multiple schedules having + # the same create time, order them by the end time in ascending order. + # + # If order_by is not specified, it will order by default with create_time in + # descending order. + # + # Supported fields: + # + # * `create_time` + # * `start_time` + # * `end_time` + # * `next_run_time` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Schedule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Schedule>] + # + # @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::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSchedulesRequest.new + # + # # Call the list_schedules method. + # result = client.list_schedules 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::Schedule. + # p item + # end + # + def list_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSchedulesRequest + + # 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_schedules.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_schedules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.list_schedules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @schedule_service_stub, :list_schedules, "schedules", 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 + + ## + # Pauses a Schedule. Will mark + # {::Google::Cloud::AIPlatform::V1::Schedule#state Schedule.state} to 'PAUSED'. If + # the schedule is paused, no new runs will be created. Already created runs + # will NOT be paused or canceled. + # + # @overload pause_schedule(request, options = nil) + # Pass arguments to `pause_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::PauseScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::PauseScheduleRequest, ::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 pause_schedule(name: nil) + # Pass arguments to `pause_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be paused. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::PauseScheduleRequest.new + # + # # Call the pause_schedule method. + # result = client.pause_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PauseScheduleRequest + + # 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.pause_schedule.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.pause_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.pause_schedule 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 + + ## + # Resumes a paused Schedule to start scheduling new runs. Will mark + # {::Google::Cloud::AIPlatform::V1::Schedule#state Schedule.state} to 'ACTIVE'. + # Only paused Schedule can be resumed. + # + # When the Schedule is resumed, new runs will be scheduled starting from the + # next execution time after the current time based on the time_specification + # in the Schedule. If + # {::Google::Cloud::AIPlatform::V1::Schedule#catch_up Schedule.catch_up} is set up + # true, all missed runs will be scheduled for backfill first. + # + # @overload resume_schedule(request, options = nil) + # Pass arguments to `resume_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest, ::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 resume_schedule(name: nil, catch_up: nil) + # Pass arguments to `resume_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Schedule resource to be resumed. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @param catch_up [::Boolean] + # Optional. Whether to backfill missed runs when the schedule is resumed from + # PAUSED state. If set to true, all missed runs will be scheduled. New runs + # will be scheduled after the backfill is complete. This will also update + # {::Google::Cloud::AIPlatform::V1::Schedule#catch_up Schedule.catch_up} field. + # Default to false. + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ResumeScheduleRequest.new + # + # # Call the resume_schedule method. + # result = client.resume_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest + + # 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.resume_schedule.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.resume_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.resume_schedule 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 + + ## + # Updates an active or paused Schedule. + # + # When the Schedule is updated, new runs will be scheduled starting from the + # updated next execution time after the update time based on the + # time_specification in the updated Schedule. All unstarted runs before the + # update time will be skipped while already created runs will NOT be paused + # or canceled. + # + # @overload update_schedule(request, options = nil) + # Pass arguments to `update_schedule` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest, ::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_schedule(schedule: nil, update_mask: nil) + # Pass arguments to `update_schedule` 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 schedule [::Google::Cloud::AIPlatform::V1::Schedule, ::Hash] + # Required. The Schedule which replaces the resource on the server. + # The following restrictions will be applied: + # + # * The scheduled request type cannot be changed. + # * The non-empty fields cannot be unset. + # * The output_only fields will be ignored if specified. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # + # @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::ScheduleService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateScheduleRequest.new + # + # # Call the update_schedule method. + # result = client.update_schedule request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Schedule. + # p result + # + def update_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest + + # 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_schedule.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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schedule_service_stub.update_schedule 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 ScheduleService REST API. + # + # This class represents the configuration for ScheduleService 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::ScheduleService::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_schedule to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_schedule.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_schedule.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ScheduleService 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_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_schedule + ## + # RPC-specific configuration for `delete_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schedule + ## + # RPC-specific configuration for `get_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_schedule + ## + # RPC-specific configuration for `list_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schedules + ## + # RPC-specific configuration for `pause_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_schedule + ## + # RPC-specific configuration for `resume_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_schedule + ## + # RPC-specific configuration for `update_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_schedule + + # @private + def initialize parent_rpcs = nil + create_schedule_config = parent_rpcs.create_schedule if parent_rpcs.respond_to? :create_schedule + @create_schedule = ::Gapic::Config::Method.new create_schedule_config + delete_schedule_config = parent_rpcs.delete_schedule if parent_rpcs.respond_to? :delete_schedule + @delete_schedule = ::Gapic::Config::Method.new delete_schedule_config + get_schedule_config = parent_rpcs.get_schedule if parent_rpcs.respond_to? :get_schedule + @get_schedule = ::Gapic::Config::Method.new get_schedule_config + list_schedules_config = parent_rpcs.list_schedules if parent_rpcs.respond_to? :list_schedules + @list_schedules = ::Gapic::Config::Method.new list_schedules_config + pause_schedule_config = parent_rpcs.pause_schedule if parent_rpcs.respond_to? :pause_schedule + @pause_schedule = ::Gapic::Config::Method.new pause_schedule_config + resume_schedule_config = parent_rpcs.resume_schedule if parent_rpcs.respond_to? :resume_schedule + @resume_schedule = ::Gapic::Config::Method.new resume_schedule_config + update_schedule_config = parent_rpcs.update_schedule if parent_rpcs.respond_to? :update_schedule + @update_schedule = ::Gapic::Config::Method.new update_schedule_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb new file mode 100644 index 000000000000..c50defb063b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + 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 ScheduleService 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 ScheduleService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb new file mode 100644 index 000000000000..2d70d8599636 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/schedule_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + module Rest + ## + # REST service stub for the ScheduleService 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_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateScheduleRequest] + # 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::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # A result object deserialized from the server's reply + def create_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_schedule_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_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Schedule.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_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest] + # 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_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_schedule_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_schedule", + 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_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetScheduleRequest] + # 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::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # A result object deserialized from the server's reply + def get_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_schedule_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_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Schedule.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_schedules REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSchedulesRequest] + # 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::ListSchedulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListSchedulesResponse] + # A result object deserialized from the server's reply + def list_schedules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_schedules_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_schedules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListSchedulesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the pause_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PauseScheduleRequest] + # 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 pause_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_schedule_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: "pause_schedule", + 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 resume_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest] + # 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 resume_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_schedule_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: "resume_schedule", + 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 update_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest] + # 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::Schedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # A result object deserialized from the server's reply + def update_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_schedule_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_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Schedule.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_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateScheduleRequest] + # 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/schedules", + body: "schedule", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest] + # 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetScheduleRequest] + # 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_schedules REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSchedulesRequest] + # 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_schedules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/schedules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::PauseScheduleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_schedule REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest] + # 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{schedule.name}", + body: "schedule", + matches: [ + ["schedule.name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb new file mode 100644 index 000000000000..ec226d8b4afd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/specialist_pool_service/credentials" +require "google/cloud/ai_platform/v1/specialist_pool_service/paths" +require "google/cloud/ai_platform/v1/specialist_pool_service/operations" +require "google/cloud/ai_platform/v1/specialist_pool_service/client" +require "google/cloud/ai_platform/v1/specialist_pool_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/specialist_pool_service" + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/specialist_pool_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new + # + module SpecialistPoolService + end + end + end + end +end + +helper_path = ::File.join __dir__, "specialist_pool_service", "helpers.rb" +require "google/cloud/ai_platform/v1/specialist_pool_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb new file mode 100644 index 000000000000..a1dc58b37379 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb @@ -0,0 +1,926 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/specialist_pool_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + ## + # Client for the SpecialistPoolService service. + # + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :specialist_pool_service_stub + + ## + # Configure the SpecialistPoolService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SpecialistPoolService clients + # ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::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 SpecialistPoolService 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::SpecialistPoolService::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 + @specialist_pool_service_stub.universe_domain + end + + ## + # Create a new SpecialistPoolService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SpecialistPoolService 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/specialist_pool_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 + + @specialist_pool_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::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 + ) + + @specialist_pool_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 = @specialist_pool_service_stub.endpoint + config.universe_domain = @specialist_pool_service_stub.universe_domain + config.logger = @specialist_pool_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 = @specialist_pool_service_stub.endpoint + config.universe_domain = @specialist_pool_service_stub.universe_domain + config.logger = @specialist_pool_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPoolService::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 + @specialist_pool_service_stub.logger + end + + # Service calls + + ## + # Creates a SpecialistPool. + # + # @overload create_specialist_pool(request, options = nil) + # Pass arguments to `create_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest, ::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_specialist_pool(parent: nil, specialist_pool: nil) + # Pass arguments to `create_specialist_pool` 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 parent Project name for the new SpecialistPool. + # The form is `projects/{project}/locations/{location}`. + # @param specialist_pool [::Google::Cloud::AIPlatform::V1::SpecialistPool, ::Hash] + # Required. The SpecialistPool 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::SpecialistPoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest.new + # + # # Call the create_specialist_pool method. + # result = client.create_specialist_pool 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_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.call_rpc :create_specialist_pool, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a SpecialistPool. + # + # @overload get_specialist_pool(request, options = nil) + # Pass arguments to `get_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest, ::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_specialist_pool(name: nil) + # Pass arguments to `get_specialist_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the SpecialistPool resource. + # The form is + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # + # @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::SpecialistPoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest.new + # + # # Call the get_specialist_pool method. + # result = client.get_specialist_pool request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SpecialistPool. + # p result + # + def get_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.call_rpc :get_specialist_pool, 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 SpecialistPools in a Location. + # + # @overload list_specialist_pools(request, options = nil) + # Pass arguments to `list_specialist_pools` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest, ::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_specialist_pools(parent: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_specialist_pools` 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 name of the SpecialistPool's parent resource. + # Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained by + # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse#next_page_token ListSpecialistPoolsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools} + # call. Return first page if empty. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. FieldMask represents a set of + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SpecialistPool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SpecialistPool>] + # + # @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::SpecialistPoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest.new + # + # # Call the list_specialist_pools method. + # result = client.list_specialist_pools 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::SpecialistPool. + # p item + # end + # + def list_specialist_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest + + # 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_specialist_pools.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_specialist_pools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_specialist_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.call_rpc :list_specialist_pools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @specialist_pool_service_stub, :list_specialist_pools, 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 + + ## + # Deletes a SpecialistPool as well as all Specialists in the pool. + # + # @overload delete_specialist_pool(request, options = nil) + # Pass arguments to `delete_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest, ::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_specialist_pool(name: nil, force: nil) + # Pass arguments to `delete_specialist_pool` 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 SpecialistPool to delete. Format: + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + # @param force [::Boolean] + # If set to true, any specialist managers in this SpecialistPool will also be + # deleted. (Otherwise, the request will only work if the SpecialistPool has + # no specialist managers.) + # + # @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::SpecialistPoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest.new + # + # # Call the delete_specialist_pool method. + # result = client.delete_specialist_pool 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_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.call_rpc :delete_specialist_pool, 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 + + ## + # Updates a SpecialistPool. + # + # @overload update_specialist_pool(request, options = nil) + # Pass arguments to `update_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest, ::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_specialist_pool(specialist_pool: nil, update_mask: nil) + # Pass arguments to `update_specialist_pool` 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 specialist_pool [::Google::Cloud::AIPlatform::V1::SpecialistPool, ::Hash] + # Required. The SpecialistPool which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the 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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest.new + # + # # Call the update_specialist_pool method. + # result = client.update_specialist_pool request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest + + # 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_specialist_pool.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.specialist_pool&.name + header_params["specialist_pool.name"] = request.specialist_pool.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_specialist_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.call_rpc :update_specialist_pool, 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 SpecialistPoolService API. + # + # This class represents the configuration for SpecialistPoolService, + # 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::SpecialistPoolService::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_specialist_pool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_specialist_pool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_specialist_pool.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SpecialistPoolService 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_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_specialist_pool + ## + # RPC-specific configuration for `get_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_specialist_pool + ## + # RPC-specific configuration for `list_specialist_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_specialist_pools + ## + # RPC-specific configuration for `delete_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_specialist_pool + ## + # RPC-specific configuration for `update_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_specialist_pool + + # @private + def initialize parent_rpcs = nil + create_specialist_pool_config = parent_rpcs.create_specialist_pool if parent_rpcs.respond_to? :create_specialist_pool + @create_specialist_pool = ::Gapic::Config::Method.new create_specialist_pool_config + get_specialist_pool_config = parent_rpcs.get_specialist_pool if parent_rpcs.respond_to? :get_specialist_pool + @get_specialist_pool = ::Gapic::Config::Method.new get_specialist_pool_config + list_specialist_pools_config = parent_rpcs.list_specialist_pools if parent_rpcs.respond_to? :list_specialist_pools + @list_specialist_pools = ::Gapic::Config::Method.new list_specialist_pools_config + delete_specialist_pool_config = parent_rpcs.delete_specialist_pool if parent_rpcs.respond_to? :delete_specialist_pool + @delete_specialist_pool = ::Gapic::Config::Method.new delete_specialist_pool_config + update_specialist_pool_config = parent_rpcs.update_specialist_pool if parent_rpcs.respond_to? :update_specialist_pool + @update_specialist_pool = ::Gapic::Config::Method.new update_specialist_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/credentials.rb new file mode 100644 index 000000000000..964eb9beeabc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + # Credentials for the SpecialistPoolService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb new file mode 100644 index 000000000000..e470caf15295 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + # 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 SpecialistPoolService 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 SpecialistPoolService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/paths.rb new file mode 100644 index 000000000000..804fbc7ae37b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + # Path helper methods for the SpecialistPoolService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified SpecialistPool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + # + # @param project [String] + # @param location [String] + # @param specialist_pool [String] + # + # @return [::String] + def specialist_pool_path project:, location:, specialist_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/specialistPools/#{specialist_pool}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb new file mode 100644 index 000000000000..00dc51ee3978 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/specialist_pool_service/credentials" +require "google/cloud/ai_platform/v1/specialist_pool_service/paths" +require "google/cloud/ai_platform/v1/specialist_pool_service/rest/operations" +require "google/cloud/ai_platform/v1/specialist_pool_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/specialist_pool_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new + # + module SpecialistPoolService + # 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/specialist_pool_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb new file mode 100644 index 000000000000..09e5be3ac680 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb @@ -0,0 +1,874 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/specialist_pool_service_pb" +require "google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + module Rest + ## + # REST client for the SpecialistPoolService service. + # + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :specialist_pool_service_stub + + ## + # Configure the SpecialistPoolService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SpecialistPoolService clients + # ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::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 SpecialistPoolService 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::SpecialistPoolService::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 + @specialist_pool_service_stub.universe_domain + end + + ## + # Create a new SpecialistPoolService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SpecialistPoolService 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::SpecialistPoolService::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 + + @specialist_pool_service_stub = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @specialist_pool_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 = @specialist_pool_service_stub.endpoint + config.universe_domain = @specialist_pool_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @specialist_pool_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 = @specialist_pool_service_stub.endpoint + config.universe_domain = @specialist_pool_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @specialist_pool_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPoolService::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 + @specialist_pool_service_stub.logger + end + + # Service calls + + ## + # Creates a SpecialistPool. + # + # @overload create_specialist_pool(request, options = nil) + # Pass arguments to `create_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest, ::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_specialist_pool(parent: nil, specialist_pool: nil) + # Pass arguments to `create_specialist_pool` 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 parent Project name for the new SpecialistPool. + # The form is `projects/{project}/locations/{location}`. + # @param specialist_pool [::Google::Cloud::AIPlatform::V1::SpecialistPool, ::Hash] + # Required. The SpecialistPool 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::SpecialistPoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest.new + # + # # Call the create_specialist_pool method. + # result = client.create_specialist_pool 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_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.create_specialist_pool request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a SpecialistPool. + # + # @overload get_specialist_pool(request, options = nil) + # Pass arguments to `get_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest, ::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_specialist_pool(name: nil) + # Pass arguments to `get_specialist_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the SpecialistPool resource. + # The form is + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # + # @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::SpecialistPoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest.new + # + # # Call the get_specialist_pool method. + # result = client.get_specialist_pool request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::SpecialistPool. + # p result + # + def get_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.get_specialist_pool 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 SpecialistPools in a Location. + # + # @overload list_specialist_pools(request, options = nil) + # Pass arguments to `list_specialist_pools` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest, ::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_specialist_pools(parent: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_specialist_pools` 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 name of the SpecialistPool's parent resource. + # Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # Typically obtained by + # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse#next_page_token ListSpecialistPoolsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools} + # call. Return first page if empty. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. FieldMask represents a set of + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SpecialistPool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SpecialistPool>] + # + # @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::SpecialistPoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest.new + # + # # Call the list_specialist_pools method. + # result = client.list_specialist_pools 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::SpecialistPool. + # p item + # end + # + def list_specialist_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest + + # 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_specialist_pools.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_specialist_pools.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_specialist_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.list_specialist_pools request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @specialist_pool_service_stub, :list_specialist_pools, "specialist_pools", 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 + + ## + # Deletes a SpecialistPool as well as all Specialists in the pool. + # + # @overload delete_specialist_pool(request, options = nil) + # Pass arguments to `delete_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest, ::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_specialist_pool(name: nil, force: nil) + # Pass arguments to `delete_specialist_pool` 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 SpecialistPool to delete. Format: + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + # @param force [::Boolean] + # If set to true, any specialist managers in this SpecialistPool will also be + # deleted. (Otherwise, the request will only work if the SpecialistPool has + # no specialist managers.) + # @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::SpecialistPoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest.new + # + # # Call the delete_specialist_pool method. + # result = client.delete_specialist_pool 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_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.delete_specialist_pool 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 + + ## + # Updates a SpecialistPool. + # + # @overload update_specialist_pool(request, options = nil) + # Pass arguments to `update_specialist_pool` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest, ::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_specialist_pool(specialist_pool: nil, update_mask: nil) + # Pass arguments to `update_specialist_pool` 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 specialist_pool [::Google::Cloud::AIPlatform::V1::SpecialistPool, ::Hash] + # Required. The SpecialistPool which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the 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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest.new + # + # # Call the update_specialist_pool method. + # result = client.update_specialist_pool request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_specialist_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest + + # 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_specialist_pool.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_specialist_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_specialist_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @specialist_pool_service_stub.update_specialist_pool 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 SpecialistPoolService REST API. + # + # This class represents the configuration for SpecialistPoolService 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::SpecialistPoolService::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_specialist_pool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_specialist_pool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_specialist_pool.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SpecialistPoolService 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_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_specialist_pool + ## + # RPC-specific configuration for `get_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_specialist_pool + ## + # RPC-specific configuration for `list_specialist_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_specialist_pools + ## + # RPC-specific configuration for `delete_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_specialist_pool + ## + # RPC-specific configuration for `update_specialist_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_specialist_pool + + # @private + def initialize parent_rpcs = nil + create_specialist_pool_config = parent_rpcs.create_specialist_pool if parent_rpcs.respond_to? :create_specialist_pool + @create_specialist_pool = ::Gapic::Config::Method.new create_specialist_pool_config + get_specialist_pool_config = parent_rpcs.get_specialist_pool if parent_rpcs.respond_to? :get_specialist_pool + @get_specialist_pool = ::Gapic::Config::Method.new get_specialist_pool_config + list_specialist_pools_config = parent_rpcs.list_specialist_pools if parent_rpcs.respond_to? :list_specialist_pools + @list_specialist_pools = ::Gapic::Config::Method.new list_specialist_pools_config + delete_specialist_pool_config = parent_rpcs.delete_specialist_pool if parent_rpcs.respond_to? :delete_specialist_pool + @delete_specialist_pool = ::Gapic::Config::Method.new delete_specialist_pool_config + update_specialist_pool_config = parent_rpcs.update_specialist_pool if parent_rpcs.respond_to? :update_specialist_pool + @update_specialist_pool = ::Gapic::Config::Method.new update_specialist_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb new file mode 100644 index 000000000000..ee996696997f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + 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 SpecialistPoolService 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 SpecialistPoolService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb new file mode 100644 index 000000000000..543c0f7f7547 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/specialist_pool_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + module Rest + ## + # REST service stub for the SpecialistPoolService 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_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest] + # 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_specialist_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_specialist_pool_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_specialist_pool", + 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_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest] + # 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::SpecialistPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # A result object deserialized from the server's reply + def get_specialist_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_specialist_pool_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_specialist_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::SpecialistPool.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_specialist_pools REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest] + # 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::ListSpecialistPoolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse] + # A result object deserialized from the server's reply + def list_specialist_pools request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_specialist_pools_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_specialist_pools", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse.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_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest] + # 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_specialist_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_specialist_pool_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_specialist_pool", + 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 update_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_specialist_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_specialist_pool_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_specialist_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest] + # 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_specialist_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/specialistPools", + body: "specialist_pool", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest] + # 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_specialist_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_specialist_pools REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest] + # 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_specialist_pools_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/specialistPools", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest] + # 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_specialist_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_specialist_pool REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest] + # 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_specialist_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{specialist_pool.name}", + body: "specialist_pool", + matches: [ + ["specialist_pool.name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service.rb new file mode 100644 index 000000000000..572b9b0f2b61 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/tensorboard_service/credentials" +require "google/cloud/ai_platform/v1/tensorboard_service/paths" +require "google/cloud/ai_platform/v1/tensorboard_service/operations" +require "google/cloud/ai_platform/v1/tensorboard_service/client" +require "google/cloud/ai_platform/v1/tensorboard_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # TensorboardService + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/tensorboard_service" + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/tensorboard_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.new + # + module TensorboardService + end + end + end + end +end + +helper_path = ::File.join __dir__, "tensorboard_service", "helpers.rb" +require "google/cloud/ai_platform/v1/tensorboard_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb new file mode 100644 index 000000000000..1ac4c70b3252 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb @@ -0,0 +1,3509 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/tensorboard_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + ## + # Client for the TensorboardService service. + # + # TensorboardService + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tensorboard_service_stub + + ## + # Configure the TensorboardService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::TensorboardService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TensorboardService clients + # ::Google::Cloud::AIPlatform::V1::TensorboardService::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 TensorboardService 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::TensorboardService::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 + @tensorboard_service_stub.universe_domain + end + + ## + # Create a new TensorboardService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TensorboardService 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/tensorboard_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 + + @tensorboard_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::TensorboardService::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 + ) + + @tensorboard_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 = @tensorboard_service_stub.endpoint + config.universe_domain = @tensorboard_service_stub.universe_domain + config.logger = @tensorboard_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 = @tensorboard_service_stub.endpoint + config.universe_domain = @tensorboard_service_stub.universe_domain + config.logger = @tensorboard_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardService::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 + @tensorboard_service_stub.logger + end + + # Service calls + + ## + # Creates a Tensorboard. + # + # @overload create_tensorboard(request, options = nil) + # Pass arguments to `create_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest, ::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_tensorboard(parent: nil, tensorboard: nil) + # Pass arguments to `create_tensorboard` 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 Tensorboard in. + # Format: `projects/{project}/locations/{location}` + # @param tensorboard [::Google::Cloud::AIPlatform::V1::Tensorboard, ::Hash] + # Required. The Tensorboard 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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardRequest.new + # + # # Call the create_tensorboard method. + # result = client.create_tensorboard 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_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :create_tensorboard, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Tensorboard. + # + # @overload get_tensorboard(request, options = nil) + # Pass arguments to `get_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardRequest, ::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_tensorboard(name: nil) + # Pass arguments to `get_tensorboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Tensorboard] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardRequest.new + # + # # Call the get_tensorboard method. + # result = client.get_tensorboard request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Tensorboard. + # p result + # + def get_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :get_tensorboard, 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 + + ## + # Updates a Tensorboard. + # + # @overload update_tensorboard(request, options = nil) + # Pass arguments to `update_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest, ::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_tensorboard(update_mask: nil, tensorboard: nil) + # Pass arguments to `update_tensorboard` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Tensorboard resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard [::Google::Cloud::AIPlatform::V1::Tensorboard, ::Hash] + # Required. The Tensorboard's `name` field is used to identify the + # Tensorboard to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest.new + # + # # Call the update_tensorboard method. + # result = client.update_tensorboard request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest + + # 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_tensorboard.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.tensorboard&.name + header_params["tensorboard.name"] = request.tensorboard.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_tensorboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :update_tensorboard, 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 Tensorboards in a Location. + # + # @overload list_tensorboards(request, options = nil) + # Pass arguments to `list_tensorboards` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest, ::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_tensorboards(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboards` 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 Tensorboards. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the Tensorboards that match the filter expression. + # @param page_size [::Integer] + # The maximum number of Tensorboards to return. The service may return + # fewer than this value. If unspecified, at most 100 Tensorboards are + # returned. The maximum value is 100; values above 100 are coerced to + # 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Tensorboard>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Tensorboard>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardsRequest.new + # + # # Call the list_tensorboards method. + # result = client.list_tensorboards 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::Tensorboard. + # p item + # end + # + def list_tensorboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest + + # 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_tensorboards.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_tensorboards.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tensorboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :list_tensorboards, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboards, 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 + + ## + # Deletes a Tensorboard. + # + # @overload delete_tensorboard(request, options = nil) + # Pass arguments to `delete_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest, ::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_tensorboard(name: nil) + # Pass arguments to `delete_tensorboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Tensorboard to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest.new + # + # # Call the delete_tensorboard method. + # result = client.delete_tensorboard 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_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :delete_tensorboard, 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 + + ## + # Returns a list of monthly active users for a given TensorBoard instance. + # + # @overload read_tensorboard_usage(request, options = nil) + # Pass arguments to `read_tensorboard_usage` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest, ::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 read_tensorboard_usage(tensorboard: nil) + # Pass arguments to `read_tensorboard_usage` 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 tensorboard [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest.new + # + # # Call the read_tensorboard_usage method. + # result = client.read_tensorboard_usage request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse. + # p result + # + def read_tensorboard_usage request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest + + # 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.read_tensorboard_usage.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.tensorboard + header_params["tensorboard"] = request.tensorboard + 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.read_tensorboard_usage.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_tensorboard_usage.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :read_tensorboard_usage, 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 + + ## + # Returns the storage size for a given TensorBoard instance. + # + # @overload read_tensorboard_size(request, options = nil) + # Pass arguments to `read_tensorboard_size` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest, ::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 read_tensorboard_size(tensorboard: nil) + # Pass arguments to `read_tensorboard_size` 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 tensorboard [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest.new + # + # # Call the read_tensorboard_size method. + # result = client.read_tensorboard_size request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse. + # p result + # + def read_tensorboard_size request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest + + # 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.read_tensorboard_size.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.tensorboard + header_params["tensorboard"] = request.tensorboard + 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.read_tensorboard_size.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_tensorboard_size.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :read_tensorboard_size, 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 + + ## + # Creates a TensorboardExperiment. + # + # @overload create_tensorboard_experiment(request, options = nil) + # Pass arguments to `create_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest, ::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_tensorboard_experiment(parent: nil, tensorboard_experiment: nil, tensorboard_experiment_id: nil) + # Pass arguments to `create_tensorboard_experiment` 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 Tensorboard to create the + # TensorboardExperiment in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @param tensorboard_experiment [::Google::Cloud::AIPlatform::V1::TensorboardExperiment, ::Hash] + # The TensorboardExperiment to create. + # @param tensorboard_experiment_id [::String] + # Required. The ID to use for the Tensorboard experiment, which becomes the + # final component of the Tensorboard experiment's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest.new + # + # # Call the create_tensorboard_experiment method. + # result = client.create_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def create_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :create_tensorboard_experiment, 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 + + ## + # Gets a TensorboardExperiment. + # + # @overload get_tensorboard_experiment(request, options = nil) + # Pass arguments to `get_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest, ::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_tensorboard_experiment(name: nil) + # Pass arguments to `get_tensorboard_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardExperiment resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest.new + # + # # Call the get_tensorboard_experiment method. + # result = client.get_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def get_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :get_tensorboard_experiment, 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 + + ## + # Updates a TensorboardExperiment. + # + # @overload update_tensorboard_experiment(request, options = nil) + # Pass arguments to `update_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest, ::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_tensorboard_experiment(update_mask: nil, tensorboard_experiment: nil) + # Pass arguments to `update_tensorboard_experiment` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardExperiment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_experiment [::Google::Cloud::AIPlatform::V1::TensorboardExperiment, ::Hash] + # Required. The TensorboardExperiment's `name` field is used to identify the + # TensorboardExperiment to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest.new + # + # # Call the update_tensorboard_experiment method. + # result = client.update_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def update_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest + + # 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_tensorboard_experiment.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.tensorboard_experiment&.name + header_params["tensorboard_experiment.name"] = request.tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :update_tensorboard_experiment, 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 TensorboardExperiments in a Location. + # + # @overload list_tensorboard_experiments(request, options = nil) + # Pass arguments to `list_tensorboard_experiments` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest, ::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_tensorboard_experiments(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_experiments` 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 Tensorboard to list + # TensorboardExperiments. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @param filter [::String] + # Lists the TensorboardExperiments that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardExperiments to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardExperiments are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest.new + # + # # Call the list_tensorboard_experiments method. + # result = client.list_tensorboard_experiments 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::TensorboardExperiment. + # p item + # end + # + def list_tensorboard_experiments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest + + # 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_tensorboard_experiments.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_tensorboard_experiments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tensorboard_experiments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :list_tensorboard_experiments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_experiments, 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 + + ## + # Deletes a TensorboardExperiment. + # + # @overload delete_tensorboard_experiment(request, options = nil) + # Pass arguments to `delete_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest, ::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_tensorboard_experiment(name: nil) + # Pass arguments to `delete_tensorboard_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardExperiment to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest.new + # + # # Call the delete_tensorboard_experiment method. + # result = client.delete_tensorboard_experiment 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_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :delete_tensorboard_experiment, 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 + + ## + # Creates a TensorboardRun. + # + # @overload create_tensorboard_run(request, options = nil) + # Pass arguments to `create_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest, ::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_tensorboard_run(parent: nil, tensorboard_run: nil, tensorboard_run_id: nil) + # Pass arguments to `create_tensorboard_run` 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 TensorboardExperiment to create the + # TensorboardRun in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param tensorboard_run [::Google::Cloud::AIPlatform::V1::TensorboardRun, ::Hash] + # Required. The TensorboardRun to create. + # @param tensorboard_run_id [::String] + # Required. The ID to use for the Tensorboard run, which becomes the final + # component of the Tensorboard run's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest.new + # + # # Call the create_tensorboard_run method. + # result = client.create_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def create_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :create_tensorboard_run, 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 + + ## + # Batch create TensorboardRuns. + # + # @overload batch_create_tensorboard_runs(request, options = nil) + # Pass arguments to `batch_create_tensorboard_runs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest, ::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 batch_create_tensorboard_runs(parent: nil, requests: nil) + # Pass arguments to `batch_create_tensorboard_runs` 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 TensorboardExperiment to create the + # TensorboardRuns in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The parent field in the CreateTensorboardRunRequest messages must match + # this field. + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest, ::Hash>] + # Required. The request message specifying the TensorboardRuns to create. + # A maximum of 1000 TensorboardRuns can be created in a batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest.new + # + # # Call the batch_create_tensorboard_runs method. + # result = client.batch_create_tensorboard_runs request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse. + # p result + # + def batch_create_tensorboard_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest + + # 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.batch_create_tensorboard_runs.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.batch_create_tensorboard_runs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_tensorboard_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :batch_create_tensorboard_runs, 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 + + ## + # Gets a TensorboardRun. + # + # @overload get_tensorboard_run(request, options = nil) + # Pass arguments to `get_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest, ::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_tensorboard_run(name: nil) + # Pass arguments to `get_tensorboard_run` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardRun resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest.new + # + # # Call the get_tensorboard_run method. + # result = client.get_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def get_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :get_tensorboard_run, 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 + + ## + # Updates a TensorboardRun. + # + # @overload update_tensorboard_run(request, options = nil) + # Pass arguments to `update_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest, ::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_tensorboard_run(update_mask: nil, tensorboard_run: nil) + # Pass arguments to `update_tensorboard_run` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardRun resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_run [::Google::Cloud::AIPlatform::V1::TensorboardRun, ::Hash] + # Required. The TensorboardRun's `name` field is used to identify the + # TensorboardRun to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest.new + # + # # Call the update_tensorboard_run method. + # result = client.update_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def update_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest + + # 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_tensorboard_run.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.tensorboard_run&.name + header_params["tensorboard_run.name"] = request.tensorboard_run.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_tensorboard_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :update_tensorboard_run, 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 TensorboardRuns in a Location. + # + # @overload list_tensorboard_runs(request, options = nil) + # Pass arguments to `list_tensorboard_runs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest, ::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_tensorboard_runs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_runs` 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 TensorboardExperiment to list + # TensorboardRuns. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param filter [::String] + # Lists the TensorboardRuns that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardRuns to return. The service may return + # fewer than this value. If unspecified, at most 50 TensorboardRuns are + # returned. The maximum value is 1000; values above 1000 are coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest.new + # + # # Call the list_tensorboard_runs method. + # result = client.list_tensorboard_runs 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::TensorboardRun. + # p item + # end + # + def list_tensorboard_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest + + # 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_tensorboard_runs.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_tensorboard_runs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tensorboard_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :list_tensorboard_runs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_runs, 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 + + ## + # Deletes a TensorboardRun. + # + # @overload delete_tensorboard_run(request, options = nil) + # Pass arguments to `delete_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest, ::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_tensorboard_run(name: nil) + # Pass arguments to `delete_tensorboard_run` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardRun to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest.new + # + # # Call the delete_tensorboard_run method. + # result = client.delete_tensorboard_run 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_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :delete_tensorboard_run, 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 + + ## + # Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + # + # @overload batch_create_tensorboard_time_series(request, options = nil) + # Pass arguments to `batch_create_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest, ::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 batch_create_tensorboard_time_series(parent: nil, requests: nil) + # Pass arguments to `batch_create_tensorboard_time_series` 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 TensorboardExperiment to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The TensorboardRuns referenced by the parent fields in the + # CreateTensorboardTimeSeriesRequest messages must be sub resources of this + # TensorboardExperiment. + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest, ::Hash>] + # Required. The request message specifying the TensorboardTimeSeries to + # create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest.new + # + # # Call the batch_create_tensorboard_time_series method. + # result = client.batch_create_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse. + # p result + # + def batch_create_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest + + # 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.batch_create_tensorboard_time_series.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.batch_create_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :batch_create_tensorboard_time_series, 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 + + ## + # Creates a TensorboardTimeSeries. + # + # @overload create_tensorboard_time_series(request, options = nil) + # Pass arguments to `create_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(parent: nil, tensorboard_time_series_id: nil, tensorboard_time_series: nil) + # Pass arguments to `create_tensorboard_time_series` 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 TensorboardRun to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param tensorboard_time_series_id [::String] + # Optional. The user specified unique ID to use for the + # TensorboardTimeSeries, which becomes the final component of the + # TensorboardTimeSeries's resource name. This value should match + # "[a-z0-9][a-z0-9-]\\{0, 127}" + # @param tensorboard_time_series [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries, ::Hash] + # Required. The TensorboardTimeSeries to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest.new + # + # # Call the create_tensorboard_time_series method. + # result = client.create_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def create_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :create_tensorboard_time_series, 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 + + ## + # Gets a TensorboardTimeSeries. + # + # @overload get_tensorboard_time_series(request, options = nil) + # Pass arguments to `get_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(name: nil) + # Pass arguments to `get_tensorboard_time_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardTimeSeries resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest.new + # + # # Call the get_tensorboard_time_series method. + # result = client.get_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def get_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :get_tensorboard_time_series, 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 + + ## + # Updates a TensorboardTimeSeries. + # + # @overload update_tensorboard_time_series(request, options = nil) + # Pass arguments to `update_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(update_mask: nil, tensorboard_time_series: nil) + # Pass arguments to `update_tensorboard_time_series` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardTimeSeries resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_time_series [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries, ::Hash] + # Required. The TensorboardTimeSeries' `name` field is used to identify the + # TensorboardTimeSeries to be updated. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest.new + # + # # Call the update_tensorboard_time_series method. + # result = client.update_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def update_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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.tensorboard_time_series&.name + header_params["tensorboard_time_series.name"] = request.tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :update_tensorboard_time_series, 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 TensorboardTimeSeries in a Location. + # + # @overload list_tensorboard_time_series(request, options = nil) + # Pass arguments to `list_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_time_series` 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 TensorboardRun to list + # TensorboardTimeSeries. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param filter [::String] + # Lists the TensorboardTimeSeries that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardTimeSeries to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardTimeSeries are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest.new + # + # # Call the list_tensorboard_time_series method. + # result = client.list_tensorboard_time_series 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::TensorboardTimeSeries. + # p item + # end + # + def list_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :list_tensorboard_time_series, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_time_series, 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 + + ## + # Deletes a TensorboardTimeSeries. + # + # @overload delete_tensorboard_time_series(request, options = nil) + # Pass arguments to `delete_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(name: nil) + # Pass arguments to `delete_tensorboard_time_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardTimeSeries to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest.new + # + # # Call the delete_tensorboard_time_series method. + # result = client.delete_tensorboard_time_series 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_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :delete_tensorboard_time_series, 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 + + ## + # Reads multiple TensorboardTimeSeries' data. The data point number limit is + # 1000 for scalars, 100 for tensors and blob references. If the number of + # data points stored is less than the limit, all data is returned. + # Otherwise, the number limit of data points is randomly selected from + # this time series and returned. + # + # @overload batch_read_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `batch_read_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest, ::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 batch_read_tensorboard_time_series_data(tensorboard: nil, time_series: nil) + # Pass arguments to `batch_read_tensorboard_time_series_data` 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 tensorboard [::String] + # Required. The resource name of the Tensorboard containing + # TensorboardTimeSeries to read data from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + # The TensorboardTimeSeries referenced by + # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest#time_series time_series} + # must be sub resources of this Tensorboard. + # @param time_series [::Array<::String>] + # Required. The resource names of the TensorboardTimeSeries to read data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest.new + # + # # Call the batch_read_tensorboard_time_series_data method. + # result = client.batch_read_tensorboard_time_series_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse. + # p result + # + def batch_read_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest + + # 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.batch_read_tensorboard_time_series_data.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.tensorboard + header_params["tensorboard"] = request.tensorboard + 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.batch_read_tensorboard_time_series_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_read_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :batch_read_tensorboard_time_series_data, 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 + + ## + # Reads a TensorboardTimeSeries' data. By default, if the number of data + # points stored is less than 1000, all data is returned. Otherwise, 1000 + # data points is randomly selected from this time series and returned. + # This value can be changed by changing max_data_points, which can't be + # greater than 10k. + # + # @overload read_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `read_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest, ::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 read_tensorboard_time_series_data(tensorboard_time_series: nil, max_data_points: nil, filter: nil) + # Pass arguments to `read_tensorboard_time_series_data` 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 tensorboard_time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to read data from. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param max_data_points [::Integer] + # The maximum number of TensorboardTimeSeries' data to return. + # + # This value should be a positive integer. + # This value can be set to -1 to return all data. + # @param filter [::String] + # Reads the TensorboardTimeSeries' data that match the filter expression. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest.new + # + # # Call the read_tensorboard_time_series_data method. + # result = client.read_tensorboard_time_series_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse. + # p result + # + def read_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest + + # 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.read_tensorboard_time_series_data.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.tensorboard_time_series + header_params["tensorboard_time_series"] = request.tensorboard_time_series + 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.read_tensorboard_time_series_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :read_tensorboard_time_series_data, 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 + + ## + # Gets bytes of TensorboardBlobs. + # This is to allow reading blob data stored in consumer project's Cloud + # Storage bucket without users having to obtain Cloud Storage access + # permission. + # + # @overload read_tensorboard_blob_data(request, options = nil) + # Pass arguments to `read_tensorboard_blob_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest, ::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 read_tensorboard_blob_data(time_series: nil, blob_ids: nil) + # Pass arguments to `read_tensorboard_blob_data` 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 time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to list Blobs. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param blob_ids [::Array<::String>] + # IDs of the blobs to read. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest.new + # + # # Call the read_tensorboard_blob_data method to start streaming. + # output = client.read_tensorboard_blob_data request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse + # output.each do |current_response| + # p current_response + # end + # + def read_tensorboard_blob_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest + + # 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.read_tensorboard_blob_data.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.time_series + header_params["time_series"] = request.time_series + 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.read_tensorboard_blob_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read_tensorboard_blob_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :read_tensorboard_blob_data, 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 + + ## + # Write time series data points of multiple TensorboardTimeSeries in multiple + # TensorboardRun's. If any data fail to be ingested, an error is returned. + # + # @overload write_tensorboard_experiment_data(request, options = nil) + # Pass arguments to `write_tensorboard_experiment_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest, ::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 write_tensorboard_experiment_data(tensorboard_experiment: nil, write_run_data_requests: nil) + # Pass arguments to `write_tensorboard_experiment_data` 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 tensorboard_experiment [::String] + # Required. The resource name of the TensorboardExperiment to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param write_run_data_requests [::Array<::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest, ::Hash>] + # Required. Requests containing per-run TensorboardTimeSeries data to write. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest.new + # + # # Call the write_tensorboard_experiment_data method. + # result = client.write_tensorboard_experiment_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse. + # p result + # + def write_tensorboard_experiment_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest + + # 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.write_tensorboard_experiment_data.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.tensorboard_experiment + header_params["tensorboard_experiment"] = request.tensorboard_experiment + 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.write_tensorboard_experiment_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write_tensorboard_experiment_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :write_tensorboard_experiment_data, 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 + + ## + # Write time series data points into multiple TensorboardTimeSeries under + # a TensorboardRun. If any data fail to be ingested, an error is returned. + # + # @overload write_tensorboard_run_data(request, options = nil) + # Pass arguments to `write_tensorboard_run_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest, ::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 write_tensorboard_run_data(tensorboard_run: nil, time_series_data: nil) + # Pass arguments to `write_tensorboard_run_data` 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 tensorboard_run [::String] + # Required. The resource name of the TensorboardRun to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param time_series_data [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData, ::Hash>] + # Required. The TensorboardTimeSeries data to write. + # Values with in a time series are indexed by their step value. + # Repeated writes to the same step will overwrite the existing value for that + # step. + # The upper limit of data points per write request is 5000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest.new + # + # # Call the write_tensorboard_run_data method. + # result = client.write_tensorboard_run_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse. + # p result + # + def write_tensorboard_run_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest + + # 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.write_tensorboard_run_data.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.tensorboard_run + header_params["tensorboard_run"] = request.tensorboard_run + 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.write_tensorboard_run_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write_tensorboard_run_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :write_tensorboard_run_data, 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 + + ## + # Exports a TensorboardTimeSeries' data. Data is returned in paginated + # responses. + # + # @overload export_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `export_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest, ::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 export_tensorboard_time_series_data(tensorboard_time_series: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `export_tensorboard_time_series_data` 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 tensorboard_time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to export data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param filter [::String] + # Exports the TensorboardTimeSeries' data that match the filter expression. + # @param page_size [::Integer] + # The maximum number of data points to return per page. + # The default page_size is 1000. Values must be between 1 and 10000. + # Values above 10000 are coerced to 10000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the TensorboardTimeSeries' data. + # By default, TensorboardTimeSeries' data is returned in a pseudo random + # order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # + # @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::TensorboardService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest.new + # + # # Call the export_tensorboard_time_series_data method. + # result = client.export_tensorboard_time_series_data 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::TimeSeriesDataPoint. + # p item + # end + # + def export_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest + + # 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.export_tensorboard_time_series_data.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.tensorboard_time_series + header_params["tensorboard_time_series"] = request.tensorboard_time_series + 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.export_tensorboard_time_series_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.call_rpc :export_tensorboard_time_series_data, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tensorboard_service_stub, :export_tensorboard_time_series_data, 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 + + ## + # Configuration class for the TensorboardService API. + # + # This class represents the configuration for TensorboardService, + # 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::TensorboardService::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_tensorboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::TensorboardService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tensorboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tensorboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the TensorboardService 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_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard + ## + # RPC-specific configuration for `get_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard + ## + # RPC-specific configuration for `update_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard + ## + # RPC-specific configuration for `list_tensorboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboards + ## + # RPC-specific configuration for `delete_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard + ## + # RPC-specific configuration for `read_tensorboard_usage` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_usage + ## + # RPC-specific configuration for `read_tensorboard_size` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_size + ## + # RPC-specific configuration for `create_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_experiment + ## + # RPC-specific configuration for `get_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_experiment + ## + # RPC-specific configuration for `update_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_experiment + ## + # RPC-specific configuration for `list_tensorboard_experiments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_experiments + ## + # RPC-specific configuration for `delete_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_experiment + ## + # RPC-specific configuration for `create_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_run + ## + # RPC-specific configuration for `batch_create_tensorboard_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_tensorboard_runs + ## + # RPC-specific configuration for `get_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_run + ## + # RPC-specific configuration for `update_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_run + ## + # RPC-specific configuration for `list_tensorboard_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_runs + ## + # RPC-specific configuration for `delete_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_run + ## + # RPC-specific configuration for `batch_create_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_tensorboard_time_series + ## + # RPC-specific configuration for `create_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_time_series + ## + # RPC-specific configuration for `get_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_time_series + ## + # RPC-specific configuration for `update_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_time_series + ## + # RPC-specific configuration for `list_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_time_series + ## + # RPC-specific configuration for `delete_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_time_series + ## + # RPC-specific configuration for `batch_read_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_read_tensorboard_time_series_data + ## + # RPC-specific configuration for `read_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_time_series_data + ## + # RPC-specific configuration for `read_tensorboard_blob_data` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_blob_data + ## + # RPC-specific configuration for `write_tensorboard_experiment_data` + # @return [::Gapic::Config::Method] + # + attr_reader :write_tensorboard_experiment_data + ## + # RPC-specific configuration for `write_tensorboard_run_data` + # @return [::Gapic::Config::Method] + # + attr_reader :write_tensorboard_run_data + ## + # RPC-specific configuration for `export_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_tensorboard_time_series_data + + # @private + def initialize parent_rpcs = nil + create_tensorboard_config = parent_rpcs.create_tensorboard if parent_rpcs.respond_to? :create_tensorboard + @create_tensorboard = ::Gapic::Config::Method.new create_tensorboard_config + get_tensorboard_config = parent_rpcs.get_tensorboard if parent_rpcs.respond_to? :get_tensorboard + @get_tensorboard = ::Gapic::Config::Method.new get_tensorboard_config + update_tensorboard_config = parent_rpcs.update_tensorboard if parent_rpcs.respond_to? :update_tensorboard + @update_tensorboard = ::Gapic::Config::Method.new update_tensorboard_config + list_tensorboards_config = parent_rpcs.list_tensorboards if parent_rpcs.respond_to? :list_tensorboards + @list_tensorboards = ::Gapic::Config::Method.new list_tensorboards_config + delete_tensorboard_config = parent_rpcs.delete_tensorboard if parent_rpcs.respond_to? :delete_tensorboard + @delete_tensorboard = ::Gapic::Config::Method.new delete_tensorboard_config + read_tensorboard_usage_config = parent_rpcs.read_tensorboard_usage if parent_rpcs.respond_to? :read_tensorboard_usage + @read_tensorboard_usage = ::Gapic::Config::Method.new read_tensorboard_usage_config + read_tensorboard_size_config = parent_rpcs.read_tensorboard_size if parent_rpcs.respond_to? :read_tensorboard_size + @read_tensorboard_size = ::Gapic::Config::Method.new read_tensorboard_size_config + create_tensorboard_experiment_config = parent_rpcs.create_tensorboard_experiment if parent_rpcs.respond_to? :create_tensorboard_experiment + @create_tensorboard_experiment = ::Gapic::Config::Method.new create_tensorboard_experiment_config + get_tensorboard_experiment_config = parent_rpcs.get_tensorboard_experiment if parent_rpcs.respond_to? :get_tensorboard_experiment + @get_tensorboard_experiment = ::Gapic::Config::Method.new get_tensorboard_experiment_config + update_tensorboard_experiment_config = parent_rpcs.update_tensorboard_experiment if parent_rpcs.respond_to? :update_tensorboard_experiment + @update_tensorboard_experiment = ::Gapic::Config::Method.new update_tensorboard_experiment_config + list_tensorboard_experiments_config = parent_rpcs.list_tensorboard_experiments if parent_rpcs.respond_to? :list_tensorboard_experiments + @list_tensorboard_experiments = ::Gapic::Config::Method.new list_tensorboard_experiments_config + delete_tensorboard_experiment_config = parent_rpcs.delete_tensorboard_experiment if parent_rpcs.respond_to? :delete_tensorboard_experiment + @delete_tensorboard_experiment = ::Gapic::Config::Method.new delete_tensorboard_experiment_config + create_tensorboard_run_config = parent_rpcs.create_tensorboard_run if parent_rpcs.respond_to? :create_tensorboard_run + @create_tensorboard_run = ::Gapic::Config::Method.new create_tensorboard_run_config + batch_create_tensorboard_runs_config = parent_rpcs.batch_create_tensorboard_runs if parent_rpcs.respond_to? :batch_create_tensorboard_runs + @batch_create_tensorboard_runs = ::Gapic::Config::Method.new batch_create_tensorboard_runs_config + get_tensorboard_run_config = parent_rpcs.get_tensorboard_run if parent_rpcs.respond_to? :get_tensorboard_run + @get_tensorboard_run = ::Gapic::Config::Method.new get_tensorboard_run_config + update_tensorboard_run_config = parent_rpcs.update_tensorboard_run if parent_rpcs.respond_to? :update_tensorboard_run + @update_tensorboard_run = ::Gapic::Config::Method.new update_tensorboard_run_config + list_tensorboard_runs_config = parent_rpcs.list_tensorboard_runs if parent_rpcs.respond_to? :list_tensorboard_runs + @list_tensorboard_runs = ::Gapic::Config::Method.new list_tensorboard_runs_config + delete_tensorboard_run_config = parent_rpcs.delete_tensorboard_run if parent_rpcs.respond_to? :delete_tensorboard_run + @delete_tensorboard_run = ::Gapic::Config::Method.new delete_tensorboard_run_config + batch_create_tensorboard_time_series_config = parent_rpcs.batch_create_tensorboard_time_series if parent_rpcs.respond_to? :batch_create_tensorboard_time_series + @batch_create_tensorboard_time_series = ::Gapic::Config::Method.new batch_create_tensorboard_time_series_config + create_tensorboard_time_series_config = parent_rpcs.create_tensorboard_time_series if parent_rpcs.respond_to? :create_tensorboard_time_series + @create_tensorboard_time_series = ::Gapic::Config::Method.new create_tensorboard_time_series_config + get_tensorboard_time_series_config = parent_rpcs.get_tensorboard_time_series if parent_rpcs.respond_to? :get_tensorboard_time_series + @get_tensorboard_time_series = ::Gapic::Config::Method.new get_tensorboard_time_series_config + update_tensorboard_time_series_config = parent_rpcs.update_tensorboard_time_series if parent_rpcs.respond_to? :update_tensorboard_time_series + @update_tensorboard_time_series = ::Gapic::Config::Method.new update_tensorboard_time_series_config + list_tensorboard_time_series_config = parent_rpcs.list_tensorboard_time_series if parent_rpcs.respond_to? :list_tensorboard_time_series + @list_tensorboard_time_series = ::Gapic::Config::Method.new list_tensorboard_time_series_config + delete_tensorboard_time_series_config = parent_rpcs.delete_tensorboard_time_series if parent_rpcs.respond_to? :delete_tensorboard_time_series + @delete_tensorboard_time_series = ::Gapic::Config::Method.new delete_tensorboard_time_series_config + batch_read_tensorboard_time_series_data_config = parent_rpcs.batch_read_tensorboard_time_series_data if parent_rpcs.respond_to? :batch_read_tensorboard_time_series_data + @batch_read_tensorboard_time_series_data = ::Gapic::Config::Method.new batch_read_tensorboard_time_series_data_config + read_tensorboard_time_series_data_config = parent_rpcs.read_tensorboard_time_series_data if parent_rpcs.respond_to? :read_tensorboard_time_series_data + @read_tensorboard_time_series_data = ::Gapic::Config::Method.new read_tensorboard_time_series_data_config + read_tensorboard_blob_data_config = parent_rpcs.read_tensorboard_blob_data if parent_rpcs.respond_to? :read_tensorboard_blob_data + @read_tensorboard_blob_data = ::Gapic::Config::Method.new read_tensorboard_blob_data_config + write_tensorboard_experiment_data_config = parent_rpcs.write_tensorboard_experiment_data if parent_rpcs.respond_to? :write_tensorboard_experiment_data + @write_tensorboard_experiment_data = ::Gapic::Config::Method.new write_tensorboard_experiment_data_config + write_tensorboard_run_data_config = parent_rpcs.write_tensorboard_run_data if parent_rpcs.respond_to? :write_tensorboard_run_data + @write_tensorboard_run_data = ::Gapic::Config::Method.new write_tensorboard_run_data_config + export_tensorboard_time_series_data_config = parent_rpcs.export_tensorboard_time_series_data if parent_rpcs.respond_to? :export_tensorboard_time_series_data + @export_tensorboard_time_series_data = ::Gapic::Config::Method.new export_tensorboard_time_series_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/credentials.rb new file mode 100644 index 000000000000..25b83b0726d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/credentials.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + # Credentials for the TensorboardService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb new file mode 100644 index 000000000000..e905bdecbea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + # 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 TensorboardService 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 TensorboardService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/paths.rb new file mode 100644 index 000000000000..9a192d675dcd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/paths.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + # Path helper methods for the TensorboardService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Tensorboard resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # + # @param project [String] + # @param location [String] + # @param tensorboard [String] + # + # @return [::String] + def tensorboard_path project:, location:, tensorboard: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorboards/#{tensorboard}" + end + + ## + # Create a fully-qualified TensorboardExperiment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # + # @param project [String] + # @param location [String] + # @param tensorboard [String] + # @param experiment [String] + # + # @return [::String] + def tensorboard_experiment_path project:, location:, tensorboard:, experiment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "tensorboard cannot contain /" if tensorboard.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorboards/#{tensorboard}/experiments/#{experiment}" + end + + ## + # Create a fully-qualified TensorboardRun resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # + # @param project [String] + # @param location [String] + # @param tensorboard [String] + # @param experiment [String] + # @param run [String] + # + # @return [::String] + def tensorboard_run_path project:, location:, tensorboard:, experiment:, run: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "tensorboard cannot contain /" if tensorboard.to_s.include? "/" + raise ::ArgumentError, "experiment cannot contain /" if experiment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorboards/#{tensorboard}/experiments/#{experiment}/runs/#{run}" + end + + ## + # Create a fully-qualified TensorboardTimeSeries resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # + # @param project [String] + # @param location [String] + # @param tensorboard [String] + # @param experiment [String] + # @param run [String] + # @param time_series [String] + # + # @return [::String] + def tensorboard_time_series_path project:, location:, tensorboard:, experiment:, run:, time_series: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "tensorboard cannot contain /" if tensorboard.to_s.include? "/" + raise ::ArgumentError, "experiment cannot contain /" if experiment.to_s.include? "/" + raise ::ArgumentError, "run cannot contain /" if run.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorboards/#{tensorboard}/experiments/#{experiment}/runs/#{run}/timeSeries/#{time_series}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb new file mode 100644 index 000000000000..52794d6120cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/tensorboard_service/credentials" +require "google/cloud/ai_platform/v1/tensorboard_service/paths" +require "google/cloud/ai_platform/v1/tensorboard_service/rest/operations" +require "google/cloud/ai_platform/v1/tensorboard_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # TensorboardService + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/tensorboard_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.new + # + module TensorboardService + # 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/tensorboard_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb new file mode 100644 index 000000000000..93f9367e6329 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb @@ -0,0 +1,3284 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/tensorboard_service_pb" +require "google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + module Rest + ## + # REST client for the TensorboardService service. + # + # TensorboardService + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tensorboard_service_stub + + ## + # Configure the TensorboardService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TensorboardService clients + # ::Google::Cloud::AIPlatform::V1::TensorboardService::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 TensorboardService 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::TensorboardService::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 + @tensorboard_service_stub.universe_domain + end + + ## + # Create a new TensorboardService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TensorboardService 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::TensorboardService::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 + + @tensorboard_service_stub = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tensorboard_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 = @tensorboard_service_stub.endpoint + config.universe_domain = @tensorboard_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @tensorboard_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 = @tensorboard_service_stub.endpoint + config.universe_domain = @tensorboard_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @tensorboard_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardService::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 + @tensorboard_service_stub.logger + end + + # Service calls + + ## + # Creates a Tensorboard. + # + # @overload create_tensorboard(request, options = nil) + # Pass arguments to `create_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest, ::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_tensorboard(parent: nil, tensorboard: nil) + # Pass arguments to `create_tensorboard` 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 Tensorboard in. + # Format: `projects/{project}/locations/{location}` + # @param tensorboard [::Google::Cloud::AIPlatform::V1::Tensorboard, ::Hash] + # Required. The Tensorboard 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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardRequest.new + # + # # Call the create_tensorboard method. + # result = client.create_tensorboard 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_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.create_tensorboard request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Tensorboard. + # + # @overload get_tensorboard(request, options = nil) + # Pass arguments to `get_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardRequest, ::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_tensorboard(name: nil) + # Pass arguments to `get_tensorboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Tensorboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardRequest.new + # + # # Call the get_tensorboard method. + # result = client.get_tensorboard request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Tensorboard. + # p result + # + def get_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.get_tensorboard 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 + + ## + # Updates a Tensorboard. + # + # @overload update_tensorboard(request, options = nil) + # Pass arguments to `update_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest, ::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_tensorboard(update_mask: nil, tensorboard: nil) + # Pass arguments to `update_tensorboard` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Tensorboard resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard [::Google::Cloud::AIPlatform::V1::Tensorboard, ::Hash] + # Required. The Tensorboard's `name` field is used to identify the + # Tensorboard to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest.new + # + # # Call the update_tensorboard method. + # result = client.update_tensorboard request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.update_tensorboard 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 Tensorboards in a Location. + # + # @overload list_tensorboards(request, options = nil) + # Pass arguments to `list_tensorboards` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest, ::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_tensorboards(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboards` 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 Tensorboards. + # Format: + # `projects/{project}/locations/{location}` + # @param filter [::String] + # Lists the Tensorboards that match the filter expression. + # @param page_size [::Integer] + # The maximum number of Tensorboards to return. The service may return + # fewer than this value. If unspecified, at most 100 Tensorboards are + # returned. The maximum value is 100; values above 100 are coerced to + # 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboards TensorboardService.ListTensorboards} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboards TensorboardService.ListTensorboards} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Tensorboard>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Tensorboard>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardsRequest.new + # + # # Call the list_tensorboards method. + # result = client.list_tensorboards 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::Tensorboard. + # p item + # end + # + def list_tensorboards request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest + + # 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_tensorboards.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_tensorboards.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tensorboards.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.list_tensorboards request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboards, "tensorboards", 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 + + ## + # Deletes a Tensorboard. + # + # @overload delete_tensorboard(request, options = nil) + # Pass arguments to `delete_tensorboard` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest, ::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_tensorboard(name: nil) + # Pass arguments to `delete_tensorboard` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Tensorboard to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest.new + # + # # Call the delete_tensorboard method. + # result = client.delete_tensorboard 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_tensorboard request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest + + # 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_tensorboard.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_tensorboard.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tensorboard.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.delete_tensorboard 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 + + ## + # Returns a list of monthly active users for a given TensorBoard instance. + # + # @overload read_tensorboard_usage(request, options = nil) + # Pass arguments to `read_tensorboard_usage` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest, ::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 read_tensorboard_usage(tensorboard: nil) + # Pass arguments to `read_tensorboard_usage` 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 tensorboard [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest.new + # + # # Call the read_tensorboard_usage method. + # result = client.read_tensorboard_usage request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse. + # p result + # + def read_tensorboard_usage request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest + + # 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.read_tensorboard_usage.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.read_tensorboard_usage.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_tensorboard_usage.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.read_tensorboard_usage 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 + + ## + # Returns the storage size for a given TensorBoard instance. + # + # @overload read_tensorboard_size(request, options = nil) + # Pass arguments to `read_tensorboard_size` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest, ::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 read_tensorboard_size(tensorboard: nil) + # Pass arguments to `read_tensorboard_size` 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 tensorboard [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest.new + # + # # Call the read_tensorboard_size method. + # result = client.read_tensorboard_size request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse. + # p result + # + def read_tensorboard_size request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest + + # 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.read_tensorboard_size.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.read_tensorboard_size.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_tensorboard_size.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.read_tensorboard_size 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 + + ## + # Creates a TensorboardExperiment. + # + # @overload create_tensorboard_experiment(request, options = nil) + # Pass arguments to `create_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest, ::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_tensorboard_experiment(parent: nil, tensorboard_experiment: nil, tensorboard_experiment_id: nil) + # Pass arguments to `create_tensorboard_experiment` 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 Tensorboard to create the + # TensorboardExperiment in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @param tensorboard_experiment [::Google::Cloud::AIPlatform::V1::TensorboardExperiment, ::Hash] + # The TensorboardExperiment to create. + # @param tensorboard_experiment_id [::String] + # Required. The ID to use for the Tensorboard experiment, which becomes the + # final component of the Tensorboard experiment's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest.new + # + # # Call the create_tensorboard_experiment method. + # result = client.create_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def create_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.create_tensorboard_experiment 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 + + ## + # Gets a TensorboardExperiment. + # + # @overload get_tensorboard_experiment(request, options = nil) + # Pass arguments to `get_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest, ::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_tensorboard_experiment(name: nil) + # Pass arguments to `get_tensorboard_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardExperiment resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest.new + # + # # Call the get_tensorboard_experiment method. + # result = client.get_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def get_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.get_tensorboard_experiment 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 + + ## + # Updates a TensorboardExperiment. + # + # @overload update_tensorboard_experiment(request, options = nil) + # Pass arguments to `update_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest, ::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_tensorboard_experiment(update_mask: nil, tensorboard_experiment: nil) + # Pass arguments to `update_tensorboard_experiment` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardExperiment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_experiment [::Google::Cloud::AIPlatform::V1::TensorboardExperiment, ::Hash] + # Required. The TensorboardExperiment's `name` field is used to identify the + # TensorboardExperiment to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest.new + # + # # Call the update_tensorboard_experiment method. + # result = client.update_tensorboard_experiment request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + # p result + # + def update_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.update_tensorboard_experiment 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 TensorboardExperiments in a Location. + # + # @overload list_tensorboard_experiments(request, options = nil) + # Pass arguments to `list_tensorboard_experiments` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest, ::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_tensorboard_experiments(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_experiments` 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 Tensorboard to list + # TensorboardExperiments. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @param filter [::String] + # Lists the TensorboardExperiments that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardExperiments to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardExperiments are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest.new + # + # # Call the list_tensorboard_experiments method. + # result = client.list_tensorboard_experiments 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::TensorboardExperiment. + # p item + # end + # + def list_tensorboard_experiments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest + + # 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_tensorboard_experiments.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_tensorboard_experiments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tensorboard_experiments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.list_tensorboard_experiments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_experiments, "tensorboard_experiments", 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 + + ## + # Deletes a TensorboardExperiment. + # + # @overload delete_tensorboard_experiment(request, options = nil) + # Pass arguments to `delete_tensorboard_experiment` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest, ::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_tensorboard_experiment(name: nil) + # Pass arguments to `delete_tensorboard_experiment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardExperiment to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest.new + # + # # Call the delete_tensorboard_experiment method. + # result = client.delete_tensorboard_experiment 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_tensorboard_experiment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest + + # 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_tensorboard_experiment.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_tensorboard_experiment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tensorboard_experiment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.delete_tensorboard_experiment 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 + + ## + # Creates a TensorboardRun. + # + # @overload create_tensorboard_run(request, options = nil) + # Pass arguments to `create_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest, ::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_tensorboard_run(parent: nil, tensorboard_run: nil, tensorboard_run_id: nil) + # Pass arguments to `create_tensorboard_run` 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 TensorboardExperiment to create the + # TensorboardRun in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param tensorboard_run [::Google::Cloud::AIPlatform::V1::TensorboardRun, ::Hash] + # Required. The TensorboardRun to create. + # @param tensorboard_run_id [::String] + # Required. The ID to use for the Tensorboard run, which becomes the final + # component of the Tensorboard run's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest.new + # + # # Call the create_tensorboard_run method. + # result = client.create_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def create_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.create_tensorboard_run 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 + + ## + # Batch create TensorboardRuns. + # + # @overload batch_create_tensorboard_runs(request, options = nil) + # Pass arguments to `batch_create_tensorboard_runs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest, ::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 batch_create_tensorboard_runs(parent: nil, requests: nil) + # Pass arguments to `batch_create_tensorboard_runs` 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 TensorboardExperiment to create the + # TensorboardRuns in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The parent field in the CreateTensorboardRunRequest messages must match + # this field. + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest, ::Hash>] + # Required. The request message specifying the TensorboardRuns to create. + # A maximum of 1000 TensorboardRuns can be created in a batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest.new + # + # # Call the batch_create_tensorboard_runs method. + # result = client.batch_create_tensorboard_runs request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse. + # p result + # + def batch_create_tensorboard_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest + + # 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.batch_create_tensorboard_runs.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.batch_create_tensorboard_runs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_tensorboard_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.batch_create_tensorboard_runs 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 + + ## + # Gets a TensorboardRun. + # + # @overload get_tensorboard_run(request, options = nil) + # Pass arguments to `get_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest, ::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_tensorboard_run(name: nil) + # Pass arguments to `get_tensorboard_run` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardRun resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest.new + # + # # Call the get_tensorboard_run method. + # result = client.get_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def get_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.get_tensorboard_run 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 + + ## + # Updates a TensorboardRun. + # + # @overload update_tensorboard_run(request, options = nil) + # Pass arguments to `update_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest, ::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_tensorboard_run(update_mask: nil, tensorboard_run: nil) + # Pass arguments to `update_tensorboard_run` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardRun resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_run [::Google::Cloud::AIPlatform::V1::TensorboardRun, ::Hash] + # Required. The TensorboardRun's `name` field is used to identify the + # TensorboardRun to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest.new + # + # # Call the update_tensorboard_run method. + # result = client.update_tensorboard_run request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + # p result + # + def update_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.update_tensorboard_run 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 TensorboardRuns in a Location. + # + # @overload list_tensorboard_runs(request, options = nil) + # Pass arguments to `list_tensorboard_runs` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest, ::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_tensorboard_runs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_runs` 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 TensorboardExperiment to list + # TensorboardRuns. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param filter [::String] + # Lists the TensorboardRuns that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardRuns to return. The service may return + # fewer than this value. If unspecified, at most 50 TensorboardRuns are + # returned. The maximum value is 1000; values above 1000 are coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest.new + # + # # Call the list_tensorboard_runs method. + # result = client.list_tensorboard_runs 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::TensorboardRun. + # p item + # end + # + def list_tensorboard_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest + + # 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_tensorboard_runs.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_tensorboard_runs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tensorboard_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.list_tensorboard_runs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_runs, "tensorboard_runs", 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 + + ## + # Deletes a TensorboardRun. + # + # @overload delete_tensorboard_run(request, options = nil) + # Pass arguments to `delete_tensorboard_run` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest, ::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_tensorboard_run(name: nil) + # Pass arguments to `delete_tensorboard_run` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardRun to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest.new + # + # # Call the delete_tensorboard_run method. + # result = client.delete_tensorboard_run 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_tensorboard_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest + + # 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_tensorboard_run.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_tensorboard_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tensorboard_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.delete_tensorboard_run 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 + + ## + # Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + # + # @overload batch_create_tensorboard_time_series(request, options = nil) + # Pass arguments to `batch_create_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest, ::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 batch_create_tensorboard_time_series(parent: nil, requests: nil) + # Pass arguments to `batch_create_tensorboard_time_series` 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 TensorboardExperiment to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The TensorboardRuns referenced by the parent fields in the + # CreateTensorboardTimeSeriesRequest messages must be sub resources of this + # TensorboardExperiment. + # @param requests [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest, ::Hash>] + # Required. The request message specifying the TensorboardTimeSeries to + # create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest.new + # + # # Call the batch_create_tensorboard_time_series method. + # result = client.batch_create_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse. + # p result + # + def batch_create_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest + + # 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.batch_create_tensorboard_time_series.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.batch_create_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.batch_create_tensorboard_time_series 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 + + ## + # Creates a TensorboardTimeSeries. + # + # @overload create_tensorboard_time_series(request, options = nil) + # Pass arguments to `create_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(parent: nil, tensorboard_time_series_id: nil, tensorboard_time_series: nil) + # Pass arguments to `create_tensorboard_time_series` 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 TensorboardRun to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param tensorboard_time_series_id [::String] + # Optional. The user specified unique ID to use for the + # TensorboardTimeSeries, which becomes the final component of the + # TensorboardTimeSeries's resource name. This value should match + # "[a-z0-9][a-z0-9-]\\{0, 127}" + # @param tensorboard_time_series [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries, ::Hash] + # Required. The TensorboardTimeSeries to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest.new + # + # # Call the create_tensorboard_time_series method. + # result = client.create_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def create_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.create_tensorboard_time_series 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 + + ## + # Gets a TensorboardTimeSeries. + # + # @overload get_tensorboard_time_series(request, options = nil) + # Pass arguments to `get_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(name: nil) + # Pass arguments to `get_tensorboard_time_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardTimeSeries resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest.new + # + # # Call the get_tensorboard_time_series method. + # result = client.get_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def get_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.get_tensorboard_time_series 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 + + ## + # Updates a TensorboardTimeSeries. + # + # @overload update_tensorboard_time_series(request, options = nil) + # Pass arguments to `update_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(update_mask: nil, tensorboard_time_series: nil) + # Pass arguments to `update_tensorboard_time_series` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardTimeSeries resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @param tensorboard_time_series [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries, ::Hash] + # Required. The TensorboardTimeSeries' `name` field is used to identify the + # TensorboardTimeSeries to be updated. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest.new + # + # # Call the update_tensorboard_time_series method. + # result = client.update_tensorboard_time_series request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + # p result + # + def update_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.update_tensorboard_time_series 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 TensorboardTimeSeries in a Location. + # + # @overload list_tensorboard_time_series(request, options = nil) + # Pass arguments to `list_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil) + # Pass arguments to `list_tensorboard_time_series` 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 TensorboardRun to list + # TensorboardTimeSeries. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param filter [::String] + # Lists the TensorboardTimeSeries that match the filter expression. + # @param page_size [::Integer] + # The maximum number of TensorboardTimeSeries to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardTimeSeries are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the list. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask specifying which fields to read. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest.new + # + # # Call the list_tensorboard_time_series method. + # result = client.list_tensorboard_time_series 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::TensorboardTimeSeries. + # p item + # end + # + def list_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.list_tensorboard_time_series request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tensorboard_service_stub, :list_tensorboard_time_series, "tensorboard_time_series", 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 + + ## + # Deletes a TensorboardTimeSeries. + # + # @overload delete_tensorboard_time_series(request, options = nil) + # Pass arguments to `delete_tensorboard_time_series` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest, ::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_tensorboard_time_series(name: nil) + # Pass arguments to `delete_tensorboard_time_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the TensorboardTimeSeries to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest.new + # + # # Call the delete_tensorboard_time_series method. + # result = client.delete_tensorboard_time_series 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_tensorboard_time_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest + + # 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_tensorboard_time_series.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_tensorboard_time_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tensorboard_time_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.delete_tensorboard_time_series 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 + + ## + # Reads multiple TensorboardTimeSeries' data. The data point number limit is + # 1000 for scalars, 100 for tensors and blob references. If the number of + # data points stored is less than the limit, all data is returned. + # Otherwise, the number limit of data points is randomly selected from + # this time series and returned. + # + # @overload batch_read_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `batch_read_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest, ::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 batch_read_tensorboard_time_series_data(tensorboard: nil, time_series: nil) + # Pass arguments to `batch_read_tensorboard_time_series_data` 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 tensorboard [::String] + # Required. The resource name of the Tensorboard containing + # TensorboardTimeSeries to read data from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + # The TensorboardTimeSeries referenced by + # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest#time_series time_series} + # must be sub resources of this Tensorboard. + # @param time_series [::Array<::String>] + # Required. The resource names of the TensorboardTimeSeries to read data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest.new + # + # # Call the batch_read_tensorboard_time_series_data method. + # result = client.batch_read_tensorboard_time_series_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse. + # p result + # + def batch_read_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest + + # 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.batch_read_tensorboard_time_series_data.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.batch_read_tensorboard_time_series_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_read_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.batch_read_tensorboard_time_series_data 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 + + ## + # Reads a TensorboardTimeSeries' data. By default, if the number of data + # points stored is less than 1000, all data is returned. Otherwise, 1000 + # data points is randomly selected from this time series and returned. + # This value can be changed by changing max_data_points, which can't be + # greater than 10k. + # + # @overload read_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `read_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest, ::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 read_tensorboard_time_series_data(tensorboard_time_series: nil, max_data_points: nil, filter: nil) + # Pass arguments to `read_tensorboard_time_series_data` 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 tensorboard_time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to read data from. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param max_data_points [::Integer] + # The maximum number of TensorboardTimeSeries' data to return. + # + # This value should be a positive integer. + # This value can be set to -1 to return all data. + # @param filter [::String] + # Reads the TensorboardTimeSeries' data that match the filter expression. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest.new + # + # # Call the read_tensorboard_time_series_data method. + # result = client.read_tensorboard_time_series_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse. + # p result + # + def read_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest + + # 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.read_tensorboard_time_series_data.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.read_tensorboard_time_series_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.read_tensorboard_time_series_data 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 + + ## + # Gets bytes of TensorboardBlobs. + # This is to allow reading blob data stored in consumer project's Cloud + # Storage bucket without users having to obtain Cloud Storage access + # permission. + # + # @overload read_tensorboard_blob_data(request, options = nil) + # Pass arguments to `read_tensorboard_blob_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest, ::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 read_tensorboard_blob_data(time_series: nil, blob_ids: nil) + # Pass arguments to `read_tensorboard_blob_data` 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 time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to list Blobs. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param blob_ids [::Array<::String>] + # IDs of the blobs to read. + # @return [::Enumerable<::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest.new + # + # # Call the read_tensorboard_blob_data method to start streaming. + # output = client.read_tensorboard_blob_data request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse + # output.each do |current_response| + # p current_response + # end + # + def read_tensorboard_blob_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest + + # 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.read_tensorboard_blob_data.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.read_tensorboard_blob_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.read_tensorboard_blob_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @tensorboard_service_stub.read_tensorboard_blob_data request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Write time series data points of multiple TensorboardTimeSeries in multiple + # TensorboardRun's. If any data fail to be ingested, an error is returned. + # + # @overload write_tensorboard_experiment_data(request, options = nil) + # Pass arguments to `write_tensorboard_experiment_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest, ::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 write_tensorboard_experiment_data(tensorboard_experiment: nil, write_run_data_requests: nil) + # Pass arguments to `write_tensorboard_experiment_data` 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 tensorboard_experiment [::String] + # Required. The resource name of the TensorboardExperiment to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @param write_run_data_requests [::Array<::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest, ::Hash>] + # Required. Requests containing per-run TensorboardTimeSeries data to write. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest.new + # + # # Call the write_tensorboard_experiment_data method. + # result = client.write_tensorboard_experiment_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse. + # p result + # + def write_tensorboard_experiment_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest + + # 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.write_tensorboard_experiment_data.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.write_tensorboard_experiment_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.write_tensorboard_experiment_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.write_tensorboard_experiment_data 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 + + ## + # Write time series data points into multiple TensorboardTimeSeries under + # a TensorboardRun. If any data fail to be ingested, an error is returned. + # + # @overload write_tensorboard_run_data(request, options = nil) + # Pass arguments to `write_tensorboard_run_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest, ::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 write_tensorboard_run_data(tensorboard_run: nil, time_series_data: nil) + # Pass arguments to `write_tensorboard_run_data` 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 tensorboard_run [::String] + # Required. The resource name of the TensorboardRun to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @param time_series_data [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData, ::Hash>] + # Required. The TensorboardTimeSeries data to write. + # Values with in a time series are indexed by their step value. + # Repeated writes to the same step will overwrite the existing value for that + # step. + # The upper limit of data points per write request is 5000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest.new + # + # # Call the write_tensorboard_run_data method. + # result = client.write_tensorboard_run_data request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse. + # p result + # + def write_tensorboard_run_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest + + # 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.write_tensorboard_run_data.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.write_tensorboard_run_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.write_tensorboard_run_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.write_tensorboard_run_data 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 + + ## + # Exports a TensorboardTimeSeries' data. Data is returned in paginated + # responses. + # + # @overload export_tensorboard_time_series_data(request, options = nil) + # Pass arguments to `export_tensorboard_time_series_data` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest, ::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 export_tensorboard_time_series_data(tensorboard_time_series: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `export_tensorboard_time_series_data` 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 tensorboard_time_series [::String] + # Required. The resource name of the TensorboardTimeSeries to export data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @param filter [::String] + # Exports the TensorboardTimeSeries' data that match the filter expression. + # @param page_size [::Integer] + # The maximum number of data points to return per page. + # The default page_size is 1000. Values must be between 1 and 10000. + # Values above 10000 are coerced to 10000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # must match the call that provided the page token. + # @param order_by [::String] + # Field to use to sort the TensorboardTimeSeries' data. + # By default, TensorboardTimeSeries' data is returned in a pseudo random + # order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # + # @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::TensorboardService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest.new + # + # # Call the export_tensorboard_time_series_data method. + # result = client.export_tensorboard_time_series_data 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::TimeSeriesDataPoint. + # p item + # end + # + def export_tensorboard_time_series_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest + + # 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.export_tensorboard_time_series_data.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.export_tensorboard_time_series_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_tensorboard_time_series_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tensorboard_service_stub.export_tensorboard_time_series_data request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tensorboard_service_stub, :export_tensorboard_time_series_data, "time_series_data_points", 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 + + ## + # Configuration class for the TensorboardService REST API. + # + # This class represents the configuration for TensorboardService 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::TensorboardService::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_tensorboard to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tensorboard.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tensorboard.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the TensorboardService 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_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard + ## + # RPC-specific configuration for `get_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard + ## + # RPC-specific configuration for `update_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard + ## + # RPC-specific configuration for `list_tensorboards` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboards + ## + # RPC-specific configuration for `delete_tensorboard` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard + ## + # RPC-specific configuration for `read_tensorboard_usage` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_usage + ## + # RPC-specific configuration for `read_tensorboard_size` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_size + ## + # RPC-specific configuration for `create_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_experiment + ## + # RPC-specific configuration for `get_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_experiment + ## + # RPC-specific configuration for `update_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_experiment + ## + # RPC-specific configuration for `list_tensorboard_experiments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_experiments + ## + # RPC-specific configuration for `delete_tensorboard_experiment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_experiment + ## + # RPC-specific configuration for `create_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_run + ## + # RPC-specific configuration for `batch_create_tensorboard_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_tensorboard_runs + ## + # RPC-specific configuration for `get_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_run + ## + # RPC-specific configuration for `update_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_run + ## + # RPC-specific configuration for `list_tensorboard_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_runs + ## + # RPC-specific configuration for `delete_tensorboard_run` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_run + ## + # RPC-specific configuration for `batch_create_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_tensorboard_time_series + ## + # RPC-specific configuration for `create_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tensorboard_time_series + ## + # RPC-specific configuration for `get_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensorboard_time_series + ## + # RPC-specific configuration for `update_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tensorboard_time_series + ## + # RPC-specific configuration for `list_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensorboard_time_series + ## + # RPC-specific configuration for `delete_tensorboard_time_series` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tensorboard_time_series + ## + # RPC-specific configuration for `batch_read_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_read_tensorboard_time_series_data + ## + # RPC-specific configuration for `read_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_time_series_data + ## + # RPC-specific configuration for `read_tensorboard_blob_data` + # @return [::Gapic::Config::Method] + # + attr_reader :read_tensorboard_blob_data + ## + # RPC-specific configuration for `write_tensorboard_experiment_data` + # @return [::Gapic::Config::Method] + # + attr_reader :write_tensorboard_experiment_data + ## + # RPC-specific configuration for `write_tensorboard_run_data` + # @return [::Gapic::Config::Method] + # + attr_reader :write_tensorboard_run_data + ## + # RPC-specific configuration for `export_tensorboard_time_series_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_tensorboard_time_series_data + + # @private + def initialize parent_rpcs = nil + create_tensorboard_config = parent_rpcs.create_tensorboard if parent_rpcs.respond_to? :create_tensorboard + @create_tensorboard = ::Gapic::Config::Method.new create_tensorboard_config + get_tensorboard_config = parent_rpcs.get_tensorboard if parent_rpcs.respond_to? :get_tensorboard + @get_tensorboard = ::Gapic::Config::Method.new get_tensorboard_config + update_tensorboard_config = parent_rpcs.update_tensorboard if parent_rpcs.respond_to? :update_tensorboard + @update_tensorboard = ::Gapic::Config::Method.new update_tensorboard_config + list_tensorboards_config = parent_rpcs.list_tensorboards if parent_rpcs.respond_to? :list_tensorboards + @list_tensorboards = ::Gapic::Config::Method.new list_tensorboards_config + delete_tensorboard_config = parent_rpcs.delete_tensorboard if parent_rpcs.respond_to? :delete_tensorboard + @delete_tensorboard = ::Gapic::Config::Method.new delete_tensorboard_config + read_tensorboard_usage_config = parent_rpcs.read_tensorboard_usage if parent_rpcs.respond_to? :read_tensorboard_usage + @read_tensorboard_usage = ::Gapic::Config::Method.new read_tensorboard_usage_config + read_tensorboard_size_config = parent_rpcs.read_tensorboard_size if parent_rpcs.respond_to? :read_tensorboard_size + @read_tensorboard_size = ::Gapic::Config::Method.new read_tensorboard_size_config + create_tensorboard_experiment_config = parent_rpcs.create_tensorboard_experiment if parent_rpcs.respond_to? :create_tensorboard_experiment + @create_tensorboard_experiment = ::Gapic::Config::Method.new create_tensorboard_experiment_config + get_tensorboard_experiment_config = parent_rpcs.get_tensorboard_experiment if parent_rpcs.respond_to? :get_tensorboard_experiment + @get_tensorboard_experiment = ::Gapic::Config::Method.new get_tensorboard_experiment_config + update_tensorboard_experiment_config = parent_rpcs.update_tensorboard_experiment if parent_rpcs.respond_to? :update_tensorboard_experiment + @update_tensorboard_experiment = ::Gapic::Config::Method.new update_tensorboard_experiment_config + list_tensorboard_experiments_config = parent_rpcs.list_tensorboard_experiments if parent_rpcs.respond_to? :list_tensorboard_experiments + @list_tensorboard_experiments = ::Gapic::Config::Method.new list_tensorboard_experiments_config + delete_tensorboard_experiment_config = parent_rpcs.delete_tensorboard_experiment if parent_rpcs.respond_to? :delete_tensorboard_experiment + @delete_tensorboard_experiment = ::Gapic::Config::Method.new delete_tensorboard_experiment_config + create_tensorboard_run_config = parent_rpcs.create_tensorboard_run if parent_rpcs.respond_to? :create_tensorboard_run + @create_tensorboard_run = ::Gapic::Config::Method.new create_tensorboard_run_config + batch_create_tensorboard_runs_config = parent_rpcs.batch_create_tensorboard_runs if parent_rpcs.respond_to? :batch_create_tensorboard_runs + @batch_create_tensorboard_runs = ::Gapic::Config::Method.new batch_create_tensorboard_runs_config + get_tensorboard_run_config = parent_rpcs.get_tensorboard_run if parent_rpcs.respond_to? :get_tensorboard_run + @get_tensorboard_run = ::Gapic::Config::Method.new get_tensorboard_run_config + update_tensorboard_run_config = parent_rpcs.update_tensorboard_run if parent_rpcs.respond_to? :update_tensorboard_run + @update_tensorboard_run = ::Gapic::Config::Method.new update_tensorboard_run_config + list_tensorboard_runs_config = parent_rpcs.list_tensorboard_runs if parent_rpcs.respond_to? :list_tensorboard_runs + @list_tensorboard_runs = ::Gapic::Config::Method.new list_tensorboard_runs_config + delete_tensorboard_run_config = parent_rpcs.delete_tensorboard_run if parent_rpcs.respond_to? :delete_tensorboard_run + @delete_tensorboard_run = ::Gapic::Config::Method.new delete_tensorboard_run_config + batch_create_tensorboard_time_series_config = parent_rpcs.batch_create_tensorboard_time_series if parent_rpcs.respond_to? :batch_create_tensorboard_time_series + @batch_create_tensorboard_time_series = ::Gapic::Config::Method.new batch_create_tensorboard_time_series_config + create_tensorboard_time_series_config = parent_rpcs.create_tensorboard_time_series if parent_rpcs.respond_to? :create_tensorboard_time_series + @create_tensorboard_time_series = ::Gapic::Config::Method.new create_tensorboard_time_series_config + get_tensorboard_time_series_config = parent_rpcs.get_tensorboard_time_series if parent_rpcs.respond_to? :get_tensorboard_time_series + @get_tensorboard_time_series = ::Gapic::Config::Method.new get_tensorboard_time_series_config + update_tensorboard_time_series_config = parent_rpcs.update_tensorboard_time_series if parent_rpcs.respond_to? :update_tensorboard_time_series + @update_tensorboard_time_series = ::Gapic::Config::Method.new update_tensorboard_time_series_config + list_tensorboard_time_series_config = parent_rpcs.list_tensorboard_time_series if parent_rpcs.respond_to? :list_tensorboard_time_series + @list_tensorboard_time_series = ::Gapic::Config::Method.new list_tensorboard_time_series_config + delete_tensorboard_time_series_config = parent_rpcs.delete_tensorboard_time_series if parent_rpcs.respond_to? :delete_tensorboard_time_series + @delete_tensorboard_time_series = ::Gapic::Config::Method.new delete_tensorboard_time_series_config + batch_read_tensorboard_time_series_data_config = parent_rpcs.batch_read_tensorboard_time_series_data if parent_rpcs.respond_to? :batch_read_tensorboard_time_series_data + @batch_read_tensorboard_time_series_data = ::Gapic::Config::Method.new batch_read_tensorboard_time_series_data_config + read_tensorboard_time_series_data_config = parent_rpcs.read_tensorboard_time_series_data if parent_rpcs.respond_to? :read_tensorboard_time_series_data + @read_tensorboard_time_series_data = ::Gapic::Config::Method.new read_tensorboard_time_series_data_config + read_tensorboard_blob_data_config = parent_rpcs.read_tensorboard_blob_data if parent_rpcs.respond_to? :read_tensorboard_blob_data + @read_tensorboard_blob_data = ::Gapic::Config::Method.new read_tensorboard_blob_data_config + write_tensorboard_experiment_data_config = parent_rpcs.write_tensorboard_experiment_data if parent_rpcs.respond_to? :write_tensorboard_experiment_data + @write_tensorboard_experiment_data = ::Gapic::Config::Method.new write_tensorboard_experiment_data_config + write_tensorboard_run_data_config = parent_rpcs.write_tensorboard_run_data if parent_rpcs.respond_to? :write_tensorboard_run_data + @write_tensorboard_run_data = ::Gapic::Config::Method.new write_tensorboard_run_data_config + export_tensorboard_time_series_data_config = parent_rpcs.export_tensorboard_time_series_data if parent_rpcs.respond_to? :export_tensorboard_time_series_data + @export_tensorboard_time_series_data = ::Gapic::Config::Method.new export_tensorboard_time_series_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb new file mode 100644 index 000000000000..72772b9a2a0e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + 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 TensorboardService 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 TensorboardService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb new file mode 100644 index 000000000000..eeef8792f349 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb @@ -0,0 +1,1918 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/tensorboard_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + module Rest + ## + # REST service stub for the TensorboardService 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_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest] + # 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_tensorboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tensorboard_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_tensorboard", + 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_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardRequest] + # 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::Tensorboard] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] + # A result object deserialized from the server's reply + def get_tensorboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tensorboard_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_tensorboard", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Tensorboard.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_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_tensorboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tensorboard_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_tensorboard", + 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_tensorboards REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest] + # 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::ListTensorboardsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTensorboardsResponse] + # A result object deserialized from the server's reply + def list_tensorboards request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tensorboards_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_tensorboards", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTensorboardsResponse.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_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest] + # 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_tensorboard request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tensorboard_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_tensorboard", + 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 read_tensorboard_usage REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest] + # 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::ReadTensorboardUsageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse] + # A result object deserialized from the server's reply + def read_tensorboard_usage request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_tensorboard_usage_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: "read_tensorboard_usage", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the read_tensorboard_size REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest] + # 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::ReadTensorboardSizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse] + # A result object deserialized from the server's reply + def read_tensorboard_size request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_tensorboard_size_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: "read_tensorboard_size", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest] + # 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::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # A result object deserialized from the server's reply + def create_tensorboard_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tensorboard_experiment_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_tensorboard_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardExperiment.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_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest] + # 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::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # A result object deserialized from the server's reply + def get_tensorboard_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tensorboard_experiment_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_tensorboard_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardExperiment.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_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest] + # 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::TensorboardExperiment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # A result object deserialized from the server's reply + def update_tensorboard_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tensorboard_experiment_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_tensorboard_experiment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardExperiment.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_tensorboard_experiments REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest] + # 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::ListTensorboardExperimentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsResponse] + # A result object deserialized from the server's reply + def list_tensorboard_experiments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tensorboard_experiments_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_tensorboard_experiments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsResponse.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_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest] + # 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_tensorboard_experiment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tensorboard_experiment_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_tensorboard_experiment", + 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 create_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest] + # 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::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # A result object deserialized from the server's reply + def create_tensorboard_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tensorboard_run_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_tensorboard_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardRun.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_tensorboard_runs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest] + # 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::BatchCreateTensorboardRunsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse] + # A result object deserialized from the server's reply + def batch_create_tensorboard_runs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_tensorboard_runs_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: "batch_create_tensorboard_runs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse.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_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest] + # 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::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # A result object deserialized from the server's reply + def get_tensorboard_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tensorboard_run_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_tensorboard_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardRun.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_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest] + # 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::TensorboardRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # A result object deserialized from the server's reply + def update_tensorboard_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tensorboard_run_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_tensorboard_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardRun.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_tensorboard_runs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest] + # 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::ListTensorboardRunsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTensorboardRunsResponse] + # A result object deserialized from the server's reply + def list_tensorboard_runs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tensorboard_runs_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_tensorboard_runs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTensorboardRunsResponse.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_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest] + # 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_tensorboard_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tensorboard_run_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_tensorboard_run", + 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 batch_create_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest] + # 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::BatchCreateTensorboardTimeSeriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse] + # A result object deserialized from the server's reply + def batch_create_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_tensorboard_time_series_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: "batch_create_tensorboard_time_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest] + # 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::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # A result object deserialized from the server's reply + def create_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tensorboard_time_series_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_tensorboard_time_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries.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_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest] + # 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::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # A result object deserialized from the server's reply + def get_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tensorboard_time_series_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_tensorboard_time_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries.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_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest] + # 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::TensorboardTimeSeries] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # A result object deserialized from the server's reply + def update_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tensorboard_time_series_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_tensorboard_time_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries.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_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest] + # 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::ListTensorboardTimeSeriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesResponse] + # A result object deserialized from the server's reply + def list_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tensorboard_time_series_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_tensorboard_time_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesResponse.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_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tensorboard_time_series_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_tensorboard_time_series", + 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 batch_read_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest] + # 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::BatchReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse] + # A result object deserialized from the server's reply + def batch_read_tensorboard_time_series_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_read_tensorboard_time_series_data_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: "batch_read_tensorboard_time_series_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the read_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest] + # 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::ReadTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse] + # A result object deserialized from the server's reply + def read_tensorboard_time_series_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_tensorboard_time_series_data_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: "read_tensorboard_time_series_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the read_tensorboard_blob_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def read_tensorboard_blob_data request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_read_tensorboard_blob_data_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: "read_tensorboard_blob_data", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the write_tensorboard_experiment_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest] + # 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::WriteTensorboardExperimentDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse] + # A result object deserialized from the server's reply + def write_tensorboard_experiment_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_write_tensorboard_experiment_data_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: "write_tensorboard_experiment_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the write_tensorboard_run_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest] + # 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::WriteTensorboardRunDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse] + # A result object deserialized from the server's reply + def write_tensorboard_run_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_write_tensorboard_run_data_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: "write_tensorboard_run_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest] + # 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::ExportTensorboardTimeSeriesDataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataResponse] + # A result object deserialized from the server's reply + def export_tensorboard_time_series_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_tensorboard_time_series_data_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: "export_tensorboard_time_series_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataResponse.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_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest] + # 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_tensorboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tensorboards", + body: "tensorboard", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardRequest] + # 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_tensorboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest] + # 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_tensorboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tensorboard.name}", + body: "tensorboard", + matches: [ + ["tensorboard.name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tensorboards REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest] + # 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_tensorboards_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/tensorboards", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tensorboard REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest] + # 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_tensorboard_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the read_tensorboard_usage REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_tensorboard_usage_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{tensorboard}:readUsage", + matches: [ + ["tensorboard", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the read_tensorboard_size REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_tensorboard_size_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{tensorboard}:readSize", + matches: [ + ["tensorboard", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest] + # 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_tensorboard_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/experiments", + body: "tensorboard_experiment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest] + # 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_tensorboard_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest] + # 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_tensorboard_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tensorboard_experiment.name}", + body: "tensorboard_experiment", + matches: [ + ["tensorboard_experiment.name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tensorboard_experiments REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest] + # 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_tensorboard_experiments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/experiments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tensorboard_experiment REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest] + # 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_tensorboard_experiment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest] + # 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_tensorboard_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/runs", + body: "tensorboard_run", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_tensorboard_runs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_tensorboard_runs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/runs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest] + # 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_tensorboard_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest] + # 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_tensorboard_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tensorboard_run.name}", + body: "tensorboard_run", + matches: [ + ["tensorboard_run.name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tensorboard_runs REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest] + # 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_tensorboard_runs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/runs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tensorboard_run REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest] + # 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_tensorboard_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/timeSeries", + body: "tensorboard_time_series", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tensorboard_time_series.name}", + body: "tensorboard_time_series", + matches: [ + ["tensorboard_time_series.name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/timeSeries", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tensorboard_time_series REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest] + # 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_tensorboard_time_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_read_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_read_tensorboard_time_series_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{tensorboard}:batchRead", + matches: [ + ["tensorboard", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the read_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_tensorboard_time_series_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{tensorboard_time_series}:read", + matches: [ + ["tensorboard_time_series", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the read_tensorboard_blob_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_read_tensorboard_blob_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{time_series}:readBlobData", + matches: [ + ["time_series", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the write_tensorboard_experiment_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_write_tensorboard_experiment_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{tensorboard_experiment}:write", + body: "*", + matches: [ + ["tensorboard_experiment", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the write_tensorboard_run_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_write_tensorboard_run_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{tensorboard_run}:write", + body: "*", + matches: [ + ["tensorboard_run", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_tensorboard_time_series_data REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_tensorboard_time_series_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{tensorboard_time_series}:exportTensorboardTimeSeries", + body: "*", + matches: [ + ["tensorboard_time_series", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb new file mode 100644 index 000000000000..1a283f063b5b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb new file mode 100644 index 000000000000..1bb5aa008468 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/vertex_rag_data_service/credentials" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/paths" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/operations" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/client" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing user data for RAG. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/vertex_rag_data_service" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new + # + module VertexRagDataService + end + end + end + end +end + +helper_path = ::File.join __dir__, "vertex_rag_data_service", "helpers.rb" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb new file mode 100644 index 000000000000..e4e247a8c888 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb @@ -0,0 +1,1430 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vertex_rag_data_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + ## + # Client for the VertexRagDataService service. + # + # A service for managing user data for RAG. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vertex_rag_data_service_stub + + ## + # Configure the VertexRagDataService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VertexRagDataService clients + # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::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 VertexRagDataService 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::VertexRagDataService::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 + @vertex_rag_data_service_stub.universe_domain + end + + ## + # Create a new VertexRagDataService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VertexRagDataService 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/vertex_rag_data_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 + + @vertex_rag_data_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::VertexRagDataService::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 + ) + + @vertex_rag_data_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 = @vertex_rag_data_service_stub.endpoint + config.universe_domain = @vertex_rag_data_service_stub.universe_domain + config.logger = @vertex_rag_data_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 = @vertex_rag_data_service_stub.endpoint + config.universe_domain = @vertex_rag_data_service_stub.universe_domain + config.logger = @vertex_rag_data_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::VertexRagDataService::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 + @vertex_rag_data_service_stub.logger + end + + # Service calls + + ## + # Creates a RagCorpus. + # + # @overload create_rag_corpus(request, options = nil) + # Pass arguments to `create_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest, ::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_rag_corpus(parent: nil, rag_corpus: nil) + # Pass arguments to `create_rag_corpus` 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 RagCorpus in. + # Format: `projects/{project}/locations/{location}` + # @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash] + # Required. The RagCorpus 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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest.new + # + # # Call the create_rag_corpus method. + # result = client.create_rag_corpus 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_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :create_rag_corpus, 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 + + ## + # Updates a RagCorpus. + # + # @overload update_rag_corpus(request, options = nil) + # Pass arguments to `update_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest, ::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_rag_corpus(rag_corpus: nil) + # Pass arguments to `update_rag_corpus` 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 rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash] + # Required. The RagCorpus which replaces the resource on the server. + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest.new + # + # # Call the update_rag_corpus method. + # result = client.update_rag_corpus request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest + + # 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_rag_corpus.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.rag_corpus&.name + header_params["rag_corpus.name"] = request.rag_corpus.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_rag_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :update_rag_corpus, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a RagCorpus. + # + # @overload get_rag_corpus(request, options = nil) + # Pass arguments to `get_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest, ::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_rag_corpus(name: nil) + # Pass arguments to `get_rag_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagCorpus resource. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::RagCorpus] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagCorpus] + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetRagCorpusRequest.new + # + # # Call the get_rag_corpus method. + # result = client.get_rag_corpus request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RagCorpus. + # p result + # + def get_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :get_rag_corpus, 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 RagCorpora in a Location. + # + # @overload list_rag_corpora(request, options = nil) + # Pass arguments to `list_rag_corpora` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest, ::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_rag_corpora(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_rag_corpora` 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 from which to list the + # RagCorpora. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse#next_page_token ListRagCorporaResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#list_rag_corpora VertexRagDataService.ListRagCorpora} + # call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>] + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListRagCorporaRequest.new + # + # # Call the list_rag_corpora method. + # result = client.list_rag_corpora 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::RagCorpus. + # p item + # end + # + def list_rag_corpora request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest + + # 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_rag_corpora.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_rag_corpora.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_rag_corpora.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :list_rag_corpora, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_corpora, 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 + + ## + # Deletes a RagCorpus. + # + # @overload delete_rag_corpus(request, options = nil) + # Pass arguments to `delete_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest, ::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_rag_corpus(name: nil, force: nil) + # Pass arguments to `delete_rag_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagCorpus resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param force [::Boolean] + # Optional. If set to true, any RagFiles in this RagCorpus will also be + # deleted. Otherwise, the request will only work if the RagCorpus has no + # RagFiles. + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest.new + # + # # Call the delete_rag_corpus method. + # result = client.delete_rag_corpus 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_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :delete_rag_corpus, 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 + + ## + # Upload a file into a RagCorpus. + # + # @overload upload_rag_file(request, options = nil) + # Pass arguments to `upload_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UploadRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest, ::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 upload_rag_file(parent: nil, rag_file: nil, upload_rag_file_config: nil) + # Pass arguments to `upload_rag_file` 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 name of the RagCorpus resource into which to upload the file. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param rag_file [::Google::Cloud::AIPlatform::V1::RagFile, ::Hash] + # Required. The RagFile to upload. + # @param upload_rag_file_config [::Google::Cloud::AIPlatform::V1::UploadRagFileConfig, ::Hash] + # Required. The config for the RagFiles to be uploaded into the RagCorpus. + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#upload_rag_file VertexRagDataService.UploadRagFile}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse] + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UploadRagFileRequest.new + # + # # Call the upload_rag_file method. + # result = client.upload_rag_file request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::UploadRagFileResponse. + # p result + # + def upload_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadRagFileRequest + + # 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.upload_rag_file.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.upload_rag_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :upload_rag_file, 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 + + ## + # Import files from Google Cloud Storage or Google Drive into a RagCorpus. + # + # @overload import_rag_files(request, options = nil) + # Pass arguments to `import_rag_files` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest, ::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 import_rag_files(parent: nil, import_rag_files_config: nil) + # Pass arguments to `import_rag_files` 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 name of the RagCorpus resource into which to import files. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param import_rag_files_config [::Google::Cloud::AIPlatform::V1::ImportRagFilesConfig, ::Hash] + # Required. The config for the RagFiles to be synced and imported into the + # RagCorpus. + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#import_rag_files VertexRagDataService.ImportRagFiles}. + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportRagFilesRequest.new + # + # # Call the import_rag_files method. + # result = client.import_rag_files 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 import_rag_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest + + # 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.import_rag_files.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.import_rag_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_rag_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :import_rag_files, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a RagFile. + # + # @overload get_rag_file(request, options = nil) + # Pass arguments to `get_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetRagFileRequest, ::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_rag_file(name: nil) + # Pass arguments to `get_rag_file` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagFile resource. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::RagFile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagFile] + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetRagFileRequest.new + # + # # Call the get_rag_file method. + # result = client.get_rag_file request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RagFile. + # p result + # + def get_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagFileRequest + + # 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_rag_file.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_rag_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :get_rag_file, 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 RagFiles in a RagCorpus. + # + # @overload list_rag_files(request, options = nil) + # Pass arguments to `list_rag_files` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListRagFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest, ::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_rag_files(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_rag_files` 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 RagCorpus from which to list the + # RagFiles. Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListRagFilesResponse#next_page_token ListRagFilesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#list_rag_files VertexRagDataService.ListRagFiles} + # call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>] + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListRagFilesRequest.new + # + # # Call the list_rag_files method. + # result = client.list_rag_files 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::RagFile. + # p item + # end + # + def list_rag_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagFilesRequest + + # 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_rag_files.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_rag_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_rag_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :list_rag_files, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_files, 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 + + ## + # Deletes a RagFile. + # + # @overload delete_rag_file(request, options = nil) + # Pass arguments to `delete_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest, ::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_rag_file(name: nil) + # Pass arguments to `delete_rag_file` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagFile resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + # + # @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::VertexRagDataService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteRagFileRequest.new + # + # # Call the delete_rag_file method. + # result = client.delete_rag_file 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_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest + + # 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_rag_file.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_rag_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.call_rpc :delete_rag_file, 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 VertexRagDataService API. + # + # This class represents the configuration for VertexRagDataService, + # 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::VertexRagDataService::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_rag_corpus to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_rag_corpus.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_rag_corpus.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the VertexRagDataService 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_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rag_corpus + ## + # RPC-specific configuration for `update_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rag_corpus + ## + # RPC-specific configuration for `get_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rag_corpus + ## + # RPC-specific configuration for `list_rag_corpora` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rag_corpora + ## + # RPC-specific configuration for `delete_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rag_corpus + ## + # RPC-specific configuration for `upload_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_rag_file + ## + # RPC-specific configuration for `import_rag_files` + # @return [::Gapic::Config::Method] + # + attr_reader :import_rag_files + ## + # RPC-specific configuration for `get_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rag_file + ## + # RPC-specific configuration for `list_rag_files` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rag_files + ## + # RPC-specific configuration for `delete_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rag_file + + # @private + def initialize parent_rpcs = nil + create_rag_corpus_config = parent_rpcs.create_rag_corpus if parent_rpcs.respond_to? :create_rag_corpus + @create_rag_corpus = ::Gapic::Config::Method.new create_rag_corpus_config + update_rag_corpus_config = parent_rpcs.update_rag_corpus if parent_rpcs.respond_to? :update_rag_corpus + @update_rag_corpus = ::Gapic::Config::Method.new update_rag_corpus_config + get_rag_corpus_config = parent_rpcs.get_rag_corpus if parent_rpcs.respond_to? :get_rag_corpus + @get_rag_corpus = ::Gapic::Config::Method.new get_rag_corpus_config + list_rag_corpora_config = parent_rpcs.list_rag_corpora if parent_rpcs.respond_to? :list_rag_corpora + @list_rag_corpora = ::Gapic::Config::Method.new list_rag_corpora_config + delete_rag_corpus_config = parent_rpcs.delete_rag_corpus if parent_rpcs.respond_to? :delete_rag_corpus + @delete_rag_corpus = ::Gapic::Config::Method.new delete_rag_corpus_config + upload_rag_file_config = parent_rpcs.upload_rag_file if parent_rpcs.respond_to? :upload_rag_file + @upload_rag_file = ::Gapic::Config::Method.new upload_rag_file_config + import_rag_files_config = parent_rpcs.import_rag_files if parent_rpcs.respond_to? :import_rag_files + @import_rag_files = ::Gapic::Config::Method.new import_rag_files_config + get_rag_file_config = parent_rpcs.get_rag_file if parent_rpcs.respond_to? :get_rag_file + @get_rag_file = ::Gapic::Config::Method.new get_rag_file_config + list_rag_files_config = parent_rpcs.list_rag_files if parent_rpcs.respond_to? :list_rag_files + @list_rag_files = ::Gapic::Config::Method.new list_rag_files_config + delete_rag_file_config = parent_rpcs.delete_rag_file if parent_rpcs.respond_to? :delete_rag_file + @delete_rag_file = ::Gapic::Config::Method.new delete_rag_file_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb new file mode 100644 index 000000000000..cc511f621ff3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + # Credentials for the VertexRagDataService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb new file mode 100644 index 000000000000..c1a807a8e7bb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + # 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 VertexRagDataService 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 VertexRagDataService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb new file mode 100644 index 000000000000..cfde7e2db452 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + # Path helper methods for the VertexRagDataService API. + module Paths + ## + # Create a fully-qualified Endpoint resource string. + # + # @overload endpoint_path(project:, location:, endpoint:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param endpoint [String] + # + # @overload endpoint_path(project:, location:, publisher:, model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param publisher [String] + # @param model [String] + # + # @return [::String] + def endpoint_path **args + resources = { + "endpoint:location:project" => (proc do |project:, location:, endpoint:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/endpoints/#{endpoint}" + end), + "location:model:project:publisher" => (proc do |project:, location:, publisher:, model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + ## + # Create a fully-qualified RagCorpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # + # @return [::String] + def rag_corpus_path project:, location:, rag_corpus: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}" + end + + ## + # Create a fully-qualified RagFile resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # @param rag_file [String] + # + # @return [::String] + def rag_file_path project:, location:, rag_corpus:, rag_file: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "rag_corpus cannot contain /" if rag_corpus.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}/ragFiles/#{rag_file}" + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param secret [String] + # @param secret_version [String] + # + # @return [::String] + def secret_version_path project:, secret:, secret_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb new file mode 100644 index 000000000000..f4829f16be49 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/vertex_rag_data_service/credentials" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/paths" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing user data for RAG. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new + # + module VertexRagDataService + # 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/vertex_rag_data_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb new file mode 100644 index 000000000000..b784b56c2e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb @@ -0,0 +1,1343 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vertex_rag_data_service_pb" +require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + module Rest + ## + # REST client for the VertexRagDataService service. + # + # A service for managing user data for RAG. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vertex_rag_data_service_stub + + ## + # Configure the VertexRagDataService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VertexRagDataService clients + # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::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 VertexRagDataService 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::VertexRagDataService::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 + @vertex_rag_data_service_stub.universe_domain + end + + ## + # Create a new VertexRagDataService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VertexRagDataService 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::VertexRagDataService::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 + + @vertex_rag_data_service_stub = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vertex_rag_data_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 = @vertex_rag_data_service_stub.endpoint + config.universe_domain = @vertex_rag_data_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vertex_rag_data_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 = @vertex_rag_data_service_stub.endpoint + config.universe_domain = @vertex_rag_data_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vertex_rag_data_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::VertexRagDataService::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 + @vertex_rag_data_service_stub.logger + end + + # Service calls + + ## + # Creates a RagCorpus. + # + # @overload create_rag_corpus(request, options = nil) + # Pass arguments to `create_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest, ::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_rag_corpus(parent: nil, rag_corpus: nil) + # Pass arguments to `create_rag_corpus` 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 RagCorpus in. + # Format: `projects/{project}/locations/{location}` + # @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash] + # Required. The RagCorpus 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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest.new + # + # # Call the create_rag_corpus method. + # result = client.create_rag_corpus 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_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.create_rag_corpus 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 + + ## + # Updates a RagCorpus. + # + # @overload update_rag_corpus(request, options = nil) + # Pass arguments to `update_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest, ::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_rag_corpus(rag_corpus: nil) + # Pass arguments to `update_rag_corpus` 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 rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash] + # Required. The RagCorpus which replaces the resource on the server. + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest.new + # + # # Call the update_rag_corpus method. + # result = client.update_rag_corpus request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.update_rag_corpus request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a RagCorpus. + # + # @overload get_rag_corpus(request, options = nil) + # Pass arguments to `get_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest, ::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_rag_corpus(name: nil) + # Pass arguments to `get_rag_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagCorpus resource. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::RagCorpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagCorpus] + # + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetRagCorpusRequest.new + # + # # Call the get_rag_corpus method. + # result = client.get_rag_corpus request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RagCorpus. + # p result + # + def get_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.get_rag_corpus 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 RagCorpora in a Location. + # + # @overload list_rag_corpora(request, options = nil) + # Pass arguments to `list_rag_corpora` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest, ::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_rag_corpora(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_rag_corpora` 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 from which to list the + # RagCorpora. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse#next_page_token ListRagCorporaResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#list_rag_corpora VertexRagDataService.ListRagCorpora} + # call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>] + # + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListRagCorporaRequest.new + # + # # Call the list_rag_corpora method. + # result = client.list_rag_corpora 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::RagCorpus. + # p item + # end + # + def list_rag_corpora request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest + + # 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_rag_corpora.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_rag_corpora.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_rag_corpora.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.list_rag_corpora request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_corpora, "rag_corpora", 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 + + ## + # Deletes a RagCorpus. + # + # @overload delete_rag_corpus(request, options = nil) + # Pass arguments to `delete_rag_corpus` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest, ::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_rag_corpus(name: nil, force: nil) + # Pass arguments to `delete_rag_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagCorpus resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param force [::Boolean] + # Optional. If set to true, any RagFiles in this RagCorpus will also be + # deleted. Otherwise, the request will only work if the RagCorpus has no + # RagFiles. + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest.new + # + # # Call the delete_rag_corpus method. + # result = client.delete_rag_corpus 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_rag_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest + + # 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_rag_corpus.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_rag_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_rag_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.delete_rag_corpus 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 + + ## + # Upload a file into a RagCorpus. + # + # @overload upload_rag_file(request, options = nil) + # Pass arguments to `upload_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UploadRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest, ::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 upload_rag_file(parent: nil, rag_file: nil, upload_rag_file_config: nil) + # Pass arguments to `upload_rag_file` 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 name of the RagCorpus resource into which to upload the file. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param rag_file [::Google::Cloud::AIPlatform::V1::RagFile, ::Hash] + # Required. The RagFile to upload. + # @param upload_rag_file_config [::Google::Cloud::AIPlatform::V1::UploadRagFileConfig, ::Hash] + # Required. The config for the RagFiles to be uploaded into the RagCorpus. + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#upload_rag_file VertexRagDataService.UploadRagFile}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse] + # + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UploadRagFileRequest.new + # + # # Call the upload_rag_file method. + # result = client.upload_rag_file request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::UploadRagFileResponse. + # p result + # + def upload_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadRagFileRequest + + # 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.upload_rag_file.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.upload_rag_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upload_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.upload_rag_file 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 + + ## + # Import files from Google Cloud Storage or Google Drive into a RagCorpus. + # + # @overload import_rag_files(request, options = nil) + # Pass arguments to `import_rag_files` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest, ::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 import_rag_files(parent: nil, import_rag_files_config: nil) + # Pass arguments to `import_rag_files` 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 name of the RagCorpus resource into which to import files. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param import_rag_files_config [::Google::Cloud::AIPlatform::V1::ImportRagFilesConfig, ::Hash] + # Required. The config for the RagFiles to be synced and imported into the + # RagCorpus. + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#import_rag_files VertexRagDataService.ImportRagFiles}. + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ImportRagFilesRequest.new + # + # # Call the import_rag_files method. + # result = client.import_rag_files 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 import_rag_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest + + # 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.import_rag_files.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.import_rag_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_rag_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.import_rag_files request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a RagFile. + # + # @overload get_rag_file(request, options = nil) + # Pass arguments to `get_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetRagFileRequest, ::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_rag_file(name: nil) + # Pass arguments to `get_rag_file` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagFile resource. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::RagFile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagFile] + # + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetRagFileRequest.new + # + # # Call the get_rag_file method. + # result = client.get_rag_file request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RagFile. + # p result + # + def get_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagFileRequest + + # 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_rag_file.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_rag_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.get_rag_file 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 RagFiles in a RagCorpus. + # + # @overload list_rag_files(request, options = nil) + # Pass arguments to `list_rag_files` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListRagFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest, ::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_rag_files(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_rag_files` 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 RagCorpus from which to list the + # RagFiles. Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListRagFilesResponse#next_page_token ListRagFilesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#list_rag_files VertexRagDataService.ListRagFiles} + # call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>] + # + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListRagFilesRequest.new + # + # # Call the list_rag_files method. + # result = client.list_rag_files 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::RagFile. + # p item + # end + # + def list_rag_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagFilesRequest + + # 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_rag_files.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_rag_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_rag_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.list_rag_files request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_files, "rag_files", 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 + + ## + # Deletes a RagFile. + # + # @overload delete_rag_file(request, options = nil) + # Pass arguments to `delete_rag_file` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest, ::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_rag_file(name: nil) + # Pass arguments to `delete_rag_file` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the RagFile resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + # @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::VertexRagDataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteRagFileRequest.new + # + # # Call the delete_rag_file method. + # result = client.delete_rag_file 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_rag_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest + + # 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_rag_file.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_rag_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_rag_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_data_service_stub.delete_rag_file 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 VertexRagDataService REST API. + # + # This class represents the configuration for VertexRagDataService 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::VertexRagDataService::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_rag_corpus to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_rag_corpus.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_rag_corpus.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the VertexRagDataService 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_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rag_corpus + ## + # RPC-specific configuration for `update_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rag_corpus + ## + # RPC-specific configuration for `get_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rag_corpus + ## + # RPC-specific configuration for `list_rag_corpora` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rag_corpora + ## + # RPC-specific configuration for `delete_rag_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rag_corpus + ## + # RPC-specific configuration for `upload_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_rag_file + ## + # RPC-specific configuration for `import_rag_files` + # @return [::Gapic::Config::Method] + # + attr_reader :import_rag_files + ## + # RPC-specific configuration for `get_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rag_file + ## + # RPC-specific configuration for `list_rag_files` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rag_files + ## + # RPC-specific configuration for `delete_rag_file` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rag_file + + # @private + def initialize parent_rpcs = nil + create_rag_corpus_config = parent_rpcs.create_rag_corpus if parent_rpcs.respond_to? :create_rag_corpus + @create_rag_corpus = ::Gapic::Config::Method.new create_rag_corpus_config + update_rag_corpus_config = parent_rpcs.update_rag_corpus if parent_rpcs.respond_to? :update_rag_corpus + @update_rag_corpus = ::Gapic::Config::Method.new update_rag_corpus_config + get_rag_corpus_config = parent_rpcs.get_rag_corpus if parent_rpcs.respond_to? :get_rag_corpus + @get_rag_corpus = ::Gapic::Config::Method.new get_rag_corpus_config + list_rag_corpora_config = parent_rpcs.list_rag_corpora if parent_rpcs.respond_to? :list_rag_corpora + @list_rag_corpora = ::Gapic::Config::Method.new list_rag_corpora_config + delete_rag_corpus_config = parent_rpcs.delete_rag_corpus if parent_rpcs.respond_to? :delete_rag_corpus + @delete_rag_corpus = ::Gapic::Config::Method.new delete_rag_corpus_config + upload_rag_file_config = parent_rpcs.upload_rag_file if parent_rpcs.respond_to? :upload_rag_file + @upload_rag_file = ::Gapic::Config::Method.new upload_rag_file_config + import_rag_files_config = parent_rpcs.import_rag_files if parent_rpcs.respond_to? :import_rag_files + @import_rag_files = ::Gapic::Config::Method.new import_rag_files_config + get_rag_file_config = parent_rpcs.get_rag_file if parent_rpcs.respond_to? :get_rag_file + @get_rag_file = ::Gapic::Config::Method.new get_rag_file_config + list_rag_files_config = parent_rpcs.list_rag_files if parent_rpcs.respond_to? :list_rag_files + @list_rag_files = ::Gapic::Config::Method.new list_rag_files_config + delete_rag_file_config = parent_rpcs.delete_rag_file if parent_rpcs.respond_to? :delete_rag_file + @delete_rag_file = ::Gapic::Config::Method.new delete_rag_file_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb new file mode 100644 index 000000000000..a0cd5a5996de --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + 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 VertexRagDataService 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 VertexRagDataService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb new file mode 100644 index 000000000000..e29e7ddfb28b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb @@ -0,0 +1,695 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/vertex_rag_data_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + module Rest + ## + # REST service stub for the VertexRagDataService 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_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest] + # 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_rag_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_rag_corpus_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_rag_corpus", + 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 update_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_rag_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_rag_corpus_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_rag_corpus", + 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_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest] + # 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::RagCorpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagCorpus] + # A result object deserialized from the server's reply + def get_rag_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_rag_corpus_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_rag_corpus", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::RagCorpus.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_rag_corpora REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest] + # 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::ListRagCorporaResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse] + # A result object deserialized from the server's reply + def list_rag_corpora request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_rag_corpora_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_rag_corpora", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse.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_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest] + # 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_rag_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_rag_corpus_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_rag_corpus", + 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 upload_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest] + # 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::UploadRagFileResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse] + # A result object deserialized from the server's reply + def upload_rag_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upload_rag_file_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: "upload_rag_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::UploadRagFileResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_rag_files REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest] + # 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 import_rag_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_rag_files_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: "import_rag_files", + 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_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetRagFileRequest] + # 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::RagFile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RagFile] + # A result object deserialized from the server's reply + def get_rag_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_rag_file_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_rag_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::RagFile.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_rag_files REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest] + # 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::ListRagFilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListRagFilesResponse] + # A result object deserialized from the server's reply + def list_rag_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_rag_files_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_rag_files", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListRagFilesResponse.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_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest] + # 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_rag_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_rag_file_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_rag_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest] + # 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_rag_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/ragCorpora", + body: "rag_corpus", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest] + # 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_rag_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{rag_corpus.name}", + body: "rag_corpus", + matches: [ + ["rag_corpus.name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest] + # 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_rag_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_rag_corpora REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest] + # 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_rag_corpora_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/ragCorpora", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_rag_corpus REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest] + # 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_rag_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upload_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upload_rag_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/ragFiles:upload", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_rag_files REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_rag_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/ragFiles:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetRagFileRequest] + # 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_rag_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_rag_files REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest] + # 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_rag_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/ragFiles", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_rag_file REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest] + # 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_rag_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb new file mode 100644 index 000000000000..8454d8b21461 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/vertex_rag_service/credentials" +require "google/cloud/ai_platform/v1/vertex_rag_service/paths" +require "google/cloud/ai_platform/v1/vertex_rag_service/client" +require "google/cloud/ai_platform/v1/vertex_rag_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for retrieving relevant contexts. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/vertex_rag_service" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/vertex_rag_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.new + # + module VertexRagService + end + end + end + end +end + +helper_path = ::File.join __dir__, "vertex_rag_service", "helpers.rb" +require "google/cloud/ai_platform/v1/vertex_rag_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb new file mode 100644 index 000000000000..17287c68628c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb @@ -0,0 +1,697 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vertex_rag_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + ## + # Client for the VertexRagService service. + # + # A service for retrieving relevant contexts. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vertex_rag_service_stub + + ## + # Configure the VertexRagService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VertexRagService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VertexRagService clients + # ::Google::Cloud::AIPlatform::V1::VertexRagService::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 VertexRagService 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::VertexRagService::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 + @vertex_rag_service_stub.universe_domain + end + + ## + # Create a new VertexRagService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VertexRagService 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/vertex_rag_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 + + @vertex_rag_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::VertexRagService::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 + ) + + @vertex_rag_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 = @vertex_rag_service_stub.endpoint + config.universe_domain = @vertex_rag_service_stub.universe_domain + config.logger = @vertex_rag_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 = @vertex_rag_service_stub.endpoint + config.universe_domain = @vertex_rag_service_stub.universe_domain + config.logger = @vertex_rag_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vertex_rag_service_stub.logger + end + + # Service calls + + ## + # Retrieves relevant contexts for a query. + # + # @overload retrieve_contexts(request, options = nil) + # Pass arguments to `retrieve_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest, ::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 retrieve_contexts(vertex_rag_store: nil, parent: nil, query: nil) + # Pass arguments to `retrieve_contexts` 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 vertex_rag_store [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest::VertexRagStore, ::Hash] + # The data source for Vertex RagStore. + # @param parent [::String] + # Required. The resource name of the Location from which to retrieve + # RagContexts. The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param query [::Google::Cloud::AIPlatform::V1::RagQuery, ::Hash] + # Required. Single RAG retrieve query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse] + # + # @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::VertexRagService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RetrieveContextsRequest.new + # + # # Call the retrieve_contexts method. + # result = client.retrieve_contexts request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RetrieveContextsResponse. + # p result + # + def retrieve_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest + + # 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.retrieve_contexts.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.retrieve_contexts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.retrieve_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.call_rpc :retrieve_contexts, 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 + + ## + # Given an input prompt, it returns augmented prompt from vertex rag store + # to guide LLM towards generating grounded responses. + # + # @overload augment_prompt(request, options = nil) + # Pass arguments to `augment_prompt` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AugmentPromptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest, ::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 augment_prompt(vertex_rag_store: nil, parent: nil, contents: nil, model: nil) + # Pass arguments to `augment_prompt` 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 vertex_rag_store [::Google::Cloud::AIPlatform::V1::VertexRagStore, ::Hash] + # Optional. Retrieves contexts from the Vertex RagStore. + # @param parent [::String] + # Required. The resource name of the Location from which to augment prompt. + # The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content to augment, only text format is supported for now. + # @param model [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest::Model, ::Hash] + # Optional. Metadata of the backend deployed model. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AugmentPromptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AugmentPromptResponse] + # + # @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::VertexRagService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AugmentPromptRequest.new + # + # # Call the augment_prompt method. + # result = client.augment_prompt request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AugmentPromptResponse. + # p result + # + def augment_prompt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AugmentPromptRequest + + # 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.augment_prompt.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.augment_prompt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.augment_prompt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.call_rpc :augment_prompt, 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 + + ## + # Given an input text, it returns a score that evaluates the factuality of + # the text. It also extracts and returns claims from the text and provides + # supporting facts. + # + # @overload corroborate_content(request, options = nil) + # Pass arguments to `corroborate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CorroborateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest, ::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 corroborate_content(parent: nil, content: nil, facts: nil, parameters: nil) + # Pass arguments to `corroborate_content` 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 from which to corroborate text. + # The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param content [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. Input content to corroborate, only text format is supported for + # now. + # @param facts [::Array<::Google::Cloud::AIPlatform::V1::Fact, ::Hash>] + # Optional. Facts used to generate the text can also be used to corroborate + # the text. + # @param parameters [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest::Parameters, ::Hash] + # Optional. Parameters that can be set to override default settings per + # request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::CorroborateContentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::CorroborateContentResponse] + # + # @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::VertexRagService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CorroborateContentRequest.new + # + # # Call the corroborate_content method. + # result = client.corroborate_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CorroborateContentResponse. + # p result + # + def corroborate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CorroborateContentRequest + + # 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.corroborate_content.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.corroborate_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.corroborate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.call_rpc :corroborate_content, 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 VertexRagService API. + # + # This class represents the configuration for VertexRagService, + # 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::VertexRagService::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 + # # retrieve_contexts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VertexRagService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.retrieve_contexts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.retrieve_contexts.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the VertexRagService 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 `retrieve_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_contexts + ## + # RPC-specific configuration for `augment_prompt` + # @return [::Gapic::Config::Method] + # + attr_reader :augment_prompt + ## + # RPC-specific configuration for `corroborate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :corroborate_content + + # @private + def initialize parent_rpcs = nil + retrieve_contexts_config = parent_rpcs.retrieve_contexts if parent_rpcs.respond_to? :retrieve_contexts + @retrieve_contexts = ::Gapic::Config::Method.new retrieve_contexts_config + augment_prompt_config = parent_rpcs.augment_prompt if parent_rpcs.respond_to? :augment_prompt + @augment_prompt = ::Gapic::Config::Method.new augment_prompt_config + corroborate_content_config = parent_rpcs.corroborate_content if parent_rpcs.respond_to? :corroborate_content + @corroborate_content = ::Gapic::Config::Method.new corroborate_content_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb new file mode 100644 index 000000000000..0d371e6119af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + # Credentials for the VertexRagService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb new file mode 100644 index 000000000000..ccc2d0187701 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + # Path helper methods for the VertexRagService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified RagCorpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # + # @param project [String] + # @param location [String] + # @param rag_corpus [String] + # + # @return [::String] + def rag_corpus_path project:, location:, rag_corpus: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ragCorpora/#{rag_corpus}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb new file mode 100644 index 000000000000..eeb60f35981e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/vertex_rag_service/credentials" +require "google/cloud/ai_platform/v1/vertex_rag_service/paths" +require "google/cloud/ai_platform/v1/vertex_rag_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for retrieving relevant contexts. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/vertex_rag_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.new + # + module VertexRagService + # 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/vertex_rag_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb new file mode 100644 index 000000000000..6e7c21e60aa9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb @@ -0,0 +1,659 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vertex_rag_service_pb" +require "google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + module Rest + ## + # REST client for the VertexRagService service. + # + # A service for retrieving relevant contexts. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vertex_rag_service_stub + + ## + # Configure the VertexRagService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VertexRagService clients + # ::Google::Cloud::AIPlatform::V1::VertexRagService::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 VertexRagService 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::VertexRagService::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 + @vertex_rag_service_stub.universe_domain + end + + ## + # Create a new VertexRagService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VertexRagService 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 + + @vertex_rag_service_stub = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vertex_rag_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 = @vertex_rag_service_stub.endpoint + config.universe_domain = @vertex_rag_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vertex_rag_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 = @vertex_rag_service_stub.endpoint + config.universe_domain = @vertex_rag_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vertex_rag_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vertex_rag_service_stub.logger + end + + # Service calls + + ## + # Retrieves relevant contexts for a query. + # + # @overload retrieve_contexts(request, options = nil) + # Pass arguments to `retrieve_contexts` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest, ::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 retrieve_contexts(vertex_rag_store: nil, parent: nil, query: nil) + # Pass arguments to `retrieve_contexts` 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 vertex_rag_store [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest::VertexRagStore, ::Hash] + # The data source for Vertex RagStore. + # @param parent [::String] + # Required. The resource name of the Location from which to retrieve + # RagContexts. The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param query [::Google::Cloud::AIPlatform::V1::RagQuery, ::Hash] + # Required. Single RAG retrieve query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse] + # + # @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::VertexRagService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::RetrieveContextsRequest.new + # + # # Call the retrieve_contexts method. + # result = client.retrieve_contexts request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::RetrieveContextsResponse. + # p result + # + def retrieve_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest + + # 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.retrieve_contexts.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.retrieve_contexts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.retrieve_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.retrieve_contexts 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 + + ## + # Given an input prompt, it returns augmented prompt from vertex rag store + # to guide LLM towards generating grounded responses. + # + # @overload augment_prompt(request, options = nil) + # Pass arguments to `augment_prompt` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AugmentPromptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest, ::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 augment_prompt(vertex_rag_store: nil, parent: nil, contents: nil, model: nil) + # Pass arguments to `augment_prompt` 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 vertex_rag_store [::Google::Cloud::AIPlatform::V1::VertexRagStore, ::Hash] + # Optional. Retrieves contexts from the Vertex RagStore. + # @param parent [::String] + # Required. The resource name of the Location from which to augment prompt. + # The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param contents [::Array<::Google::Cloud::AIPlatform::V1::Content, ::Hash>] + # Optional. Input content to augment, only text format is supported for now. + # @param model [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest::Model, ::Hash] + # Optional. Metadata of the backend deployed model. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AugmentPromptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AugmentPromptResponse] + # + # @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::VertexRagService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AugmentPromptRequest.new + # + # # Call the augment_prompt method. + # result = client.augment_prompt request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AugmentPromptResponse. + # p result + # + def augment_prompt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AugmentPromptRequest + + # 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.augment_prompt.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.augment_prompt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.augment_prompt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.augment_prompt 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 + + ## + # Given an input text, it returns a score that evaluates the factuality of + # the text. It also extracts and returns claims from the text and provides + # supporting facts. + # + # @overload corroborate_content(request, options = nil) + # Pass arguments to `corroborate_content` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CorroborateContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest, ::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 corroborate_content(parent: nil, content: nil, facts: nil, parameters: nil) + # Pass arguments to `corroborate_content` 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 from which to corroborate text. + # The users must have permission to make a call in the project. + # Format: + # `projects/{project}/locations/{location}`. + # @param content [::Google::Cloud::AIPlatform::V1::Content, ::Hash] + # Optional. Input content to corroborate, only text format is supported for + # now. + # @param facts [::Array<::Google::Cloud::AIPlatform::V1::Fact, ::Hash>] + # Optional. Facts used to generate the text can also be used to corroborate + # the text. + # @param parameters [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest::Parameters, ::Hash] + # Optional. Parameters that can be set to override default settings per + # request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::CorroborateContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CorroborateContentResponse] + # + # @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::VertexRagService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CorroborateContentRequest.new + # + # # Call the corroborate_content method. + # result = client.corroborate_content request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::CorroborateContentResponse. + # p result + # + def corroborate_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CorroborateContentRequest + + # 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.corroborate_content.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.corroborate_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.corroborate_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vertex_rag_service_stub.corroborate_content 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 VertexRagService REST API. + # + # This class represents the configuration for VertexRagService 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::VertexRagService::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 + # # retrieve_contexts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.retrieve_contexts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.retrieve_contexts.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the VertexRagService 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 `retrieve_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_contexts + ## + # RPC-specific configuration for `augment_prompt` + # @return [::Gapic::Config::Method] + # + attr_reader :augment_prompt + ## + # RPC-specific configuration for `corroborate_content` + # @return [::Gapic::Config::Method] + # + attr_reader :corroborate_content + + # @private + def initialize parent_rpcs = nil + retrieve_contexts_config = parent_rpcs.retrieve_contexts if parent_rpcs.respond_to? :retrieve_contexts + @retrieve_contexts = ::Gapic::Config::Method.new retrieve_contexts_config + augment_prompt_config = parent_rpcs.augment_prompt if parent_rpcs.respond_to? :augment_prompt + @augment_prompt = ::Gapic::Config::Method.new augment_prompt_config + corroborate_content_config = parent_rpcs.corroborate_content if parent_rpcs.respond_to? :corroborate_content + @corroborate_content = ::Gapic::Config::Method.new corroborate_content_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb new file mode 100644 index 000000000000..33c78847a547 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/vertex_rag_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + module Rest + ## + # REST service stub for the VertexRagService 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 retrieve_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest] + # 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::RetrieveContextsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse] + # A result object deserialized from the server's reply + def retrieve_contexts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_retrieve_contexts_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: "retrieve_contexts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the augment_prompt REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest] + # 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::AugmentPromptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AugmentPromptResponse] + # A result object deserialized from the server's reply + def augment_prompt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_augment_prompt_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: "augment_prompt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AugmentPromptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the corroborate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest] + # 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::CorroborateContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::CorroborateContentResponse] + # A result object deserialized from the server's reply + def corroborate_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_corroborate_content_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: "corroborate_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::CorroborateContentResponse.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 retrieve_contexts REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_retrieve_contexts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:retrieveContexts", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the augment_prompt REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AugmentPromptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_augment_prompt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:augmentPrompt", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the corroborate_content REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CorroborateContentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_corroborate_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:corroborateContent", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service.rb new file mode 100644 index 000000000000..47eccfce17e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/vizier_service/credentials" +require "google/cloud/ai_platform/v1/vizier_service/paths" +require "google/cloud/ai_platform/v1/vizier_service/operations" +require "google/cloud/ai_platform/v1/vizier_service/client" +require "google/cloud/ai_platform/v1/vizier_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/vizier_service" + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/vizier_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new + # + module VizierService + end + end + end + end +end + +helper_path = ::File.join __dir__, "vizier_service", "helpers.rb" +require "google/cloud/ai_platform/v1/vizier_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/client.rb new file mode 100644 index 000000000000..037df5a580a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/client.rb @@ -0,0 +1,1927 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vizier_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + ## + # Client for the VizierService service. + # + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vizier_service_stub + + ## + # Configure the VizierService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VizierService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VizierService clients + # ::Google::Cloud::AIPlatform::V1::VizierService::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 VizierService 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::VizierService::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 + @vizier_service_stub.universe_domain + end + + ## + # Create a new VizierService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VizierService 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/vizier_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 + + @vizier_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::VizierService::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 + ) + + @vizier_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 = @vizier_service_stub.endpoint + config.universe_domain = @vizier_service_stub.universe_domain + config.logger = @vizier_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 = @vizier_service_stub.endpoint + config.universe_domain = @vizier_service_stub.universe_domain + config.logger = @vizier_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::VizierService::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 + @vizier_service_stub.logger + end + + # Service calls + + ## + # Creates a Study. A resource name will be generated after creation of the + # Study. + # + # @overload create_study(request, options = nil) + # Pass arguments to `create_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateStudyRequest, ::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_study(parent: nil, study: nil) + # Pass arguments to `create_study` 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 CustomJob in. + # Format: `projects/{project}/locations/{location}` + # @param study [::Google::Cloud::AIPlatform::V1::Study, ::Hash] + # Required. The Study configuration used to create the Study. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateStudyRequest.new + # + # # Call the create_study method. + # result = client.create_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def create_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateStudyRequest + + # 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_study.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_study.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :create_study, 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 + + ## + # Gets a Study by name. + # + # @overload get_study(request, options = nil) + # Pass arguments to `get_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetStudyRequest, ::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_study(name: nil) + # Pass arguments to `get_study` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Study resource. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetStudyRequest.new + # + # # Call the get_study method. + # result = client.get_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def get_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetStudyRequest + + # 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_study.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_study.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :get_study, 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 all the studies in a region for an associated project. + # + # @overload list_studies(request, options = nil) + # Pass arguments to `list_studies` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListStudiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListStudiesRequest, ::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_studies(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_studies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Study from. + # Format: `projects/{project}/locations/{location}` + # @param page_token [::String] + # Optional. A page token to request the next page of results. + # If unspecified, there are no subsequent pages. + # @param page_size [::Integer] + # Optional. The maximum number of studies to return per "page" of results. + # If unspecified, service will pick an appropriate default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListStudiesRequest.new + # + # # Call the list_studies method. + # result = client.list_studies 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::Study. + # p item + # end + # + def list_studies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListStudiesRequest + + # 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_studies.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_studies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_studies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :list_studies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vizier_service_stub, :list_studies, 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 + + ## + # Deletes a Study. + # + # @overload delete_study(request, options = nil) + # Pass arguments to `delete_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteStudyRequest, ::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_study(name: nil) + # Pass arguments to `delete_study` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Study resource to be deleted. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteStudyRequest.new + # + # # Call the delete_study method. + # result = client.delete_study request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteStudyRequest + + # 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_study.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_study.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :delete_study, 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 + + ## + # Looks a study up using the user-defined display_name field instead of the + # fully qualified resource name. + # + # @overload lookup_study(request, options = nil) + # Pass arguments to `lookup_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::LookupStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::LookupStudyRequest, ::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 lookup_study(parent: nil, display_name: nil) + # Pass arguments to `lookup_study` 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 get the Study from. + # Format: `projects/{project}/locations/{location}` + # @param display_name [::String] + # Required. The user-defined display name of the Study + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::LookupStudyRequest.new + # + # # Call the lookup_study method. + # result = client.lookup_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def lookup_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::LookupStudyRequest + + # 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.lookup_study.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.lookup_study.timeout, + metadata: metadata, + retry_policy: @config.rpcs.lookup_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :lookup_study, 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 + + ## + # Adds one or more Trials to a Study, with parameter values + # suggested by Vertex AI Vizier. Returns a long-running + # operation associated with the generation of Trial suggestions. + # When this long-running operation succeeds, it will contain + # a + # {::Google::Cloud::AIPlatform::V1::SuggestTrialsResponse SuggestTrialsResponse}. + # + # @overload suggest_trials(request, options = nil) + # Pass arguments to `suggest_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest, ::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 suggest_trials(parent: nil, suggestion_count: nil, client_id: nil, contexts: nil) + # Pass arguments to `suggest_trials` 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 project and location that the Study belongs to. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param suggestion_count [::Integer] + # Required. The number of suggestions requested. It must be positive. + # @param client_id [::String] + # Required. The identifier of the client that is requesting the suggestion. + # + # If multiple SuggestTrialsRequests have the same `client_id`, + # the service will return the identical suggested Trial if the Trial is + # pending, and provide a new Trial if the last suggested Trial was completed. + # @param contexts [::Array<::Google::Cloud::AIPlatform::V1::TrialContext, ::Hash>] + # Optional. This allows you to specify the "context" for a Trial; a context + # is a slice (a subspace) of the search space. + # + # Typical uses for contexts: + # 1) You are using Vizier to tune a server for best performance, but there's + # a strong weekly cycle. The context specifies the day-of-week. + # This allows Tuesday to generalize from Wednesday without assuming that + # everything is identical. + # 2) Imagine you're optimizing some medical treatment for people. + # As they walk in the door, you know certain facts about them + # (e.g. sex, weight, height, blood-pressure). Put that information in the + # context, and Vizier will adapt its suggestions to the patient. + # 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + # conditions as contexts, and Vizier will generalize between "A" and "B" + # conditions. If they are similar, this will allow Vizier to converge + # to the optimum faster than if "A" and "B" were separate Studies. + # NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + # CreateTrial() RPC; that's the asynchronous option where you don't need a + # close association between contexts and suggestions. + # + # NOTE: All the Parameters you set in a context MUST be defined in the + # Study. + # NOTE: You must supply 0 or $suggestion_count contexts. + # If you don't supply any contexts, Vizier will make suggestions + # from the full search space specified in the StudySpec; if you supply + # a full set of context, each suggestion will match the corresponding + # context. + # NOTE: A Context with no features set matches anything, and allows + # suggestions from the full search space. + # NOTE: Contexts MUST lie within the search space specified in the + # StudySpec. It's an error if they don't. + # NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + # new suggestions are generated. + # NOTE: Generation of suggestions involves a match between a Context and + # (optionally) a REQUESTED trial; if that match is not fully specified, a + # suggestion will be geneated in the merged subspace. + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SuggestTrialsRequest.new + # + # # Call the suggest_trials method. + # result = client.suggest_trials 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 suggest_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest + + # 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.suggest_trials.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.suggest_trials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :suggest_trials, 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 + + ## + # Adds a user provided Trial to a Study. + # + # @overload create_trial(request, options = nil) + # Pass arguments to `create_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTrialRequest, ::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_trial(parent: nil, trial: nil) + # Pass arguments to `create_trial` 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 Study to create the Trial in. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param trial [::Google::Cloud::AIPlatform::V1::Trial, ::Hash] + # Required. The Trial to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTrialRequest.new + # + # # Call the create_trial method. + # result = client.create_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def create_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTrialRequest + + # 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_trial.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_trial.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :create_trial, 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 + + ## + # Gets a Trial. + # + # @overload get_trial(request, options = nil) + # Pass arguments to `get_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTrialRequest, ::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_trial(name: nil) + # Pass arguments to `get_trial` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Trial resource. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTrialRequest.new + # + # # Call the get_trial method. + # result = client.get_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def get_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTrialRequest + + # 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_trial.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_trial.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :get_trial, 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 the Trials associated with a Study. + # + # @overload list_trials(request, options = nil) + # Pass arguments to `list_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTrialsRequest, ::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_trials(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_trials` 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 Study to list the Trial from. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param page_token [::String] + # Optional. A page token to request the next page of results. + # If unspecified, there are no subsequent pages. + # @param page_size [::Integer] + # Optional. The number of Trials to retrieve per "page" of results. + # If unspecified, the service will pick an appropriate default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTrialsRequest.new + # + # # Call the list_trials method. + # result = client.list_trials 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::Trial. + # p item + # end + # + def list_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTrialsRequest + + # 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_trials.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_trials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :list_trials, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vizier_service_stub, :list_trials, 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 + + ## + # Adds a measurement of the objective metrics to a Trial. This measurement + # is assumed to have been taken before the Trial is complete. + # + # @overload add_trial_measurement(request, options = nil) + # Pass arguments to `add_trial_measurement` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest, ::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 add_trial_measurement(trial_name: nil, measurement: nil) + # Pass arguments to `add_trial_measurement` 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 trial_name [::String] + # Required. The name of the trial to add measurement. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @param measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash] + # Required. The measurement to be added to a Trial. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest.new + # + # # Call the add_trial_measurement method. + # result = client.add_trial_measurement request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def add_trial_measurement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest + + # 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.add_trial_measurement.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.trial_name + header_params["trial_name"] = request.trial_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.add_trial_measurement.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_trial_measurement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :add_trial_measurement, 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 + + ## + # Marks a Trial as complete. + # + # @overload complete_trial(request, options = nil) + # Pass arguments to `complete_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CompleteTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CompleteTrialRequest, ::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 complete_trial(name: nil, final_measurement: nil, trial_infeasible: nil, infeasible_reason: nil) + # Pass arguments to `complete_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @param final_measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash] + # Optional. If provided, it will be used as the completed Trial's + # final_measurement; Otherwise, the service will auto-select a + # previously reported measurement as the final-measurement + # @param trial_infeasible [::Boolean] + # Optional. True if the Trial cannot be run with the given Parameter, and + # final_measurement will be ignored. + # @param infeasible_reason [::String] + # Optional. A human readable reason why the trial was infeasible. This should + # only be provided if `trial_infeasible` is true. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CompleteTrialRequest.new + # + # # Call the complete_trial method. + # result = client.complete_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def complete_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CompleteTrialRequest + + # 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.complete_trial.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.complete_trial.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :complete_trial, 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 a Trial. + # + # @overload delete_trial(request, options = nil) + # Pass arguments to `delete_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTrialRequest, ::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_trial(name: nil) + # Pass arguments to `delete_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTrialRequest.new + # + # # Call the delete_trial method. + # result = client.delete_trial request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTrialRequest + + # 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_trial.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_trial.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :delete_trial, 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 + + ## + # Checks whether a Trial should stop or not. Returns a + # long-running operation. When the operation is successful, + # it will contain a + # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateResponse CheckTrialEarlyStoppingStateResponse}. + # + # @overload check_trial_early_stopping_state(request, options = nil) + # Pass arguments to `check_trial_early_stopping_state` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest, ::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 check_trial_early_stopping_state(trial_name: nil) + # Pass arguments to `check_trial_early_stopping_state` 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 trial_name [::String] + # Required. The Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest.new + # + # # Call the check_trial_early_stopping_state method. + # result = client.check_trial_early_stopping_state 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 check_trial_early_stopping_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest + + # 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.check_trial_early_stopping_state.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.trial_name + header_params["trial_name"] = request.trial_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.check_trial_early_stopping_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.check_trial_early_stopping_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :check_trial_early_stopping_state, 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 + + ## + # Stops a Trial. + # + # @overload stop_trial(request, options = nil) + # Pass arguments to `stop_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StopTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StopTrialRequest, ::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 stop_trial(name: nil) + # Pass arguments to `stop_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StopTrialRequest.new + # + # # Call the stop_trial method. + # result = client.stop_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def stop_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopTrialRequest + + # 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.stop_trial.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.stop_trial.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :stop_trial, 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 the pareto-optimal Trials for multi-objective Study or the + # optimal Trials for single-objective Study. The definition of + # pareto-optimal can be checked in wiki page. + # https://en.wikipedia.org/wiki/Pareto_efficiency + # + # @overload list_optimal_trials(request, options = nil) + # Pass arguments to `list_optimal_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest, ::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_optimal_trials(parent: nil) + # Pass arguments to `list_optimal_trials` 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 name of the Study that the optimal Trial belongs to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse] + # + # @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::VizierService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest.new + # + # # Call the list_optimal_trials method. + # result = client.list_optimal_trials request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse. + # p result + # + def list_optimal_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest + + # 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_optimal_trials.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_optimal_trials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_optimal_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.call_rpc :list_optimal_trials, 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 VizierService API. + # + # This class represents the configuration for VizierService, + # 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::VizierService::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_study to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VizierService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_study.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_study.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the VizierService 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_study` + # @return [::Gapic::Config::Method] + # + attr_reader :create_study + ## + # RPC-specific configuration for `get_study` + # @return [::Gapic::Config::Method] + # + attr_reader :get_study + ## + # RPC-specific configuration for `list_studies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_studies + ## + # RPC-specific configuration for `delete_study` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_study + ## + # RPC-specific configuration for `lookup_study` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_study + ## + # RPC-specific configuration for `suggest_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_trials + ## + # RPC-specific configuration for `create_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :create_trial + ## + # RPC-specific configuration for `get_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :get_trial + ## + # RPC-specific configuration for `list_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :list_trials + ## + # RPC-specific configuration for `add_trial_measurement` + # @return [::Gapic::Config::Method] + # + attr_reader :add_trial_measurement + ## + # RPC-specific configuration for `complete_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_trial + ## + # RPC-specific configuration for `delete_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_trial + ## + # RPC-specific configuration for `check_trial_early_stopping_state` + # @return [::Gapic::Config::Method] + # + attr_reader :check_trial_early_stopping_state + ## + # RPC-specific configuration for `stop_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_trial + ## + # RPC-specific configuration for `list_optimal_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :list_optimal_trials + + # @private + def initialize parent_rpcs = nil + create_study_config = parent_rpcs.create_study if parent_rpcs.respond_to? :create_study + @create_study = ::Gapic::Config::Method.new create_study_config + get_study_config = parent_rpcs.get_study if parent_rpcs.respond_to? :get_study + @get_study = ::Gapic::Config::Method.new get_study_config + list_studies_config = parent_rpcs.list_studies if parent_rpcs.respond_to? :list_studies + @list_studies = ::Gapic::Config::Method.new list_studies_config + delete_study_config = parent_rpcs.delete_study if parent_rpcs.respond_to? :delete_study + @delete_study = ::Gapic::Config::Method.new delete_study_config + lookup_study_config = parent_rpcs.lookup_study if parent_rpcs.respond_to? :lookup_study + @lookup_study = ::Gapic::Config::Method.new lookup_study_config + suggest_trials_config = parent_rpcs.suggest_trials if parent_rpcs.respond_to? :suggest_trials + @suggest_trials = ::Gapic::Config::Method.new suggest_trials_config + create_trial_config = parent_rpcs.create_trial if parent_rpcs.respond_to? :create_trial + @create_trial = ::Gapic::Config::Method.new create_trial_config + get_trial_config = parent_rpcs.get_trial if parent_rpcs.respond_to? :get_trial + @get_trial = ::Gapic::Config::Method.new get_trial_config + list_trials_config = parent_rpcs.list_trials if parent_rpcs.respond_to? :list_trials + @list_trials = ::Gapic::Config::Method.new list_trials_config + add_trial_measurement_config = parent_rpcs.add_trial_measurement if parent_rpcs.respond_to? :add_trial_measurement + @add_trial_measurement = ::Gapic::Config::Method.new add_trial_measurement_config + complete_trial_config = parent_rpcs.complete_trial if parent_rpcs.respond_to? :complete_trial + @complete_trial = ::Gapic::Config::Method.new complete_trial_config + delete_trial_config = parent_rpcs.delete_trial if parent_rpcs.respond_to? :delete_trial + @delete_trial = ::Gapic::Config::Method.new delete_trial_config + check_trial_early_stopping_state_config = parent_rpcs.check_trial_early_stopping_state if parent_rpcs.respond_to? :check_trial_early_stopping_state + @check_trial_early_stopping_state = ::Gapic::Config::Method.new check_trial_early_stopping_state_config + stop_trial_config = parent_rpcs.stop_trial if parent_rpcs.respond_to? :stop_trial + @stop_trial = ::Gapic::Config::Method.new stop_trial_config + list_optimal_trials_config = parent_rpcs.list_optimal_trials if parent_rpcs.respond_to? :list_optimal_trials + @list_optimal_trials = ::Gapic::Config::Method.new list_optimal_trials_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/credentials.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/credentials.rb new file mode 100644 index 000000000000..59d20e445cc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + # Credentials for the VizierService 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/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb new file mode 100644 index 000000000000..5fd2ff46a385 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + # 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 VizierService 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 VizierService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/paths.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/paths.rb new file mode 100644 index 000000000000..94840b27057b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + # Path helper methods for the VizierService API. + module Paths + ## + # Create a fully-qualified CustomJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + # + # @param project [String] + # @param location [String] + # @param custom_job [String] + # + # @return [::String] + def custom_job_path project:, location:, custom_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customJobs/#{custom_job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Study resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/studies/{study}` + # + # @param project [String] + # @param location [String] + # @param study [String] + # + # @return [::String] + def study_path project:, location:, study: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/studies/#{study}" + end + + ## + # Create a fully-qualified Trial resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # + # @param project [String] + # @param location [String] + # @param study [String] + # @param trial [String] + # + # @return [::String] + def trial_path project:, location:, study:, trial: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "study cannot contain /" if study.to_s.include? "/" + + "projects/#{project}/locations/#{location}/studies/#{study}/trials/#{trial}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb new file mode 100644 index 000000000000..72191d055aa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/vizier_service/credentials" +require "google/cloud/ai_platform/v1/vizier_service/paths" +require "google/cloud/ai_platform/v1/vizier_service/rest/operations" +require "google/cloud/ai_platform/v1/vizier_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/vizier_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new + # + module VizierService + # 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/vizier_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb new file mode 100644 index 000000000000..bc1de90d7a05 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb @@ -0,0 +1,1805 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/vizier_service_pb" +require "google/cloud/ai_platform/v1/vizier_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + module Rest + ## + # REST client for the VizierService service. + # + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vizier_service_stub + + ## + # Configure the VizierService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VizierService clients + # ::Google::Cloud::AIPlatform::V1::VizierService::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 VizierService 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::VizierService::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 + @vizier_service_stub.universe_domain + end + + ## + # Create a new VizierService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VizierService 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::VizierService::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 + + @vizier_service_stub = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vizier_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 = @vizier_service_stub.endpoint + config.universe_domain = @vizier_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vizier_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 = @vizier_service_stub.endpoint + config.universe_domain = @vizier_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vizier_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::VizierService::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 + @vizier_service_stub.logger + end + + # Service calls + + ## + # Creates a Study. A resource name will be generated after creation of the + # Study. + # + # @overload create_study(request, options = nil) + # Pass arguments to `create_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateStudyRequest, ::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_study(parent: nil, study: nil) + # Pass arguments to `create_study` 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 CustomJob in. + # Format: `projects/{project}/locations/{location}` + # @param study [::Google::Cloud::AIPlatform::V1::Study, ::Hash] + # Required. The Study configuration used to create the Study. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateStudyRequest.new + # + # # Call the create_study method. + # result = client.create_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def create_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateStudyRequest + + # 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_study.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_study.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.create_study 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 + + ## + # Gets a Study by name. + # + # @overload get_study(request, options = nil) + # Pass arguments to `get_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetStudyRequest, ::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_study(name: nil) + # Pass arguments to `get_study` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Study resource. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetStudyRequest.new + # + # # Call the get_study method. + # result = client.get_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def get_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetStudyRequest + + # 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_study.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_study.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.get_study 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 all the studies in a region for an associated project. + # + # @overload list_studies(request, options = nil) + # Pass arguments to `list_studies` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListStudiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListStudiesRequest, ::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_studies(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_studies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the Study from. + # Format: `projects/{project}/locations/{location}` + # @param page_token [::String] + # Optional. A page token to request the next page of results. + # If unspecified, there are no subsequent pages. + # @param page_size [::Integer] + # Optional. The maximum number of studies to return per "page" of results. + # If unspecified, service will pick an appropriate default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListStudiesRequest.new + # + # # Call the list_studies method. + # result = client.list_studies 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::Study. + # p item + # end + # + def list_studies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListStudiesRequest + + # 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_studies.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_studies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_studies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.list_studies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vizier_service_stub, :list_studies, "studies", 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 + + ## + # Deletes a Study. + # + # @overload delete_study(request, options = nil) + # Pass arguments to `delete_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteStudyRequest, ::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_study(name: nil) + # Pass arguments to `delete_study` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Study resource to be deleted. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteStudyRequest.new + # + # # Call the delete_study method. + # result = client.delete_study request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteStudyRequest + + # 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_study.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_study.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.delete_study 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 + + ## + # Looks a study up using the user-defined display_name field instead of the + # fully qualified resource name. + # + # @overload lookup_study(request, options = nil) + # Pass arguments to `lookup_study` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::LookupStudyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::LookupStudyRequest, ::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 lookup_study(parent: nil, display_name: nil) + # Pass arguments to `lookup_study` 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 get the Study from. + # Format: `projects/{project}/locations/{location}` + # @param display_name [::String] + # Required. The user-defined display name of the Study + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::LookupStudyRequest.new + # + # # Call the lookup_study method. + # result = client.lookup_study request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + # p result + # + def lookup_study request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::LookupStudyRequest + + # 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.lookup_study.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.lookup_study.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.lookup_study.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.lookup_study 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 + + ## + # Adds one or more Trials to a Study, with parameter values + # suggested by Vertex AI Vizier. Returns a long-running + # operation associated with the generation of Trial suggestions. + # When this long-running operation succeeds, it will contain + # a + # {::Google::Cloud::AIPlatform::V1::SuggestTrialsResponse SuggestTrialsResponse}. + # + # @overload suggest_trials(request, options = nil) + # Pass arguments to `suggest_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest, ::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 suggest_trials(parent: nil, suggestion_count: nil, client_id: nil, contexts: nil) + # Pass arguments to `suggest_trials` 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 project and location that the Study belongs to. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param suggestion_count [::Integer] + # Required. The number of suggestions requested. It must be positive. + # @param client_id [::String] + # Required. The identifier of the client that is requesting the suggestion. + # + # If multiple SuggestTrialsRequests have the same `client_id`, + # the service will return the identical suggested Trial if the Trial is + # pending, and provide a new Trial if the last suggested Trial was completed. + # @param contexts [::Array<::Google::Cloud::AIPlatform::V1::TrialContext, ::Hash>] + # Optional. This allows you to specify the "context" for a Trial; a context + # is a slice (a subspace) of the search space. + # + # Typical uses for contexts: + # 1) You are using Vizier to tune a server for best performance, but there's + # a strong weekly cycle. The context specifies the day-of-week. + # This allows Tuesday to generalize from Wednesday without assuming that + # everything is identical. + # 2) Imagine you're optimizing some medical treatment for people. + # As they walk in the door, you know certain facts about them + # (e.g. sex, weight, height, blood-pressure). Put that information in the + # context, and Vizier will adapt its suggestions to the patient. + # 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + # conditions as contexts, and Vizier will generalize between "A" and "B" + # conditions. If they are similar, this will allow Vizier to converge + # to the optimum faster than if "A" and "B" were separate Studies. + # NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + # CreateTrial() RPC; that's the asynchronous option where you don't need a + # close association between contexts and suggestions. + # + # NOTE: All the Parameters you set in a context MUST be defined in the + # Study. + # NOTE: You must supply 0 or $suggestion_count contexts. + # If you don't supply any contexts, Vizier will make suggestions + # from the full search space specified in the StudySpec; if you supply + # a full set of context, each suggestion will match the corresponding + # context. + # NOTE: A Context with no features set matches anything, and allows + # suggestions from the full search space. + # NOTE: Contexts MUST lie within the search space specified in the + # StudySpec. It's an error if they don't. + # NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + # new suggestions are generated. + # NOTE: Generation of suggestions involves a match between a Context and + # (optionally) a REQUESTED trial; if that match is not fully specified, a + # suggestion will be geneated in the merged subspace. + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::SuggestTrialsRequest.new + # + # # Call the suggest_trials method. + # result = client.suggest_trials 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 suggest_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest + + # 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.suggest_trials.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.suggest_trials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.suggest_trials 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 + + ## + # Adds a user provided Trial to a Study. + # + # @overload create_trial(request, options = nil) + # Pass arguments to `create_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateTrialRequest, ::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_trial(parent: nil, trial: nil) + # Pass arguments to `create_trial` 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 Study to create the Trial in. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param trial [::Google::Cloud::AIPlatform::V1::Trial, ::Hash] + # Required. The Trial to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateTrialRequest.new + # + # # Call the create_trial method. + # result = client.create_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def create_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateTrialRequest + + # 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_trial.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_trial.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.create_trial 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 + + ## + # Gets a Trial. + # + # @overload get_trial(request, options = nil) + # Pass arguments to `get_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetTrialRequest, ::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_trial(name: nil) + # Pass arguments to `get_trial` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Trial resource. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetTrialRequest.new + # + # # Call the get_trial method. + # result = client.get_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def get_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetTrialRequest + + # 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_trial.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_trial.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.get_trial 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 the Trials associated with a Study. + # + # @overload list_trials(request, options = nil) + # Pass arguments to `list_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListTrialsRequest, ::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_trials(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_trials` 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 Study to list the Trial from. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @param page_token [::String] + # Optional. A page token to request the next page of results. + # If unspecified, there are no subsequent pages. + # @param page_size [::Integer] + # Optional. The number of Trials to retrieve per "page" of results. + # If unspecified, the service will pick an appropriate default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListTrialsRequest.new + # + # # Call the list_trials method. + # result = client.list_trials 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::Trial. + # p item + # end + # + def list_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListTrialsRequest + + # 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_trials.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_trials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.list_trials request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vizier_service_stub, :list_trials, "trials", 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 + + ## + # Adds a measurement of the objective metrics to a Trial. This measurement + # is assumed to have been taken before the Trial is complete. + # + # @overload add_trial_measurement(request, options = nil) + # Pass arguments to `add_trial_measurement` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest, ::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 add_trial_measurement(trial_name: nil, measurement: nil) + # Pass arguments to `add_trial_measurement` 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 trial_name [::String] + # Required. The name of the trial to add measurement. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @param measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash] + # Required. The measurement to be added to a Trial. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest.new + # + # # Call the add_trial_measurement method. + # result = client.add_trial_measurement request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def add_trial_measurement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest + + # 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.add_trial_measurement.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.add_trial_measurement.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_trial_measurement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.add_trial_measurement 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 + + ## + # Marks a Trial as complete. + # + # @overload complete_trial(request, options = nil) + # Pass arguments to `complete_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CompleteTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CompleteTrialRequest, ::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 complete_trial(name: nil, final_measurement: nil, trial_infeasible: nil, infeasible_reason: nil) + # Pass arguments to `complete_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @param final_measurement [::Google::Cloud::AIPlatform::V1::Measurement, ::Hash] + # Optional. If provided, it will be used as the completed Trial's + # final_measurement; Otherwise, the service will auto-select a + # previously reported measurement as the final-measurement + # @param trial_infeasible [::Boolean] + # Optional. True if the Trial cannot be run with the given Parameter, and + # final_measurement will be ignored. + # @param infeasible_reason [::String] + # Optional. A human readable reason why the trial was infeasible. This should + # only be provided if `trial_infeasible` is true. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CompleteTrialRequest.new + # + # # Call the complete_trial method. + # result = client.complete_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def complete_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CompleteTrialRequest + + # 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.complete_trial.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.complete_trial.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.complete_trial 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 a Trial. + # + # @overload delete_trial(request, options = nil) + # Pass arguments to `delete_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteTrialRequest, ::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_trial(name: nil) + # Pass arguments to `delete_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @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/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteTrialRequest.new + # + # # Call the delete_trial method. + # result = client.delete_trial request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteTrialRequest + + # 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_trial.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_trial.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.delete_trial 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 + + ## + # Checks whether a Trial should stop or not. Returns a + # long-running operation. When the operation is successful, + # it will contain a + # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateResponse CheckTrialEarlyStoppingStateResponse}. + # + # @overload check_trial_early_stopping_state(request, options = nil) + # Pass arguments to `check_trial_early_stopping_state` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest, ::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 check_trial_early_stopping_state(trial_name: nil) + # Pass arguments to `check_trial_early_stopping_state` 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 trial_name [::String] + # Required. The Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest.new + # + # # Call the check_trial_early_stopping_state method. + # result = client.check_trial_early_stopping_state 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 check_trial_early_stopping_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest + + # 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.check_trial_early_stopping_state.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.check_trial_early_stopping_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.check_trial_early_stopping_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.check_trial_early_stopping_state 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 + + ## + # Stops a Trial. + # + # @overload stop_trial(request, options = nil) + # Pass arguments to `stop_trial` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StopTrialRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StopTrialRequest, ::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 stop_trial(name: nil) + # Pass arguments to `stop_trial` 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 Trial's name. + # Format: + # `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StopTrialRequest.new + # + # # Call the stop_trial method. + # result = client.stop_trial request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + # p result + # + def stop_trial request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StopTrialRequest + + # 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.stop_trial.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.stop_trial.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_trial.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.stop_trial 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 the pareto-optimal Trials for multi-objective Study or the + # optimal Trials for single-objective Study. The definition of + # pareto-optimal can be checked in wiki page. + # https://en.wikipedia.org/wiki/Pareto_efficiency + # + # @overload list_optimal_trials(request, options = nil) + # Pass arguments to `list_optimal_trials` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest, ::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_optimal_trials(parent: nil) + # Pass arguments to `list_optimal_trials` 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 name of the Study that the optimal Trial belongs to. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse] + # + # @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::VizierService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest.new + # + # # Call the list_optimal_trials method. + # result = client.list_optimal_trials request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse. + # p result + # + def list_optimal_trials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest + + # 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_optimal_trials.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_optimal_trials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_optimal_trials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vizier_service_stub.list_optimal_trials 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 VizierService REST API. + # + # This class represents the configuration for VizierService 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::VizierService::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_study to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_study.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::VizierService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_study.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the VizierService 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_study` + # @return [::Gapic::Config::Method] + # + attr_reader :create_study + ## + # RPC-specific configuration for `get_study` + # @return [::Gapic::Config::Method] + # + attr_reader :get_study + ## + # RPC-specific configuration for `list_studies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_studies + ## + # RPC-specific configuration for `delete_study` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_study + ## + # RPC-specific configuration for `lookup_study` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_study + ## + # RPC-specific configuration for `suggest_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_trials + ## + # RPC-specific configuration for `create_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :create_trial + ## + # RPC-specific configuration for `get_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :get_trial + ## + # RPC-specific configuration for `list_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :list_trials + ## + # RPC-specific configuration for `add_trial_measurement` + # @return [::Gapic::Config::Method] + # + attr_reader :add_trial_measurement + ## + # RPC-specific configuration for `complete_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_trial + ## + # RPC-specific configuration for `delete_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_trial + ## + # RPC-specific configuration for `check_trial_early_stopping_state` + # @return [::Gapic::Config::Method] + # + attr_reader :check_trial_early_stopping_state + ## + # RPC-specific configuration for `stop_trial` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_trial + ## + # RPC-specific configuration for `list_optimal_trials` + # @return [::Gapic::Config::Method] + # + attr_reader :list_optimal_trials + + # @private + def initialize parent_rpcs = nil + create_study_config = parent_rpcs.create_study if parent_rpcs.respond_to? :create_study + @create_study = ::Gapic::Config::Method.new create_study_config + get_study_config = parent_rpcs.get_study if parent_rpcs.respond_to? :get_study + @get_study = ::Gapic::Config::Method.new get_study_config + list_studies_config = parent_rpcs.list_studies if parent_rpcs.respond_to? :list_studies + @list_studies = ::Gapic::Config::Method.new list_studies_config + delete_study_config = parent_rpcs.delete_study if parent_rpcs.respond_to? :delete_study + @delete_study = ::Gapic::Config::Method.new delete_study_config + lookup_study_config = parent_rpcs.lookup_study if parent_rpcs.respond_to? :lookup_study + @lookup_study = ::Gapic::Config::Method.new lookup_study_config + suggest_trials_config = parent_rpcs.suggest_trials if parent_rpcs.respond_to? :suggest_trials + @suggest_trials = ::Gapic::Config::Method.new suggest_trials_config + create_trial_config = parent_rpcs.create_trial if parent_rpcs.respond_to? :create_trial + @create_trial = ::Gapic::Config::Method.new create_trial_config + get_trial_config = parent_rpcs.get_trial if parent_rpcs.respond_to? :get_trial + @get_trial = ::Gapic::Config::Method.new get_trial_config + list_trials_config = parent_rpcs.list_trials if parent_rpcs.respond_to? :list_trials + @list_trials = ::Gapic::Config::Method.new list_trials_config + add_trial_measurement_config = parent_rpcs.add_trial_measurement if parent_rpcs.respond_to? :add_trial_measurement + @add_trial_measurement = ::Gapic::Config::Method.new add_trial_measurement_config + complete_trial_config = parent_rpcs.complete_trial if parent_rpcs.respond_to? :complete_trial + @complete_trial = ::Gapic::Config::Method.new complete_trial_config + delete_trial_config = parent_rpcs.delete_trial if parent_rpcs.respond_to? :delete_trial + @delete_trial = ::Gapic::Config::Method.new delete_trial_config + check_trial_early_stopping_state_config = parent_rpcs.check_trial_early_stopping_state if parent_rpcs.respond_to? :check_trial_early_stopping_state + @check_trial_early_stopping_state = ::Gapic::Config::Method.new check_trial_early_stopping_state_config + stop_trial_config = parent_rpcs.stop_trial if parent_rpcs.respond_to? :stop_trial + @stop_trial = ::Gapic::Config::Method.new stop_trial_config + list_optimal_trials_config = parent_rpcs.list_optimal_trials if parent_rpcs.respond_to? :list_optimal_trials + @list_optimal_trials = ::Gapic::Config::Method.new list_optimal_trials_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb new file mode 100644 index 000000000000..34870a3bae87 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + 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 VizierService 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 VizierService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb new file mode 100644 index 000000000000..07bf4a77dce8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb @@ -0,0 +1,1005 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/vizier_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + module Rest + ## + # REST service stub for the VizierService 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_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateStudyRequest] + # 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::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # A result object deserialized from the server's reply + def create_study request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_study_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_study", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Study.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_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetStudyRequest] + # 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::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # A result object deserialized from the server's reply + def get_study request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_study_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_study", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Study.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_studies REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListStudiesRequest] + # 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::ListStudiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListStudiesResponse] + # A result object deserialized from the server's reply + def list_studies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_studies_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_studies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListStudiesResponse.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_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteStudyRequest] + # 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_study request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_study_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_study", + 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 lookup_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::LookupStudyRequest] + # 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::Study] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Study] + # A result object deserialized from the server's reply + def lookup_study request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_lookup_study_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: "lookup_study", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Study.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest] + # 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 suggest_trials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_trials_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: "suggest_trials", + 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 create_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTrialRequest] + # 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::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # A result object deserialized from the server's reply + def create_trial request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_trial_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_trial", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Trial.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_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTrialRequest] + # 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::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # A result object deserialized from the server's reply + def get_trial request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_trial_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_trial", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Trial.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_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTrialsRequest] + # 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::ListTrialsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListTrialsResponse] + # A result object deserialized from the server's reply + def list_trials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_trials_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_trials", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListTrialsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_trial_measurement REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest] + # 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::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # A result object deserialized from the server's reply + def add_trial_measurement request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_trial_measurement_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: "add_trial_measurement", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Trial.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the complete_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CompleteTrialRequest] + # 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::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # A result object deserialized from the server's reply + def complete_trial request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_trial_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: "complete_trial", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Trial.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_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTrialRequest] + # 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_trial request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_trial_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_trial", + 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 check_trial_early_stopping_state REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest] + # 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 check_trial_early_stopping_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_check_trial_early_stopping_state_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: "check_trial_early_stopping_state", + 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 stop_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StopTrialRequest] + # 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::Trial] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Trial] + # A result object deserialized from the server's reply + def stop_trial request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_trial_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: "stop_trial", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Trial.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_optimal_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest] + # 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::ListOptimalTrialsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse] + # A result object deserialized from the server's reply + def list_optimal_trials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_optimal_trials_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_optimal_trials", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse.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_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateStudyRequest] + # 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_study_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/studies", + body: "study", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetStudyRequest] + # 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_study_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_studies REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListStudiesRequest] + # 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_studies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/studies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteStudyRequest] + # 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_study_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the lookup_study REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::LookupStudyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_lookup_study_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/studies:lookup", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_trials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/trials:suggest", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateTrialRequest] + # 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_trial_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/trials", + body: "trial", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetTrialRequest] + # 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_trial_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListTrialsRequest] + # 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_trials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/trials", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_trial_measurement REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_trial_measurement_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{trial_name}:addTrialMeasurement", + body: "*", + matches: [ + ["trial_name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CompleteTrialRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_trial_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:complete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteTrialRequest] + # 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_trial_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the check_trial_early_stopping_state REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_check_trial_early_stopping_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{trial_name}:checkTrialEarlyStoppingState", + body: "*", + matches: [ + ["trial_name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_trial REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StopTrialRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_trial_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_optimal_trials REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest] + # 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_optimal_trials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/trials:listOptimalTrials", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb new file mode 100644 index 000000000000..8c86d8fadb0b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/accelerator_type.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/accelerator_type.proto\x12\x1agoogle.cloud.aiplatform.v1*\xce\x02\n\x0f\x41\x63\x63\x65leratorType\x12 \n\x1c\x41\x43\x43\x45LERATOR_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x10NVIDIA_TESLA_K80\x10\x01\x1a\x02\x08\x01\x12\x15\n\x11NVIDIA_TESLA_P100\x10\x02\x12\x15\n\x11NVIDIA_TESLA_V100\x10\x03\x12\x13\n\x0fNVIDIA_TESLA_P4\x10\x04\x12\x13\n\x0fNVIDIA_TESLA_T4\x10\x05\x12\x15\n\x11NVIDIA_TESLA_A100\x10\x08\x12\x14\n\x10NVIDIA_A100_80GB\x10\t\x12\r\n\tNVIDIA_L4\x10\x0b\x12\x14\n\x10NVIDIA_H100_80GB\x10\r\x12\x19\n\x15NVIDIA_H100_MEGA_80GB\x10\x0e\x12\n\n\x06TPU_V2\x10\x06\x12\n\n\x06TPU_V3\x10\x07\x12\x0e\n\nTPU_V4_POD\x10\n\x12\x12\n\x0eTPU_V5_LITEPOD\x10\x0c\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x41\x63\x63\x65leratorTypeProtoP\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 = [ + ] + 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 + AcceleratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AcceleratorType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_pb.rb new file mode 100644 index 000000000000..5a4700a3171f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/annotation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/user_action_reference_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/aiplatform/v1/annotation.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/aiplatform/v1/user_action_reference.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xce\x04\n\nAnnotation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12payload_schema_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12,\n\x07payload\x18\x03 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12O\n\x11\x61nnotation_source\x18\x05 \x01(\x0b\x32/.google.cloud.aiplatform.v1.UserActionReferenceB\x03\xe0\x41\x03\x12G\n\x06labels\x18\x06 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.Annotation.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x95\x01\xea\x41\x91\x01\n$aiplatform.googleapis.com/Annotation\x12iprojects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}B\xcd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0f\x41nnotationProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.UserActionReference", "google/cloud/aiplatform/v1/user_action_reference.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 + Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Annotation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb new file mode 100644 index 000000000000..0ed2e3e60425 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/annotation_spec.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/annotation_spec.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x02\n\x0e\x41nnotationSpec\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\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\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01:\x8c\x01\xea\x41\x88\x01\n(aiplatform.googleapis.com/AnnotationSpec\x12\\projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13\x41nnotationSpecProtoP\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"], + ] + 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 + AnnotationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AnnotationSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/api_auth_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/api_auth_pb.rb new file mode 100644 index 000000000000..c24572d6e85e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/api_auth_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/api_auth.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n)google/cloud/aiplatform/v1/api_auth.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc8\x01\n\x07\x41piAuth\x12J\n\x0e\x61pi_key_config\x18\x01 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfigH\x00\x1a\x62\n\x0c\x41piKeyConfig\x12R\n\x16\x61pi_key_secret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersionB\r\n\x0b\x61uth_configB\xb8\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x0c\x41piAuthProtoP\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\x41k\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}b\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 = [ + ] + 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 + ApiAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ApiAuth").msgclass + ApiAuth::ApiKeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/artifact_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/artifact_pb.rb new file mode 100644 index 000000000000..b1ec5bb65199 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/artifact_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/artifact.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/aiplatform/v1/artifact.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x94\x05\n\x08\x41rtifact\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0b\n\x03uri\x18\x06 \x01(\t\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12@\n\x06labels\x18\n \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.Artifact.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\r \x01(\x0e\x32*.google.cloud.aiplatform.v1.Artifact.State\x12\x14\n\x0cschema_title\x18\x0e \x01(\t\x12\x16\n\x0eschema_version\x18\x0f \x01(\t\x12)\n\x08metadata\x18\x10 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x13\n\x0b\x64\x65scription\x18\x11 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"5\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x08\n\x04LIVE\x10\x02:\x86\x01\xea\x41\x82\x01\n\"aiplatform.googleapis.com/Artifact\x12\\projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}B\xcb\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\rArtifactProtoP\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.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Artifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Artifact").msgclass + Artifact::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Artifact.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb new file mode 100644 index 000000000000..2aeb6989e876 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/batch_prediction_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/completion_stats_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb' +require 'google/cloud/aiplatform/v1/unmanaged_container_model_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/batch_prediction_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/aiplatform/v1/completion_stats.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a?google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto\x1a:google/cloud/aiplatform/v1/unmanaged_container_model.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf3\x13\n\x12\x42\x61tchPredictionJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x05model\x18\x03 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x1e \x01(\tB\x03\xe0\x41\x03\x12V\n\x19unmanaged_container_model\x18\x1c \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.UnmanagedContainerModel\x12U\n\x0cinput_config\x18\x04 \x01(\x0b\x32:.google.cloud.aiplatform.v1.BatchPredictionJob.InputConfigB\x03\xe0\x41\x02\x12V\n\x0finstance_config\x18\x1b \x01(\x0b\x32=.google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig\x12\x30\n\x10model_parameters\x18\x05 \x01(\x0b\x32\x16.google.protobuf.Value\x12W\n\routput_config\x18\x06 \x01(\x0b\x32;.google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfigB\x03\xe0\x41\x02\x12P\n\x13\x64\x65\x64icated_resources\x18\x07 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.BatchDedicatedResources\x12\x17\n\x0fservice_account\x18\x1d \x01(\t\x12\x64\n\x1emanual_batch_tuning_parameters\x18\x08 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.ManualBatchTuningParametersB\x03\xe0\x41\x05\x12\x1c\n\x14generate_explanation\x18\x17 \x01(\x08\x12\x45\n\x10\x65xplanation_spec\x18\x19 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ExplanationSpec\x12S\n\x0boutput_info\x18\t \x01(\x0b\x32\x39.google.cloud.aiplatform.v1.BatchPredictionJob.OutputInfoB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x31\n\x10partial_failures\x18\x0c \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12N\n\x12resources_consumed\x18\r \x01(\x0b\x32-.google.cloud.aiplatform.v1.ResourcesConsumedB\x03\xe0\x41\x03\x12J\n\x10\x63ompletion_stats\x18\x0e \x01(\x0b\x32+.google.cloud.aiplatform.v1.CompletionStatsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\x06labels\x18\x13 \x03(\x0b\x32:.google.cloud.aiplatform.v1.BatchPredictionJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x18 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12!\n\x19\x64isable_container_logging\x18\" \x01(\x08\x12\x1a\n\rsatisfies_pzs\x18$ \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18% \x01(\x08\x42\x03\xe0\x41\x03\x1a\xba\x01\n\x0bInputConfig\x12;\n\ngcs_source\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceH\x00\x12\x45\n\x0f\x62igquery_source\x18\x03 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceH\x00\x12\x1d\n\x10instances_format\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x08\n\x06source\x1al\n\x0eInstanceConfig\x12\x15\n\rinstance_type\x18\x01 \x01(\t\x12\x11\n\tkey_field\x18\x02 \x01(\t\x12\x17\n\x0fincluded_fields\x18\x03 \x03(\t\x12\x17\n\x0f\x65xcluded_fields\x18\x04 \x03(\t\x1a\xd6\x01\n\x0cOutputConfig\x12\x45\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationH\x00\x12O\n\x14\x62igquery_destination\x18\x03 \x01(\x0b\x32/.google.cloud.aiplatform.v1.BigQueryDestinationH\x00\x12\x1f\n\x12predictions_format\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\r\n\x0b\x64\x65stination\x1a\x90\x01\n\nOutputInfo\x12#\n\x14gcs_output_directory\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x12&\n\x17\x62igquery_output_dataset\x18\x02 \x01(\tB\x03\xe0\x41\x03H\x00\x12\"\n\x15\x62igquery_output_table\x18\x04 \x01(\tB\x03\xe0\x41\x03\x42\x11\n\x0foutput_location\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x86\x01\xea\x41\x82\x01\n,aiplatform.googleapis.com/BatchPredictionJob\x12Rprojects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}B\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17\x42\x61tchPredictionJobProtoP\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.UnmanagedContainerModel", "google/cloud/aiplatform/v1/unmanaged_container_model.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.BatchDedicatedResources", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.ManualBatchTuningParameters", "google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto"], + ["google.cloud.aiplatform.v1.ExplanationSpec", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.CompletionStats", "google/cloud/aiplatform/v1/completion_stats.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.GcsSource", "google/cloud/aiplatform/v1/io.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 + BatchPredictionJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchPredictionJob").msgclass + BatchPredictionJob::InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig").msgclass + BatchPredictionJob::InstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig").msgclass + BatchPredictionJob::OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig").msgclass + BatchPredictionJob::OutputInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchPredictionJob.OutputInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/cached_content_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/cached_content_pb.rb new file mode 100644 index 000000000000..0f86e07ccdbd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/cached_content_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/cached_content.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/content_pb' +require 'google/cloud/aiplatform/v1/tool_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/aiplatform/v1/cached_content.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%google/cloud/aiplatform/v1/tool.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc9\x07\n\rCachedContent\x12\x31\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12-\n\x03ttl\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x05\x12\x1c\n\x0c\x64isplay_name\x18\x0b \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12J\n\x12system_instruction\x18\x03 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\t\xe0\x41\x01\xe0\x41\x05\xe0\x41\x04\x12@\n\x08\x63ontents\x18\x04 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\t\xe0\x41\x01\xe0\x41\x05\xe0\x41\x04\x12:\n\x05tools\x18\x05 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\t\xe0\x41\x01\xe0\x41\x05\xe0\x41\x04\x12\x46\n\x0btool_config\x18\x06 \x01(\x0b\x32&.google.cloud.aiplatform.v1.ToolConfigB\t\xe0\x41\x01\xe0\x41\x05\xe0\x41\x04\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12T\n\x0eusage_metadata\x18\x0c \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.CachedContent.UsageMetadataB\x03\xe0\x41\x03\x1a\x93\x01\n\rUsageMetadata\x12\x19\n\x11total_token_count\x18\x01 \x01(\x05\x12\x12\n\ntext_count\x18\x02 \x01(\x05\x12\x13\n\x0bimage_count\x18\x03 \x01(\x05\x12\x1e\n\x16video_duration_seconds\x18\x04 \x01(\x05\x12\x1e\n\x16\x61udio_duration_seconds\x18\x05 \x01(\x05:\x95\x01\xea\x41\x91\x01\n\'aiplatform.googleapis.com/CachedContent\x12Gprojects/{project}/locations/{location}/cachedContents/{cached_content}*\x0e\x63\x61\x63hedContents2\rcachedContentB\x0c\n\nexpirationB\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12\x43\x61\x63hedContentProtoP\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.cloud.aiplatform.v1.Content", "google/cloud/aiplatform/v1/content.proto"], + ["google.cloud.aiplatform.v1.Tool", "google/cloud/aiplatform/v1/tool.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 + CachedContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CachedContent").msgclass + CachedContent::UsageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CachedContent.UsageMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb new file mode 100644 index 000000000000..ab481a6ebdd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/completion_stats.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/completion_stats.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x98\x01\n\x0f\x43ompletionStats\x12\x1d\n\x10successful_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x66\x61iled_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1d\n\x10incomplete_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12,\n\x1fsuccessful_forecast_point_count\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x43ompletionStatsProtoP\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 = [ + ] + 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 + CompletionStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CompletionStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/content_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/content_pb.rb new file mode 100644 index 000000000000..a4dd9205fd54 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/content_pb.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/content.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/openapi_pb' +require 'google/cloud/aiplatform/v1/tool_pb' +require 'google/protobuf/duration_pb' +require 'google/type/date_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/content.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/aiplatform/v1/openapi.proto\x1a%google/cloud/aiplatform/v1/tool.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x16google/type/date.proto\"R\n\x07\x43ontent\x12\x11\n\x04role\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x05parts\x18\x02 \x03(\x0b\x32 .google.cloud.aiplatform.v1.PartB\x03\xe0\x41\x02\"\x8f\x03\n\x04Part\x12\x13\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12<\n\x0binline_data\x18\x02 \x01(\x0b\x32 .google.cloud.aiplatform.v1.BlobB\x03\xe0\x41\x01H\x00\x12>\n\tfile_data\x18\x03 \x01(\x0b\x32$.google.cloud.aiplatform.v1.FileDataB\x03\xe0\x41\x01H\x00\x12\x46\n\rfunction_call\x18\x05 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FunctionCallB\x03\xe0\x41\x01H\x00\x12N\n\x11\x66unction_response\x18\x06 \x01(\x0b\x32,.google.cloud.aiplatform.v1.FunctionResponseB\x03\xe0\x41\x01H\x00\x12H\n\x0evideo_metadata\x18\x04 \x01(\x0b\x32).google.cloud.aiplatform.v1.VideoMetadataB\x03\xe0\x41\x01H\x01\x42\x06\n\x04\x64\x61taB\n\n\x08metadata\"1\n\x04\x42lob\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"9\n\x08\x46ileData\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08\x66ile_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\"y\n\rVideoMetadata\x12\x34\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x32\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xc1\n\n\x10GenerationConfig\x12\x1d\n\x0btemperature\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x17\n\x05top_p\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x17\n\x05top_k\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12!\n\x0f\x63\x61ndidate_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12#\n\x11max_output_tokens\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1b\n\x0estop_sequences\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12#\n\x11response_logprobs\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\x1a\n\x08logprobs\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\"\n\x10presence_penalty\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x07\x88\x01\x01\x12#\n\x11\x66requency_penalty\x18\t \x01(\x02\x42\x03\xe0\x41\x01H\x08\x88\x01\x01\x12\x16\n\x04seed\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01H\t\x88\x01\x01\x12\x1f\n\x12response_mime_type\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0fresponse_schema\x18\x10 \x01(\x0b\x32\".google.cloud.aiplatform.v1.SchemaB\x03\xe0\x41\x01H\n\x88\x01\x01\x12\\\n\x0erouting_config\x18\x11 \x01(\x0b\x32:.google.cloud.aiplatform.v1.GenerationConfig.RoutingConfigB\x03\xe0\x41\x01H\x0b\x88\x01\x01\x1a\xc2\x04\n\rRoutingConfig\x12_\n\tauto_mode\x18\x01 \x01(\x0b\x32J.google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingModeH\x00\x12\x63\n\x0bmanual_mode\x18\x02 \x01(\x0b\x32L.google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.ManualRoutingModeH\x00\x1a\x9b\x02\n\x0f\x41utoRoutingMode\x12\x88\x01\n\x18model_routing_preference\x18\x01 \x01(\x0e\x32\x61.google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreferenceH\x00\x88\x01\x01\"`\n\x16ModelRoutingPreference\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x16\n\x12PRIORITIZE_QUALITY\x10\x01\x12\x0c\n\x08\x42\x41LANCED\x10\x02\x12\x13\n\x0fPRIORITIZE_COST\x10\x03\x42\x1b\n\x19_model_routing_preference\x1a;\n\x11ManualRoutingMode\x12\x17\n\nmodel_name\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_model_nameB\x10\n\x0erouting_configB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x08\n\x06_top_kB\x12\n\x10_candidate_countB\x14\n\x12_max_output_tokensB\x14\n\x12_response_logprobsB\x0b\n\t_logprobsB\x13\n\x11_presence_penaltyB\x14\n\x12_frequency_penaltyB\x07\n\x05_seedB\x12\n\x10_response_schemaB\x11\n\x0f_routing_config\"\xeb\x03\n\rSafetySetting\x12?\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32(.google.cloud.aiplatform.v1.HarmCategoryB\x03\xe0\x41\x02\x12T\n\tthreshold\x18\x02 \x01(\x0e\x32<.google.cloud.aiplatform.v1.SafetySetting.HarmBlockThresholdB\x03\xe0\x41\x02\x12N\n\x06method\x18\x04 \x01(\x0e\x32\x39.google.cloud.aiplatform.v1.SafetySetting.HarmBlockMethodB\x03\xe0\x41\x01\"\x9d\x01\n\x12HarmBlockThreshold\x12$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42LOCK_LOW_AND_ABOVE\x10\x01\x12\x1a\n\x16\x42LOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\n\x0f\x42LOCK_ONLY_HIGH\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04\x12\x07\n\x03OFF\x10\x05\"S\n\x0fHarmBlockMethod\x12!\n\x1dHARM_BLOCK_METHOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08SEVERITY\x10\x01\x12\x0f\n\x0bPROBABILITY\x10\x02\"\xbf\x04\n\x0cSafetyRating\x12?\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32(.google.cloud.aiplatform.v1.HarmCategoryB\x03\xe0\x41\x03\x12R\n\x0bprobability\x18\x02 \x01(\x0e\x32\x38.google.cloud.aiplatform.v1.SafetyRating.HarmProbabilityB\x03\xe0\x41\x03\x12\x1e\n\x11probability_score\x18\x05 \x01(\x02\x42\x03\xe0\x41\x03\x12L\n\x08severity\x18\x06 \x01(\x0e\x32\x35.google.cloud.aiplatform.v1.SafetyRating.HarmSeverityB\x03\xe0\x41\x03\x12\x1b\n\x0eseverity_score\x18\x07 \x01(\x02\x42\x03\xe0\x41\x03\x12\x14\n\x07\x62locked\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\"b\n\x0fHarmProbability\x12 \n\x1cHARM_PROBABILITY_UNSPECIFIED\x10\x00\x12\x0e\n\nNEGLIGIBLE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\x94\x01\n\x0cHarmSeverity\x12\x1d\n\x19HARM_SEVERITY_UNSPECIFIED\x10\x00\x12\x1c\n\x18HARM_SEVERITY_NEGLIGIBLE\x10\x01\x12\x15\n\x11HARM_SEVERITY_LOW\x10\x02\x12\x18\n\x14HARM_SEVERITY_MEDIUM\x10\x03\x12\x16\n\x12HARM_SEVERITY_HIGH\x10\x04\"P\n\x10\x43itationMetadata\x12<\n\tcitations\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.CitationB\x03\xe0\x41\x03\"\xaa\x01\n\x08\x43itation\x12\x18\n\x0bstart_index\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tend_index\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x10\n\x03uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07license\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x30\n\x10publication_date\x18\x06 \x01(\x0b\x32\x11.google.type.DateB\x03\xe0\x41\x03\"\xfc\x05\n\tCandidate\x12\x12\n\x05index\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x39\n\x07\x63ontent\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x03\x12\x12\n\x05score\x18\x08 \x01(\x01\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x61vg_logprobs\x18\t \x01(\x01\x42\x03\xe0\x41\x03\x12H\n\x0flogprobs_result\x18\n \x01(\x0b\x32*.google.cloud.aiplatform.v1.LogprobsResultB\x03\xe0\x41\x03\x12N\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x32.google.cloud.aiplatform.v1.Candidate.FinishReasonB\x03\xe0\x41\x03\x12\x45\n\x0esafety_ratings\x18\x04 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SafetyRatingB\x03\xe0\x41\x03\x12 \n\x0e\x66inish_message\x18\x05 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12L\n\x11\x63itation_metadata\x18\x06 \x01(\x0b\x32,.google.cloud.aiplatform.v1.CitationMetadataB\x03\xe0\x41\x03\x12N\n\x12grounding_metadata\x18\x07 \x01(\x0b\x32-.google.cloud.aiplatform.v1.GroundingMetadataB\x03\xe0\x41\x03\"\xbc\x01\n\x0c\x46inishReason\x12\x1d\n\x19\x46INISH_REASON_UNSPECIFIED\x10\x00\x12\x08\n\x04STOP\x10\x01\x12\x0e\n\nMAX_TOKENS\x10\x02\x12\n\n\x06SAFETY\x10\x03\x12\x0e\n\nRECITATION\x10\x04\x12\t\n\x05OTHER\x10\x05\x12\r\n\tBLOCKLIST\x10\x06\x12\x16\n\x12PROHIBITED_CONTENT\x10\x07\x12\x08\n\x04SPII\x10\x08\x12\x1b\n\x17MALFORMED_FUNCTION_CALL\x10\tB\x11\n\x0f_finish_message\"\x8f\x03\n\x0eLogprobsResult\x12P\n\x0etop_candidates\x18\x01 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.LogprobsResult.TopCandidates\x12O\n\x11\x63hosen_candidates\x18\x02 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.LogprobsResult.Candidate\x1a\x7f\n\tCandidate\x12\x12\n\x05token\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08token_id\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x1c\n\x0flog_probability\x18\x02 \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_tokenB\x0b\n\t_token_idB\x12\n\x10_log_probability\x1aY\n\rTopCandidates\x12H\n\ncandidates\x18\x01 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.LogprobsResult.Candidate\"g\n\x07Segment\x12\x17\n\npart_index\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bstart_index\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tend_index\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x11\n\x04text\x18\x04 \x01(\tB\x03\xe0\x41\x03\"\xde\x02\n\x0eGroundingChunk\x12=\n\x03web\x18\x01 \x01(\x0b\x32..google.cloud.aiplatform.v1.GroundingChunk.WebH\x00\x12X\n\x11retrieved_context\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.GroundingChunk.RetrievedContextH\x00\x1a=\n\x03Web\x12\x10\n\x03uri\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05title\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x06\n\x04_uriB\x08\n\x06_title\x1a\x66\n\x10RetrievedContext\x12\x10\n\x03uri\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05title\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04text\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x06\n\x04_uriB\x08\n\x06_titleB\x07\n\x05_textB\x0c\n\nchunk_type\"\x95\x01\n\x10GroundingSupport\x12\x39\n\x07segment\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.SegmentH\x00\x88\x01\x01\x12\x1f\n\x17grounding_chunk_indices\x18\x02 \x03(\x05\x12\x19\n\x11\x63onfidence_scores\x18\x03 \x03(\x02\x42\n\n\x08_segment\"\xa3\x03\n\x11GroundingMetadata\x12\x1f\n\x12web_search_queries\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12R\n\x12search_entry_point\x18\x04 \x01(\x0b\x32,.google.cloud.aiplatform.v1.SearchEntryPointB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x44\n\x10grounding_chunks\x18\x05 \x03(\x0b\x32*.google.cloud.aiplatform.v1.GroundingChunk\x12M\n\x12grounding_supports\x18\x06 \x03(\x0b\x32,.google.cloud.aiplatform.v1.GroundingSupportB\x03\xe0\x41\x01\x12V\n\x12retrieval_metadata\x18\x07 \x01(\x0b\x32-.google.cloud.aiplatform.v1.RetrievalMetadataB\x06\xe0\x41\x01\xe0\x41\x03H\x01\x88\x01\x01\x42\x15\n\x13_search_entry_pointB\x15\n\x13_retrieval_metadata\"H\n\x10SearchEntryPoint\x12\x1d\n\x10rendered_content\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08sdk_blob\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\"G\n\x11RetrievalMetadata\x12\x32\n%google_search_dynamic_retrieval_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01*\xd7\x01\n\x0cHarmCategory\x12\x1d\n\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1d\n\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\n\x1fHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1c\n\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\n\x1fHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\x12!\n\x1dHARM_CATEGORY_CIVIC_INTEGRITY\x10\x05\x42\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0c\x43ontentProtoP\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.FunctionCall", "google/cloud/aiplatform/v1/tool.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.cloud.aiplatform.v1.Schema", "google/cloud/aiplatform/v1/openapi.proto"], + ["google.type.Date", "google/type/date.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 + Content = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Content").msgclass + Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Part").msgclass + Blob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Blob").msgclass + FileData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FileData").msgclass + VideoMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.VideoMetadata").msgclass + GenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerationConfig").msgclass + GenerationConfig::RoutingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig").msgclass + GenerationConfig::RoutingConfig::AutoRoutingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingMode").msgclass + GenerationConfig::RoutingConfig::AutoRoutingMode::ModelRoutingPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference").enummodule + GenerationConfig::RoutingConfig::ManualRoutingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.ManualRoutingMode").msgclass + SafetySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetySetting").msgclass + SafetySetting::HarmBlockThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetySetting.HarmBlockThreshold").enummodule + SafetySetting::HarmBlockMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetySetting.HarmBlockMethod").enummodule + SafetyRating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyRating").msgclass + SafetyRating::HarmProbability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyRating.HarmProbability").enummodule + SafetyRating::HarmSeverity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyRating.HarmSeverity").enummodule + CitationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CitationMetadata").msgclass + Citation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Citation").msgclass + Candidate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Candidate").msgclass + Candidate::FinishReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Candidate.FinishReason").enummodule + LogprobsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LogprobsResult").msgclass + LogprobsResult::Candidate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LogprobsResult.Candidate").msgclass + LogprobsResult::TopCandidates = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LogprobsResult.TopCandidates").msgclass + Segment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Segment").msgclass + GroundingChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundingChunk").msgclass + GroundingChunk::Web = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundingChunk.Web").msgclass + GroundingChunk::RetrievedContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundingChunk.RetrievedContext").msgclass + GroundingSupport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundingSupport").msgclass + GroundingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundingMetadata").msgclass + SearchEntryPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchEntryPoint").msgclass + RetrievalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrievalMetadata").msgclass + HarmCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.HarmCategory").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/context_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/context_pb.rb new file mode 100644 index 000000000000..25a991846064 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/context_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/context.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/context.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd3\x04\n\x07\x43ontext\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0c\n\x04\x65tag\x18\x08 \x01(\t\x12?\n\x06labels\x18\t \x03(\x0b\x32/.google.cloud.aiplatform.v1.Context.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x0fparent_contexts\x18\x0c \x03(\tB)\xe0\x41\x03\xfa\x41#\n!aiplatform.googleapis.com/Context\x12\x14\n\x0cschema_title\x18\r \x01(\t\x12\x16\n\x0eschema_version\x18\x0e \x01(\t\x12)\n\x08metadata\x18\x0f \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x13\n\x0b\x64\x65scription\x18\x10 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x82\x01\xea\x41\x7f\n!aiplatform.googleapis.com/Context\x12Zprojects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}B\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0c\x43ontextProtoP\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.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Context = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Context").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/custom_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/custom_job_pb.rb new file mode 100644 index 000000000000..3ef6c4acd6ac --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/custom_job_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/custom_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/env_var_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n+google/cloud/aiplatform/v1/custom_job.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#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x99\x07\n\tCustomJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\x08job_spec\x18\x04 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x0b \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.CustomJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x0c \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12V\n\x0fweb_access_uris\x18\x10 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.CustomJob.WebAccessUrisEntryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12WebAccessUrisEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:i\xea\x41\x66\n#aiplatform.googleapis.com/CustomJob\x12?projects/{project}/locations/{location}/customJobs/{custom_job}\"\x98\x06\n\rCustomJobSpec\x12T\n\x16persistent_resource_id\x18\x0e \x01(\tB4\xe0\x41\x01\xfa\x41.\n,aiplatform.googleapis.com/PersistentResource\x12J\n\x11worker_pool_specs\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.WorkerPoolSpecB\x03\xe0\x41\x02\x12:\n\nscheduling\x18\x03 \x01(\x0b\x32&.google.cloud.aiplatform.v1.Scheduling\x12\x17\n\x0fservice_account\x18\x04 \x01(\t\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12reserved_ip_ranges\x18\r \x03(\tB\x03\xe0\x41\x01\x12I\n\x15\x62\x61se_output_directory\x18\x06 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestination\x12&\n\x1eprotected_artifact_location_id\x18\x13 \x01(\t\x12\x42\n\x0btensorboard\x18\x07 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\x12\x1e\n\x11\x65nable_web_access\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12$\n\x17\x65nable_dashboard_access\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12=\n\nexperiment\x18\x11 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!aiplatform.googleapis.com/Context\x12\x41\n\x0e\x65xperiment_run\x18\x12 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!aiplatform.googleapis.com/Context\x12\x37\n\x06models\x18\x14 \x03(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\"\x86\x03\n\x0eWorkerPoolSpec\x12\x43\n\x0e\x63ontainer_spec\x18\x06 \x01(\x0b\x32).google.cloud.aiplatform.v1.ContainerSpecH\x00\x12L\n\x13python_package_spec\x18\x07 \x01(\x0b\x32-.google.cloud.aiplatform.v1.PythonPackageSpecH\x00\x12\x45\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\rreplica_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12=\n\nnfs_mounts\x18\x04 \x03(\x0b\x32$.google.cloud.aiplatform.v1.NfsMountB\x03\xe0\x41\x01\x12\x37\n\tdisk_spec\x18\x05 \x01(\x0b\x32$.google.cloud.aiplatform.v1.DiskSpecB\x06\n\x04task\"w\n\rContainerSpec\x12\x16\n\timage_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63ommand\x18\x02 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x03(\t\x12/\n\x03\x65nv\x18\x04 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVar\"\xaa\x01\n\x11PythonPackageSpec\x12\x1f\n\x12\x65xecutor_image_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cpackage_uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\rpython_module\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04\x61rgs\x18\x04 \x03(\t\x12/\n\x03\x65nv\x18\x05 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVar\"\xf3\x02\n\nScheduling\x12*\n\x07timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12%\n\x1drestart_job_on_worker_restart\x18\x03 \x01(\x08\x12\x46\n\x08strategy\x18\x04 \x01(\x0e\x32/.google.cloud.aiplatform.v1.Scheduling.StrategyB\x03\xe0\x41\x01\x12\x1c\n\x0f\x64isable_retries\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x11max_wait_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"q\n\x08Strategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x11\n\tON_DEMAND\x10\x01\x1a\x02\x08\x01\x12\x10\n\x08LOW_COST\x10\x02\x1a\x02\x08\x01\x12\x0c\n\x08STANDARD\x10\x03\x12\x08\n\x04SPOT\x10\x04\x12\x0e\n\nFLEX_START\x10\x06\x42\xcc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0e\x43ustomJobProtoP\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.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.GcsDestination", "google/cloud/aiplatform/v1/io.proto"], + ["google.cloud.aiplatform.v1.MachineSpec", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.EnvVar", "google/cloud/aiplatform/v1/env_var.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 + CustomJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CustomJob").msgclass + CustomJobSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CustomJobSpec").msgclass + WorkerPoolSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WorkerPoolSpec").msgclass + ContainerSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ContainerSpec").msgclass + PythonPackageSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PythonPackageSpec").msgclass + Scheduling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Scheduling").msgclass + Scheduling::Strategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Scheduling.Strategy").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_item_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_item_pb.rb new file mode 100644 index 000000000000..9728126c4e6f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_item_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/data_item.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/aiplatform/v1/data_item.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf3\x03\n\x08\x44\x61taItem\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.DataItem.LabelsEntryB\x03\xe0\x41\x01\x12,\n\x07payload\x18\x04 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:y\xea\x41v\n\"aiplatform.googleapis.com/DataItem\x12Pprojects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}B\xcb\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\rDataItemProtoP\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.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + DataItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DataItem").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb new file mode 100644 index 000000000000..ba2e55dd37d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/data_labeling_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/money_pb' + + +descriptor_data = "\n2google/cloud/aiplatform/v1/data_labeling_job.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/job_state.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/money.proto\"\xdf\x08\n\x0f\x44\x61taLabelingJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\x08\x64\x61tasets\x18\x03 \x03(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12\\\n\x11\x61nnotation_labels\x18\x0c \x03(\x0b\x32\x41.google.cloud.aiplatform.v1.DataLabelingJob.AnnotationLabelsEntry\x12\x1a\n\rlabeler_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1c\n\x0finstruction_uri\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11inputs_schema_uri\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12+\n\x06inputs\x18\x07 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12\x38\n\x05state\x18\x08 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x1e\n\x11labeling_progress\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12.\n\rcurrent_spend\x18\x0e \x01(\x0b\x32\x12.google.type.MoneyB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x16 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12G\n\x06labels\x18\x0b \x03(\x0b\x32\x37.google.cloud.aiplatform.v1.DataLabelingJob.LabelsEntry\x12\x18\n\x10specialist_pools\x18\x10 \x03(\t\x12\x43\n\x0f\x65ncryption_spec\x18\x14 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12P\n\x16\x61\x63tive_learning_config\x18\x15 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ActiveLearningConfig\x1a\x37\n\x15\x41nnotationLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:|\xea\x41y\n)aiplatform.googleapis.com/DataLabelingJob\x12Lprojects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}\"\xf8\x01\n\x14\x41\x63tiveLearningConfig\x12\x1d\n\x13max_data_item_count\x18\x01 \x01(\x03H\x00\x12\"\n\x18max_data_item_percentage\x18\x02 \x01(\x05H\x00\x12?\n\rsample_config\x18\x03 \x01(\x0b\x32(.google.cloud.aiplatform.v1.SampleConfig\x12\x43\n\x0ftraining_config\x18\x04 \x01(\x0b\x32*.google.cloud.aiplatform.v1.TrainingConfigB\x17\n\x15human_labeling_budget\"\xb8\x02\n\x0cSampleConfig\x12)\n\x1finitial_batch_sample_percentage\x18\x01 \x01(\x05H\x00\x12+\n!following_batch_sample_percentage\x18\x03 \x01(\x05H\x01\x12P\n\x0fsample_strategy\x18\x05 \x01(\x0e\x32\x37.google.cloud.aiplatform.v1.SampleConfig.SampleStrategy\"B\n\x0eSampleStrategy\x12\x1f\n\x1bSAMPLE_STRATEGY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bUNCERTAINTY\x10\x01\x42\x1b\n\x19initial_batch_sample_sizeB\x1d\n\x1b\x66ollowing_batch_sample_size\"6\n\x0eTrainingConfig\x12$\n\x1ctimeout_training_milli_hours\x18\x01 \x01(\x03\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x44\x61taLabelingJobProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.type.Money", "google/type/money.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + DataLabelingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DataLabelingJob").msgclass + ActiveLearningConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ActiveLearningConfig").msgclass + SampleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SampleConfig").msgclass + SampleConfig::SampleStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SampleConfig.SampleStrategy").enummodule + TrainingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TrainingConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb new file mode 100644 index 000000000000..a7c34955a9c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/dataset.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/saved_query_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/dataset.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/io.proto\x1a,google/cloud/aiplatform/v1/saved_query.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x06\n\x07\x44\x61taset\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x10 \x01(\t\x12 \n\x13metadata_schema_uri\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\x08metadata\x18\x08 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12\x1c\n\x0f\x64\x61ta_item_count\x18\n \x01(\x03\x42\x03\xe0\x41\x03\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\x0c\n\x04\x65tag\x18\x06 \x01(\t\x12?\n\x06labels\x18\x07 \x03(\x0b\x32/.google.cloud.aiplatform.v1.Dataset.LabelsEntry\x12=\n\rsaved_queries\x18\t \x03(\x0b\x32&.google.cloud.aiplatform.v1.SavedQuery\x12\x43\n\x0f\x65ncryption_spec\x18\x0b \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x1e\n\x11metadata_artifact\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0fmodel_reference\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:b\xea\x41_\n!aiplatform.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}\"\xa4\x03\n\x10ImportDataConfig\x12;\n\ngcs_source\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceH\x00\x12Z\n\x10\x64\x61ta_item_labels\x18\x02 \x03(\x0b\x32@.google.cloud.aiplatform.v1.ImportDataConfig.DataItemLabelsEntry\x12]\n\x11\x61nnotation_labels\x18\x03 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.ImportDataConfig.AnnotationLabelsEntry\x12\x1e\n\x11import_schema_uri\x18\x04 \x01(\tB\x03\xe0\x41\x02\x1a\x35\n\x13\x44\x61taItemLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x37\n\x15\x41nnotationLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source\"\xe5\x03\n\x10\x45xportDataConfig\x12\x45\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationH\x00\x12I\n\x0e\x66raction_split\x18\x05 \x01(\x0b\x32/.google.cloud.aiplatform.v1.ExportFractionSplitH\x01\x12\x45\n\x0c\x66ilter_split\x18\x07 \x01(\x0b\x32-.google.cloud.aiplatform.v1.ExportFilterSplitH\x01\x12\x1a\n\x12\x61nnotations_filter\x18\x02 \x01(\t\x12\x16\n\x0esaved_query_id\x18\x0b \x01(\t\x12\x1d\n\x15\x61nnotation_schema_uri\x18\x0c \x01(\t\x12J\n\nexport_use\x18\x04 \x01(\x0e\x32\x36.google.cloud.aiplatform.v1.ExportDataConfig.ExportUse\"A\n\tExportUse\x12\x1a\n\x16\x45XPORT_USE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43USTOM_CODE_TRAINING\x10\x06\x42\r\n\x0b\x64\x65stinationB\x07\n\x05split\"d\n\x13\x45xportFractionSplit\x12\x19\n\x11training_fraction\x18\x01 \x01(\x01\x12\x1b\n\x13validation_fraction\x18\x02 \x01(\x01\x12\x15\n\rtest_fraction\x18\x03 \x01(\x01\"k\n\x11\x45xportFilterSplit\x12\x1c\n\x0ftraining_filter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11validation_filter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btest_filter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0c\x44\x61tasetProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.SavedQuery", "google/cloud/aiplatform/v1/saved_query.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.GcsSource", "google/cloud/aiplatform/v1/io.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 + Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Dataset").msgclass + ImportDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportDataConfig").msgclass + ExportDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportDataConfig").msgclass + ExportDataConfig::ExportUse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportDataConfig.ExportUse").enummodule + ExportFractionSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFractionSplit").msgclass + ExportFilterSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFilterSplit").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb new file mode 100644 index 000000000000..16d1e41026f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/dataset_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/annotation_pb' +require 'google/cloud/aiplatform/v1/annotation_spec_pb' +require 'google/cloud/aiplatform/v1/data_item_pb' +require 'google/cloud/aiplatform/v1/dataset_pb' +require 'google/cloud/aiplatform/v1/dataset_version_pb' +require 'google/cloud/aiplatform/v1/model_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/cloud/aiplatform/v1/saved_query_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/dataset_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/annotation.proto\x1a\x30google/cloud/aiplatform/v1/annotation_spec.proto\x1a*google/cloud/aiplatform/v1/data_item.proto\x1a(google/cloud/aiplatform/v1/dataset.proto\x1a\x30google/cloud/aiplatform/v1/dataset_version.proto\x1a&google/cloud/aiplatform/v1/model.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a,google/cloud/aiplatform/v1/saved_query.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8c\x01\n\x14\x43reateDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x39\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.DatasetB\x03\xe0\x41\x02\"p\n\x1e\x43reateDatasetOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"{\n\x11GetDatasetRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x87\x01\n\x14UpdateDatasetRequest\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.DatasetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9d\x01\n\x1bUpdateDatasetVersionRequest\x12H\n\x0f\x64\x61taset_version\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.DatasetVersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xc8\x01\n\x13ListDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"f\n\x14ListDatasetsResponse\x12\x35\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x14\x44\x65leteDatasetRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\"\x97\x01\n\x11ImportDataRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12I\n\x0eimport_configs\x18\x02 \x03(\x0b\x32,.google.cloud.aiplatform.v1.ImportDataConfigB\x03\xe0\x41\x02\"\x14\n\x12ImportDataResponse\"m\n\x1bImportDataOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x96\x01\n\x11\x45xportDataRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12H\n\rexport_config\x18\x02 \x01(\x0b\x32,.google.cloud.aiplatform.v1.ExportDataConfigB\x03\xe0\x41\x02\"m\n\x12\x45xportDataResponse\x12\x16\n\x0e\x65xported_files\x18\x01 \x03(\t\x12?\n\ndata_stats\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.Model.DataStats\"\x8b\x01\n\x1b\x45xportDataOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x1c\n\x14gcs_output_directory\x18\x02 \x01(\t\"\xa2\x01\n\x1b\x43reateDatasetVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12H\n\x0f\x64\x61taset_version\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.DatasetVersionB\x03\xe0\x41\x02\"w\n%CreateDatasetVersionOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"]\n\x1b\x44\x65leteDatasetVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/DatasetVersion\"\x89\x01\n\x18GetDatasetVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/DatasetVersion\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xe8\x01\n\x1aListDatasetVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"|\n\x1bListDatasetVersionsResponse\x12\x44\n\x10\x64\x61taset_versions\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.DatasetVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x1cRestoreDatasetVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/DatasetVersion\"x\n&RestoreDatasetVersionOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xc9\x01\n\x14ListDataItemsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"j\n\x15ListDataItemsResponse\x12\x38\n\ndata_items\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.DataItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xdc\x04\n\x16SearchDataItemsRequest\x12\x1c\n\x12order_by_data_item\x18\x0c \x01(\tH\x00\x12\x63\n\x13order_by_annotation\x18\r \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotationH\x00\x12:\n\x07\x64\x61taset\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12@\n\x0bsaved_query\x18\x02 \x01(\tB+\x18\x01\xfa\x41&\n$aiplatform.googleapis.com/SavedQuery\x12\x19\n\x11\x64\x61ta_labeling_job\x18\x03 \x01(\t\x12\x18\n\x10\x64\x61ta_item_filter\x18\x04 \x01(\t\x12\x1e\n\x12\x61nnotations_filter\x18\x05 \x01(\tB\x02\x18\x01\x12\x1a\n\x12\x61nnotation_filters\x18\x0b \x03(\t\x12.\n\nfield_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x19\n\x11\x61nnotations_limit\x18\x07 \x01(\x05\x12\x11\n\tpage_size\x18\x08 \x01(\x05\x12\x14\n\x08order_by\x18\t \x01(\tB\x02\x18\x01\x12\x12\n\npage_token\x18\n \x01(\t\x1a?\n\x11OrderByAnnotation\x12\x18\n\x0bsaved_query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08order_by\x18\x02 \x01(\tB\x07\n\x05order\"u\n\x17SearchDataItemsResponse\x12\x41\n\x0f\x64\x61ta_item_views\x18\x01 \x03(\x0b\x32(.google.cloud.aiplatform.v1.DataItemView\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa7\x01\n\x0c\x44\x61taItemView\x12\x37\n\tdata_item\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.DataItem\x12;\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32&.google.cloud.aiplatform.v1.Annotation\x12!\n\x19has_truncated_annotations\x18\x03 \x01(\x08\"\xcc\x01\n\x17ListSavedQueriesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Dataset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"r\n\x18ListSavedQueriesResponse\x12=\n\rsaved_queries\x18\x01 \x03(\x0b\x32&.google.cloud.aiplatform.v1.SavedQuery\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"U\n\x17\x44\x65leteSavedQueryRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/SavedQuery\"\x89\x01\n\x18GetAnnotationSpecRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/AnnotationSpec\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xcc\x01\n\x16ListAnnotationsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/DataItem\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"o\n\x17ListAnnotationsResponse\x12;\n\x0b\x61nnotations\x18\x01 \x03(\x0b\x32&.google.cloud.aiplatform.v1.Annotation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd9$\n\x0e\x44\x61tasetService\x12\xf6\x01\n\rCreateDataset\x12\x30.google.cloud.aiplatform.v1.CreateDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41)\n\x07\x44\x61taset\x12\x1e\x43reateDatasetOperationMetadata\xda\x41\x0eparent,dataset\x82\xd3\xe4\x93\x02P\",/v1/{parent=projects/*/locations/*}/datasets:\x07\x64\x61tasetZ\x17\"\x0c/v1/datasets:\x07\x64\x61taset\x12\xb6\x01\n\nGetDataset\x12-.google.cloud.aiplatform.v1.GetDatasetRequest\x1a#.google.cloud.aiplatform.v1.Dataset\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12,/v1/{name=projects/*/locations/*/datasets/*}Z\x17\x12\x15/v1/{name=datasets/*}\x12\xee\x01\n\rUpdateDataset\x12\x30.google.cloud.aiplatform.v1.UpdateDatasetRequest\x1a#.google.cloud.aiplatform.v1.Dataset\"\x85\x01\xda\x41\x13\x64\x61taset,update_mask\x82\xd3\xe4\x93\x02i24/v1/{dataset.name=projects/*/locations/*/datasets/*}:\x07\x64\x61tasetZ(2\x1d/v1/{dataset.name=datasets/*}:\x07\x64\x61taset\x12\xc0\x01\n\x0cListDatasets\x12/.google.cloud.aiplatform.v1.ListDatasetsRequest\x1a\x30.google.cloud.aiplatform.v1.ListDatasetsResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12,/v1/{parent=projects/*/locations/*}/datasetsZ\x0e\x12\x0c/v1/datasets\x12\xea\x01\n\rDeleteDataset\x12\x30.google.cloud.aiplatform.v1.DeleteDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G*,/v1/{name=projects/*/locations/*/datasets/*}Z\x17*\x15/v1/{name=datasets/*}\x12\xe5\x01\n\nImportData\x12-.google.cloud.aiplatform.v1.ImportDataRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41\x31\n\x12ImportDataResponse\x12\x1bImportDataOperationMetadata\xda\x41\x13name,import_configs\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/datasets/*}:import:\x01*\x12\xe4\x01\n\nExportData\x12-.google.cloud.aiplatform.v1.ExportDataRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x31\n\x12\x45xportDataResponse\x12\x1b\x45xportDataOperationMetadata\xda\x41\x12name,export_config\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/datasets/*}:export:\x01*\x12\xd8\x02\n\x14\x43reateDatasetVersion\x12\x37.google.cloud.aiplatform.v1.CreateDatasetVersionRequest\x1a\x1d.google.longrunning.Operation\"\xe7\x01\xca\x41\x37\n\x0e\x44\x61tasetVersion\x12%CreateDatasetVersionOperationMetadata\xda\x41\x16parent,dataset_version\x82\xd3\xe4\x93\x02\x8d\x01\">/v1/{parent=projects/*/locations/*/datasets/*}/datasetVersions:\x0f\x64\x61taset_versionZ:\"\'/v1/{parent=datasets/*}/datasetVersions:\x0f\x64\x61taset_version\x12\xd0\x02\n\x14UpdateDatasetVersion\x12\x37.google.cloud.aiplatform.v1.UpdateDatasetVersionRequest\x1a*.google.cloud.aiplatform.v1.DatasetVersion\"\xd2\x01\xda\x41\x1b\x64\x61taset_version,update_mask\x82\xd3\xe4\x93\x02\xad\x01\x32N/v1/{dataset_version.name=projects/*/locations/*/datasets/*/datasetVersions/*}:\x0f\x64\x61taset_versionZJ27/v1/{dataset_version.name=datasets/*/datasetVersions/*}:\x0f\x64\x61taset_version\x12\x9c\x02\n\x14\x44\x65leteDatasetVersion\x12\x37.google.cloud.aiplatform.v1.DeleteDatasetVersionRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02k*>/v1/{name=projects/*/locations/*/datasets/*/datasetVersions/*}Z)*\'/v1/{name=datasets/*/datasetVersions/*}\x12\xef\x01\n\x11GetDatasetVersion\x12\x34.google.cloud.aiplatform.v1.GetDatasetVersionRequest\x1a*.google.cloud.aiplatform.v1.DatasetVersion\"x\xda\x41\x04name\x82\xd3\xe4\x93\x02k\x12>/v1/{name=projects/*/locations/*/datasets/*/datasetVersions/*}Z)\x12\'/v1/{name=datasets/*/datasetVersions/*}\x12\x82\x02\n\x13ListDatasetVersions\x12\x36.google.cloud.aiplatform.v1.ListDatasetVersionsRequest\x1a\x37.google.cloud.aiplatform.v1.ListDatasetVersionsResponse\"z\xda\x41\x06parent\x82\xd3\xe4\x93\x02k\x12>/v1/{parent=projects/*/locations/*/datasets/*}/datasetVersionsZ)\x12\'/v1/{parent=datasets/*}/datasetVersions\x12\xb6\x02\n\x15RestoreDatasetVersion\x12\x38.google.cloud.aiplatform.v1.RestoreDatasetVersionRequest\x1a\x1d.google.longrunning.Operation\"\xc3\x01\xca\x41\x38\n\x0e\x44\x61tasetVersion\x12&RestoreDatasetVersionOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02{\x12\x46/v1/{name=projects/*/locations/*/datasets/*/datasetVersions/*}:restoreZ1\x12//v1/{name=datasets/*/datasetVersions/*}:restore\x12\xbf\x01\n\rListDataItems\x12\x30.google.cloud.aiplatform.v1.ListDataItemsRequest\x1a\x31.google.cloud.aiplatform.v1.ListDataItemsResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/datasets/*}/dataItems\x12\xc3\x01\n\x0fSearchDataItems\x12\x32.google.cloud.aiplatform.v1.SearchDataItemsRequest\x1a\x33.google.cloud.aiplatform.v1.SearchDataItemsResponse\"G\x82\xd3\xe4\x93\x02\x41\x12?/v1/{dataset=projects/*/locations/*/datasets/*}:searchDataItems\x12\xcb\x01\n\x10ListSavedQueries\x12\x33.google.cloud.aiplatform.v1.ListSavedQueriesRequest\x1a\x34.google.cloud.aiplatform.v1.ListSavedQueriesResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/datasets/*}/savedQueries\x12\xe5\x01\n\x10\x44\x65leteSavedQuery\x12\x33.google.cloud.aiplatform.v1.DeleteSavedQueryRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}\x12\xc4\x01\n\x11GetAnnotationSpec\x12\x34.google.cloud.aiplatform.v1.GetAnnotationSpecRequest\x1a*.google.cloud.aiplatform.v1.AnnotationSpec\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}\x12\xd3\x01\n\x0fListAnnotations\x12\x32.google.cloud.aiplatform.v1.ListAnnotationsRequest\x1a\x33.google.cloud.aiplatform.v1.ListAnnotationsResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/datasets/*/dataItems/*}/annotations\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\x13\x44\x61tasetServiceProtoP\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.Dataset", "google/cloud/aiplatform/v1/dataset.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.DatasetVersion", "google/cloud/aiplatform/v1/dataset_version.proto"], + ["google.cloud.aiplatform.v1.Model.DataStats", "google/cloud/aiplatform/v1/model.proto"], + ["google.cloud.aiplatform.v1.DataItem", "google/cloud/aiplatform/v1/data_item.proto"], + ["google.cloud.aiplatform.v1.Annotation", "google/cloud/aiplatform/v1/annotation.proto"], + ["google.cloud.aiplatform.v1.SavedQuery", "google/cloud/aiplatform/v1/saved_query.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 + CreateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDatasetRequest").msgclass + CreateDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDatasetOperationMetadata").msgclass + GetDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetDatasetRequest").msgclass + UpdateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateDatasetRequest").msgclass + UpdateDatasetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateDatasetVersionRequest").msgclass + ListDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDatasetsRequest").msgclass + ListDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDatasetsResponse").msgclass + DeleteDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteDatasetRequest").msgclass + ImportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportDataRequest").msgclass + ImportDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportDataResponse").msgclass + ImportDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportDataOperationMetadata").msgclass + ExportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportDataRequest").msgclass + ExportDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportDataResponse").msgclass + ExportDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportDataOperationMetadata").msgclass + CreateDatasetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDatasetVersionRequest").msgclass + CreateDatasetVersionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDatasetVersionOperationMetadata").msgclass + DeleteDatasetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteDatasetVersionRequest").msgclass + GetDatasetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetDatasetVersionRequest").msgclass + ListDatasetVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDatasetVersionsRequest").msgclass + ListDatasetVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDatasetVersionsResponse").msgclass + RestoreDatasetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RestoreDatasetVersionRequest").msgclass + RestoreDatasetVersionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RestoreDatasetVersionOperationMetadata").msgclass + ListDataItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDataItemsRequest").msgclass + ListDataItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDataItemsResponse").msgclass + SearchDataItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchDataItemsRequest").msgclass + SearchDataItemsRequest::OrderByAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation").msgclass + SearchDataItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchDataItemsResponse").msgclass + DataItemView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DataItemView").msgclass + ListSavedQueriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSavedQueriesRequest").msgclass + ListSavedQueriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSavedQueriesResponse").msgclass + DeleteSavedQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteSavedQueryRequest").msgclass + GetAnnotationSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetAnnotationSpecRequest").msgclass + ListAnnotationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListAnnotationsRequest").msgclass + ListAnnotationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListAnnotationsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb new file mode 100644 index 000000000000..44051d02e1d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb @@ -0,0 +1,83 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/dataset_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/dataset_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module DatasetService + # The service that manages Vertex AI Dataset and its child resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.DatasetService' + + # Creates a Dataset. + rpc :CreateDataset, ::Google::Cloud::AIPlatform::V1::CreateDatasetRequest, ::Google::Longrunning::Operation + # Gets a Dataset. + rpc :GetDataset, ::Google::Cloud::AIPlatform::V1::GetDatasetRequest, ::Google::Cloud::AIPlatform::V1::Dataset + # Updates a Dataset. + rpc :UpdateDataset, ::Google::Cloud::AIPlatform::V1::UpdateDatasetRequest, ::Google::Cloud::AIPlatform::V1::Dataset + # Lists Datasets in a Location. + rpc :ListDatasets, ::Google::Cloud::AIPlatform::V1::ListDatasetsRequest, ::Google::Cloud::AIPlatform::V1::ListDatasetsResponse + # Deletes a Dataset. + rpc :DeleteDataset, ::Google::Cloud::AIPlatform::V1::DeleteDatasetRequest, ::Google::Longrunning::Operation + # Imports data into a Dataset. + rpc :ImportData, ::Google::Cloud::AIPlatform::V1::ImportDataRequest, ::Google::Longrunning::Operation + # Exports data from a Dataset. + rpc :ExportData, ::Google::Cloud::AIPlatform::V1::ExportDataRequest, ::Google::Longrunning::Operation + # Create a version from a Dataset. + rpc :CreateDatasetVersion, ::Google::Cloud::AIPlatform::V1::CreateDatasetVersionRequest, ::Google::Longrunning::Operation + # Updates a DatasetVersion. + rpc :UpdateDatasetVersion, ::Google::Cloud::AIPlatform::V1::UpdateDatasetVersionRequest, ::Google::Cloud::AIPlatform::V1::DatasetVersion + # Deletes a Dataset version. + rpc :DeleteDatasetVersion, ::Google::Cloud::AIPlatform::V1::DeleteDatasetVersionRequest, ::Google::Longrunning::Operation + # Gets a Dataset version. + rpc :GetDatasetVersion, ::Google::Cloud::AIPlatform::V1::GetDatasetVersionRequest, ::Google::Cloud::AIPlatform::V1::DatasetVersion + # Lists DatasetVersions in a Dataset. + rpc :ListDatasetVersions, ::Google::Cloud::AIPlatform::V1::ListDatasetVersionsRequest, ::Google::Cloud::AIPlatform::V1::ListDatasetVersionsResponse + # Restores a dataset version. + rpc :RestoreDatasetVersion, ::Google::Cloud::AIPlatform::V1::RestoreDatasetVersionRequest, ::Google::Longrunning::Operation + # Lists DataItems in a Dataset. + rpc :ListDataItems, ::Google::Cloud::AIPlatform::V1::ListDataItemsRequest, ::Google::Cloud::AIPlatform::V1::ListDataItemsResponse + # Searches DataItems in a Dataset. + rpc :SearchDataItems, ::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest, ::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse + # Lists SavedQueries in a Dataset. + rpc :ListSavedQueries, ::Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest, ::Google::Cloud::AIPlatform::V1::ListSavedQueriesResponse + # Deletes a SavedQuery. + rpc :DeleteSavedQuery, ::Google::Cloud::AIPlatform::V1::DeleteSavedQueryRequest, ::Google::Longrunning::Operation + # Gets an AnnotationSpec. + rpc :GetAnnotationSpec, ::Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest, ::Google::Cloud::AIPlatform::V1::AnnotationSpec + # Lists Annotations belongs to a dataitem + # This RPC is only available in InternalDatasetService. It is only used for + # exporting conversation data to CCAI Insights. + rpc :ListAnnotations, ::Google::Cloud::AIPlatform::V1::ListAnnotationsRequest, ::Google::Cloud::AIPlatform::V1::ListAnnotationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb new file mode 100644 index 000000000000..7da93b0e68f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/dataset_version.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/dataset_version.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x03\n\x0e\x44\x61tasetVersion\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12#\n\x16\x62ig_query_dataset_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x12\x30\n\x08metadata\x18\x08 \x01(\x0b\x32\x16.google.protobuf.ValueB\x06\xe0\x41\x03\xe0\x41\x02\x12\x1c\n\x0fmodel_reference\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03:\x8c\x01\xea\x41\x88\x01\n(aiplatform.googleapis.com/DatasetVersion\x12\\projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13\x44\x61tasetVersionProtoP\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.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + DatasetVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DatasetVersion").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb new file mode 100644 index 000000000000..ec9bc5728de5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/deployed_index_ref.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/deployed_index_ref.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x96\x01\n\x10\x44\x65ployedIndexRef\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x1e\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x42\xd3\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x15\x44\x65ployedIndexRefProtoP\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 = [ + ] + 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 + DeployedIndexRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedIndexRef").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb new file mode 100644 index 000000000000..61219159a32c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/deployed_model_ref.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/deployed_model_ref.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"p\n\x10\x44\x65ployedModelRef\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x05\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x1e\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\tB\x03\xe0\x41\x05\x42\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16\x44\x65ployedModelNameProtoP\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 = [ + ] + 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 + DeployedModelRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedModelRef").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb new file mode 100644 index 000000000000..230e9f776c7c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/deployment_resource_pool.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/aiplatform/v1/deployment_resource_pool.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\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x04\n\x16\x44\x65ploymentResourcePool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12P\n\x13\x64\x65\x64icated_resources\x18\x02 \x01(\x0b\x32..google.cloud.aiplatform.v1.DedicatedResourcesB\x03\xe0\x41\x02\x12\x43\n\x0f\x65ncryption_spec\x18\x05 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x17\n\x0fservice_account\x18\x06 \x01(\t\x12!\n\x19\x64isable_container_logging\x18\x07 \x01(\x08\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\t \x01(\x08\x42\x03\xe0\x41\x03:\x92\x01\xea\x41\x8e\x01\n0aiplatform.googleapis.com/DeploymentResourcePool\x12Zprojects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}B\xd9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1b\x44\x65ploymentResourcePoolProtoP\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.DedicatedResources", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + DeploymentResourcePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeploymentResourcePool").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb new file mode 100644 index 000000000000..b75b3983baa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/deployment_resource_pool_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/deployed_model_ref_pb' +require 'google/cloud/aiplatform/v1/deployment_resource_pool_pb' +require 'google/cloud/aiplatform/v1/endpoint_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nAgoogle/cloud/aiplatform/v1/deployment_resource_pool_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\x33google/cloud/aiplatform/v1/deployed_model_ref.proto\x1a\x39google/cloud/aiplatform/v1/deployment_resource_pool.proto\x1a)google/cloud/aiplatform/v1/endpoint.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xe5\x01\n#CreateDeploymentResourcePoolRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12Y\n\x18\x64\x65ployment_resource_pool\x18\x02 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.DeploymentResourcePoolB\x03\xe0\x41\x02\x12(\n\x1b\x64\x65ployment_resource_pool_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x7f\n-CreateDeploymentResourcePoolOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"j\n GetDeploymentResourcePoolRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0aiplatform.googleapis.com/DeploymentResourcePool\"\x86\x01\n\"ListDeploymentResourcePoolsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x95\x01\n#ListDeploymentResourcePoolsResponse\x12U\n\x19\x64\x65ployment_resource_pools\x18\x01 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.DeploymentResourcePool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb6\x01\n#UpdateDeploymentResourcePoolRequest\x12Y\n\x18\x64\x65ployment_resource_pool\x18\x01 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.DeploymentResourcePoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x7f\n-UpdateDeploymentResourcePoolOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"m\n#DeleteDeploymentResourcePoolRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0aiplatform.googleapis.com/DeploymentResourcePool\"j\n\x1aQueryDeployedModelsRequest\x12%\n\x18\x64\x65ployment_resource_pool\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8b\x02\n\x1bQueryDeployedModelsResponse\x12\x46\n\x0f\x64\x65ployed_models\x18\x01 \x03(\x0b\x32).google.cloud.aiplatform.v1.DeployedModelB\x02\x18\x01\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12I\n\x13\x64\x65ployed_model_refs\x18\x03 \x03(\x0b\x32,.google.cloud.aiplatform.v1.DeployedModelRef\x12\"\n\x1atotal_deployed_model_count\x18\x04 \x01(\x05\x12\x1c\n\x14total_endpoint_count\x18\x05 \x01(\x05\x32\x88\x0e\n\x1d\x44\x65ploymentResourcePoolService\x12\xcf\x02\n\x1c\x43reateDeploymentResourcePool\x12?.google.cloud.aiplatform.v1.CreateDeploymentResourcePoolRequest\x1a\x1d.google.longrunning.Operation\"\xce\x01\xca\x41G\n\x16\x44\x65ploymentResourcePool\x12-CreateDeploymentResourcePoolOperationMetadata\xda\x41;parent,deployment_resource_pool,deployment_resource_pool_id\x82\xd3\xe4\x93\x02@\";/v1/{parent=projects/*/locations/*}/deploymentResourcePools:\x01*\x12\xd9\x01\n\x19GetDeploymentResourcePool\x12<.google.cloud.aiplatform.v1.GetDeploymentResourcePoolRequest\x1a\x32.google.cloud.aiplatform.v1.DeploymentResourcePool\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/deploymentResourcePools/*}\x12\xec\x01\n\x1bListDeploymentResourcePools\x12>.google.cloud.aiplatform.v1.ListDeploymentResourcePoolsRequest\x1a?.google.cloud.aiplatform.v1.ListDeploymentResourcePoolsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*}/deploymentResourcePools\x12\xe8\x02\n\x1cUpdateDeploymentResourcePool\x12?.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest\x1a\x1d.google.longrunning.Operation\"\xe7\x01\xca\x41G\n\x16\x44\x65ploymentResourcePool\x12-UpdateDeploymentResourcePoolOperationMetadata\xda\x41$deployment_resource_pool,update_mask\x82\xd3\xe4\x93\x02p2T/v1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}:\x18\x64\x65ployment_resource_pool\x12\xfd\x01\n\x1c\x44\x65leteDeploymentResourcePool\x12?.google.cloud.aiplatform.v1.DeleteDeploymentResourcePoolRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1/{name=projects/*/locations/*/deploymentResourcePools/*}\x12\x8f\x02\n\x13QueryDeployedModels\x12\x36.google.cloud.aiplatform.v1.QueryDeployedModelsRequest\x1a\x37.google.cloud.aiplatform.v1.QueryDeployedModelsResponse\"\x86\x01\xda\x41\x18\x64\x65ployment_resource_pool\x82\xd3\xe4\x93\x02\x65\x12\x63/v1/{deployment_resource_pool=projects/*/locations/*/deploymentResourcePools/*}:queryDeployedModels\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\"DeploymentResourcePoolServiceProtoP\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.DeploymentResourcePool", "google/cloud/aiplatform/v1/deployment_resource_pool.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.DeployedModel", "google/cloud/aiplatform/v1/endpoint.proto"], + ["google.cloud.aiplatform.v1.DeployedModelRef", "google/cloud/aiplatform/v1/deployed_model_ref.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 + CreateDeploymentResourcePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDeploymentResourcePoolRequest").msgclass + CreateDeploymentResourcePoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDeploymentResourcePoolOperationMetadata").msgclass + GetDeploymentResourcePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetDeploymentResourcePoolRequest").msgclass + ListDeploymentResourcePoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDeploymentResourcePoolsRequest").msgclass + ListDeploymentResourcePoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDeploymentResourcePoolsResponse").msgclass + UpdateDeploymentResourcePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest").msgclass + UpdateDeploymentResourcePoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolOperationMetadata").msgclass + DeleteDeploymentResourcePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteDeploymentResourcePoolRequest").msgclass + QueryDeployedModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryDeployedModelsRequest").msgclass + QueryDeployedModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryDeployedModelsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb new file mode 100644 index 000000000000..40f0f95f3669 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/deployment_resource_pool_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module DeploymentResourcePoolService + # A service that manages the DeploymentResourcePool resource. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.DeploymentResourcePoolService' + + # Create a DeploymentResourcePool. + rpc :CreateDeploymentResourcePool, ::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest, ::Google::Longrunning::Operation + # Get a DeploymentResourcePool. + rpc :GetDeploymentResourcePool, ::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest, ::Google::Cloud::AIPlatform::V1::DeploymentResourcePool + # List DeploymentResourcePools in a location. + rpc :ListDeploymentResourcePools, ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest, ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsResponse + # Update a DeploymentResourcePool. + rpc :UpdateDeploymentResourcePool, ::Google::Cloud::AIPlatform::V1::UpdateDeploymentResourcePoolRequest, ::Google::Longrunning::Operation + # Delete a DeploymentResourcePool. + rpc :DeleteDeploymentResourcePool, ::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest, ::Google::Longrunning::Operation + # List DeployedModels that have been deployed on this DeploymentResourcePool. + rpc :QueryDeployedModels, ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest, ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb new file mode 100644 index 000000000000..ff2e2a732def --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/encryption_spec.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/encryption_spec.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\"+\n\x0e\x45ncryptionSpec\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13\x45ncryptionSpecProtoP\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 = [ + ] + 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 + EncryptionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EncryptionSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_pb.rb new file mode 100644 index 000000000000..08c1c8c57d37 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/endpoint.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/service_networking_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/aiplatform/v1/endpoint.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/explanation.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x33google/cloud/aiplatform/v1/service_networking.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xff\n\n\x08\x45ndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12G\n\x0f\x64\x65ployed_models\x18\x04 \x03(\x0b\x32).google.cloud.aiplatform.v1.DeployedModelB\x03\xe0\x41\x03\x12M\n\rtraffic_split\x18\x05 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.Endpoint.TrafficSplitEntry\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x12@\n\x06labels\x18\x07 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.Endpoint.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x0f\x65ncryption_spec\x18\n \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x37\n\x07network\x18\r \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12*\n\x1e\x65nable_private_service_connect\x18\x11 \x01(\x08\x42\x02\x18\x01\x12\x64\n\x1eprivate_service_connect_config\x18\x15 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.PrivateServiceConnectConfigB\x03\xe0\x41\x01\x12g\n\x1fmodel_deployment_monitoring_job\x18\x0e \x01(\tB>\xe0\x41\x03\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\x12p\n\'predict_request_response_logging_config\x18\x12 \x01(\x0b\x32?.google.cloud.aiplatform.v1.PredictRequestResponseLoggingConfig\x12\"\n\x1a\x64\x65\x64icated_endpoint_enabled\x18\x18 \x01(\x08\x12#\n\x16\x64\x65\x64icated_endpoint_dns\x18\x19 \x01(\tB\x03\xe0\x41\x03\x12T\n\x18\x63lient_connection_config\x18\x17 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.ClientConnectionConfig\x12\x1a\n\rsatisfies_pzs\x18\x1b \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x1c \x01(\x08\x42\x03\xe0\x41\x03\x1a\x33\n\x11TrafficSplitEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb5\x01\xea\x41\xb1\x01\n\"aiplatform.googleapis.com/Endpoint\x12cloud.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.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.PrivateServiceConnectConfig", "google/cloud/aiplatform/v1/service_networking.proto"], + ["google.cloud.aiplatform.v1.DedicatedResources", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.ExplanationSpec", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.cloud.aiplatform.v1.BigQueryDestination", "google/cloud/aiplatform/v1/io.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 + Endpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Endpoint").msgclass + DeployedModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedModel").msgclass + DeployedModel::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedModel.Status").msgclass + PrivateEndpoints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PrivateEndpoints").msgclass + PredictRequestResponseLoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PredictRequestResponseLoggingConfig").msgclass + FasterDeploymentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FasterDeploymentConfig").msgclass + ClientConnectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ClientConnectionConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb new file mode 100644 index 000000000000..2d74c3207baa --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/endpoint_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/endpoint_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/endpoint_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/endpoint.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa9\x01\n\x15\x43reateEndpointRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12;\n\x08\x65ndpoint\x18\x02 \x01(\x0b\x32$.google.cloud.aiplatform.v1.EndpointB\x03\xe0\x41\x02\x12\x18\n\x0b\x65ndpoint_id\x18\x04 \x01(\tB\x03\xe0\x41\x05\"q\n\x1f\x43reateEndpointOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"N\n\x12GetEndpointRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\"\xdd\x01\n\x14ListEndpointsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x10\n\x08order_by\x18\x06 \x01(\t\"i\n\x15ListEndpointsResponse\x12\x37\n\tendpoints\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.Endpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x15UpdateEndpointRequest\x12;\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.EndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"_\n UpdateEndpointLongRunningRequest\x12;\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.EndpointB\x03\xe0\x41\x02\"q\n\x1fUpdateEndpointOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"Q\n\x15\x44\x65leteEndpointRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\"\xa8\x02\n\x12\x44\x65ployModelRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x46\n\x0e\x64\x65ployed_model\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedModelB\x03\xe0\x41\x02\x12W\n\rtraffic_split\x18\x03 \x03(\x0b\x32@.google.cloud.aiplatform.v1.DeployModelRequest.TrafficSplitEntry\x1a\x33\n\x11TrafficSplitEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"X\n\x13\x44\x65ployModelResponse\x12\x41\n\x0e\x64\x65ployed_model\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedModel\"n\n\x1c\x44\x65ployModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x84\x02\n\x14UndeployModelRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x1e\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Y\n\rtraffic_split\x18\x03 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.UndeployModelRequest.TrafficSplitEntry\x1a\x33\n\x11TrafficSplitEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\x17\n\x15UndeployModelResponse\"p\n\x1eUndeployModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xd8\x01\n\x1aMutateDeployedModelRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x46\n\x0e\x64\x65ployed_model\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedModelB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"`\n\x1bMutateDeployedModelResponse\x12\x41\n\x0e\x64\x65ployed_model\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedModel\"v\n$MutateDeployedModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\xad\x11\n\x0f\x45ndpointService\x12\x82\x02\n\x0e\x43reateEndpoint\x12\x31.google.cloud.aiplatform.v1.CreateEndpointRequest\x1a\x1d.google.longrunning.Operation\"\x9d\x01\xca\x41+\n\x08\x45ndpoint\x12\x1f\x43reateEndpointOperationMetadata\xda\x41\x0fparent,endpoint\xda\x41\x1bparent,endpoint,endpoint_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/endpoints:\x08\x65ndpoint\x12\xa1\x01\n\x0bGetEndpoint\x12..google.cloud.aiplatform.v1.GetEndpointRequest\x1a$.google.cloud.aiplatform.v1.Endpoint\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/endpoints/*}\x12\xb4\x01\n\rListEndpoints\x12\x30.google.cloud.aiplatform.v1.ListEndpointsRequest\x1a\x31.google.cloud.aiplatform.v1.ListEndpointsResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/endpoints\x12\xca\x01\n\x0eUpdateEndpoint\x12\x31.google.cloud.aiplatform.v1.UpdateEndpointRequest\x1a$.google.cloud.aiplatform.v1.Endpoint\"_\xda\x41\x14\x65ndpoint,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{endpoint.name=projects/*/locations/*/endpoints/*}:\x08\x65ndpoint\x12\xfc\x01\n\x19UpdateEndpointLongRunning\x12<.google.cloud.aiplatform.v1.UpdateEndpointLongRunningRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41+\n\x08\x45ndpoint\x12\x1fUpdateEndpointOperationMetadata\xda\x41\x08\x65ndpoint\x82\xd3\xe4\x93\x02\x42\"=/v1/{endpoint.name=projects/*/locations/*/endpoints/*}:update:\x01*\x12\xd3\x01\n\x0e\x44\x65leteEndpoint\x12\x31.google.cloud.aiplatform.v1.DeleteEndpointRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/endpoints/*}\x12\x85\x02\n\x0b\x44\x65ployModel\x12..google.cloud.aiplatform.v1.DeployModelRequest\x1a\x1d.google.longrunning.Operation\"\xa6\x01\xca\x41\x33\n\x13\x44\x65ployModelResponse\x12\x1c\x44\x65ployModelOperationMetadata\xda\x41%endpoint,deployed_model,traffic_split\x82\xd3\xe4\x93\x02\x42\"=/v1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel:\x01*\x12\x92\x02\n\rUndeployModel\x12\x30.google.cloud.aiplatform.v1.UndeployModelRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41\x37\n\x15UndeployModelResponse\x12\x1eUndeployModelOperationMetadata\xda\x41(endpoint,deployed_model_id,traffic_split\x82\xd3\xe4\x93\x02\x44\"?/v1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel:\x01*\x12\xab\x02\n\x13MutateDeployedModel\x12\x36.google.cloud.aiplatform.v1.MutateDeployedModelRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41\x43\n\x1bMutateDeployedModelResponse\x12$MutateDeployedModelOperationMetadata\xda\x41#endpoint,deployed_model,update_mask\x82\xd3\xe4\x93\x02J\"E/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x45ndpointServiceProtoP\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.Endpoint", "google/cloud/aiplatform/v1/endpoint.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 + CreateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateEndpointRequest").msgclass + CreateEndpointOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateEndpointOperationMetadata").msgclass + GetEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetEndpointRequest").msgclass + ListEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEndpointsRequest").msgclass + ListEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEndpointsResponse").msgclass + UpdateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateEndpointRequest").msgclass + UpdateEndpointLongRunningRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateEndpointLongRunningRequest").msgclass + UpdateEndpointOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateEndpointOperationMetadata").msgclass + DeleteEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteEndpointRequest").msgclass + DeployModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployModelRequest").msgclass + DeployModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployModelResponse").msgclass + DeployModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployModelOperationMetadata").msgclass + UndeployModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployModelRequest").msgclass + UndeployModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployModelResponse").msgclass + UndeployModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployModelOperationMetadata").msgclass + MutateDeployedModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedModelRequest").msgclass + MutateDeployedModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedModelResponse").msgclass + MutateDeployedModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb new file mode 100644 index 000000000000..db697e3572a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/endpoint_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/endpoint_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module EndpointService + # A service for managing Vertex AI's Endpoints. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.EndpointService' + + # Creates an Endpoint. + rpc :CreateEndpoint, ::Google::Cloud::AIPlatform::V1::CreateEndpointRequest, ::Google::Longrunning::Operation + # Gets an Endpoint. + rpc :GetEndpoint, ::Google::Cloud::AIPlatform::V1::GetEndpointRequest, ::Google::Cloud::AIPlatform::V1::Endpoint + # Lists Endpoints in a Location. + rpc :ListEndpoints, ::Google::Cloud::AIPlatform::V1::ListEndpointsRequest, ::Google::Cloud::AIPlatform::V1::ListEndpointsResponse + # Updates an Endpoint. + rpc :UpdateEndpoint, ::Google::Cloud::AIPlatform::V1::UpdateEndpointRequest, ::Google::Cloud::AIPlatform::V1::Endpoint + # Updates an Endpoint with a long running operation. + rpc :UpdateEndpointLongRunning, ::Google::Cloud::AIPlatform::V1::UpdateEndpointLongRunningRequest, ::Google::Longrunning::Operation + # Deletes an Endpoint. + rpc :DeleteEndpoint, ::Google::Cloud::AIPlatform::V1::DeleteEndpointRequest, ::Google::Longrunning::Operation + # Deploys a Model into this Endpoint, creating a DeployedModel within it. + rpc :DeployModel, ::Google::Cloud::AIPlatform::V1::DeployModelRequest, ::Google::Longrunning::Operation + # Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + # freeing all resources it's using. + rpc :UndeployModel, ::Google::Cloud::AIPlatform::V1::UndeployModelRequest, ::Google::Longrunning::Operation + # Updates an existing deployed model. Updatable fields include + # `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + # `disable_container_logging` (v1 only), and `enable_container_logging` + # (v1beta1 only). + rpc :MutateDeployedModel, ::Google::Cloud::AIPlatform::V1::MutateDeployedModelRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/entity_type_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/entity_type_pb.rb new file mode 100644 index 000000000000..f66128af1f9b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/entity_type_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/entity_type.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/featurestore_monitoring_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/aiplatform/v1/entity_type.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/aiplatform/v1/featurestore_monitoring.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf6\x04\n\nEntityType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\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\x12G\n\x06labels\x18\x06 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.EntityType.LabelsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12X\n\x11monitoring_config\x18\x08 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfigB\x03\xe0\x41\x01\x12%\n\x18offline_storage_ttl_days\x18\n \x01(\x05\x42\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x8a\x01\xea\x41\x86\x01\n$aiplatform.googleapis.com/EntityType\x12^projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}B\xcd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0f\x45ntityTypeProtoP\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.cloud.aiplatform.v1.FeaturestoreMonitoringConfig", "google/cloud/aiplatform/v1/featurestore_monitoring.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 + EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EntityType").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/env_var_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/env_var_pb.rb new file mode 100644 index 000000000000..6951052b8e30 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/env_var_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/env_var.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/env_var.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"/\n\x06\x45nvVar\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\xc9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0b\x45nvVarProtoP\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 = [ + ] + 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 + EnvVar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EnvVar").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb new file mode 100644 index 000000000000..e7a97874909e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/evaluated_annotation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/evaluated_annotation.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xe5\x04\n\x13\x45valuatedAnnotation\x12Z\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationTypeB\x03\xe0\x41\x03\x12\x30\n\x0bpredictions\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12\x32\n\rground_truths\x18\x03 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12\x36\n\x11\x64\x61ta_item_payload\x18\x05 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12(\n\x1b\x65valuated_data_item_view_id\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12P\n\x0c\x65xplanations\x18\x08 \x03(\x0b\x32:.google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation\x12W\n\x1a\x65rror_analysis_annotations\x18\t \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.ErrorAnalysisAnnotation\"\x7f\n\x17\x45valuatedAnnotationType\x12)\n%EVALUATED_ANNOTATION_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rTRUE_POSITIVE\x10\x01\x12\x12\n\x0e\x46\x41LSE_POSITIVE\x10\x02\x12\x12\n\x0e\x46\x41LSE_NEGATIVE\x10\x03\"x\n\x1e\x45valuatedAnnotationExplanation\x12\x18\n\x10\x65xplanation_type\x18\x01 \x01(\t\x12<\n\x0b\x65xplanation\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.Explanation\"\xaf\x03\n\x17\x45rrorAnalysisAnnotation\x12\\\n\x10\x61ttributed_items\x18\x01 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.ErrorAnalysisAnnotation.AttributedItem\x12Q\n\nquery_type\x18\x02 \x01(\x0e\x32=.google.cloud.aiplatform.v1.ErrorAnalysisAnnotation.QueryType\x12\x15\n\routlier_score\x18\x03 \x01(\x01\x12\x19\n\x11outlier_threshold\x18\x04 \x01(\x01\x1a\x44\n\x0e\x41ttributedItem\x12 \n\x18\x61nnotation_resource_name\x18\x01 \x01(\t\x12\x10\n\x08\x64istance\x18\x02 \x01(\x01\"k\n\tQueryType\x12\x1a\n\x16QUERY_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41LL_SIMILAR\x10\x01\x12\x16\n\x12SAME_CLASS_SIMILAR\x10\x02\x12\x19\n\x15SAME_CLASS_DISSIMILAR\x10\x03\x42\xd6\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x18\x45valuatedAnnotationProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.Explanation", "google/cloud/aiplatform/v1/explanation.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 + EvaluatedAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EvaluatedAnnotation").msgclass + EvaluatedAnnotation::EvaluatedAnnotationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationType").enummodule + EvaluatedAnnotationExplanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation").msgclass + ErrorAnalysisAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ErrorAnalysisAnnotation").msgclass + ErrorAnalysisAnnotation::AttributedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ErrorAnalysisAnnotation.AttributedItem").msgclass + ErrorAnalysisAnnotation::QueryType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ErrorAnalysisAnnotation.QueryType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_pb.rb new file mode 100644 index 000000000000..27a711b3d965 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_pb.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/evaluation_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' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/evaluation_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\"\xda\x11\n\x18\x45valuateInstancesRequest\x12H\n\x11\x65xact_match_input\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ExactMatchInputH\x00\x12;\n\nbleu_input\x18\x03 \x01(\x0b\x32%.google.cloud.aiplatform.v1.BleuInputH\x00\x12=\n\x0brouge_input\x18\x04 \x01(\x0b\x32&.google.cloud.aiplatform.v1.RougeInputH\x00\x12\x41\n\rfluency_input\x18\x05 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FluencyInputH\x00\x12\x45\n\x0f\x63oherence_input\x18\x06 \x01(\x0b\x32*.google.cloud.aiplatform.v1.CoherenceInputH\x00\x12?\n\x0csafety_input\x18\x08 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.SafetyInputH\x00\x12K\n\x12groundedness_input\x18\t \x01(\x0b\x32-.google.cloud.aiplatform.v1.GroundednessInputH\x00\x12I\n\x11\x66ulfillment_input\x18\x0c \x01(\x0b\x32,.google.cloud.aiplatform.v1.FulfillmentInputH\x00\x12\\\n\x1bsummarization_quality_input\x18\x07 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.SummarizationQualityInputH\x00\x12m\n$pairwise_summarization_quality_input\x18\x17 \x01(\x0b\x32=.google.cloud.aiplatform.v1.PairwiseSummarizationQualityInputH\x00\x12\x64\n\x1fsummarization_helpfulness_input\x18\x0e \x01(\x0b\x32\x39.google.cloud.aiplatform.v1.SummarizationHelpfulnessInputH\x00\x12`\n\x1dsummarization_verbosity_input\x18\x0f \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.SummarizationVerbosityInputH\x00\x12\x65\n question_answering_quality_input\x18\n \x01(\x0b\x32\x39.google.cloud.aiplatform.v1.QuestionAnsweringQualityInputH\x00\x12v\n)pairwise_question_answering_quality_input\x18\x18 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityInputH\x00\x12i\n\"question_answering_relevance_input\x18\x10 \x01(\x0b\x32;.google.cloud.aiplatform.v1.QuestionAnsweringRelevanceInputH\x00\x12m\n$question_answering_helpfulness_input\x18\x11 \x01(\x0b\x32=.google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessInputH\x00\x12m\n$question_answering_correctness_input\x18\x12 \x01(\x0b\x32=.google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessInputH\x00\x12R\n\x16pointwise_metric_input\x18\x1c \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.PointwiseMetricInputH\x00\x12P\n\x15pairwise_metric_input\x18\x1d \x01(\x0b\x32/.google.cloud.aiplatform.v1.PairwiseMetricInputH\x00\x12O\n\x15tool_call_valid_input\x18\x13 \x01(\x0b\x32..google.cloud.aiplatform.v1.ToolCallValidInputH\x00\x12O\n\x15tool_name_match_input\x18\x14 \x01(\x0b\x32..google.cloud.aiplatform.v1.ToolNameMatchInputH\x00\x12`\n\x1etool_parameter_key_match_input\x18\x15 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.ToolParameterKeyMatchInputH\x00\x12^\n\x1dtool_parameter_kv_match_input\x18\x16 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.ToolParameterKVMatchInputH\x00\x12=\n\x0b\x63omet_input\x18\x1f \x01(\x0b\x32&.google.cloud.aiplatform.v1.CometInputH\x00\x12\x41\n\rmetricx_input\x18 \x01(\x0b\x32(.google.cloud.aiplatform.v1.MetricxInputH\x00\x12;\n\x08location\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/LocationB\x0f\n\rmetric_inputs\"\xe3\x11\n\x19\x45valuateInstancesResponse\x12L\n\x13\x65xact_match_results\x18\x01 \x01(\x0b\x32-.google.cloud.aiplatform.v1.ExactMatchResultsH\x00\x12?\n\x0c\x62leu_results\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.BleuResultsH\x00\x12\x41\n\rrouge_results\x18\x03 \x01(\x0b\x32(.google.cloud.aiplatform.v1.RougeResultsH\x00\x12\x43\n\x0e\x66luency_result\x18\x04 \x01(\x0b\x32).google.cloud.aiplatform.v1.FluencyResultH\x00\x12G\n\x10\x63oherence_result\x18\x05 \x01(\x0b\x32+.google.cloud.aiplatform.v1.CoherenceResultH\x00\x12\x41\n\rsafety_result\x18\x07 \x01(\x0b\x32(.google.cloud.aiplatform.v1.SafetyResultH\x00\x12M\n\x13groundedness_result\x18\x08 \x01(\x0b\x32..google.cloud.aiplatform.v1.GroundednessResultH\x00\x12K\n\x12\x66ulfillment_result\x18\x0b \x01(\x0b\x32-.google.cloud.aiplatform.v1.FulfillmentResultH\x00\x12^\n\x1csummarization_quality_result\x18\x06 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.SummarizationQualityResultH\x00\x12o\n%pairwise_summarization_quality_result\x18\x16 \x01(\x0b\x32>.google.cloud.aiplatform.v1.PairwiseSummarizationQualityResultH\x00\x12\x66\n summarization_helpfulness_result\x18\r \x01(\x0b\x32:.google.cloud.aiplatform.v1.SummarizationHelpfulnessResultH\x00\x12\x62\n\x1esummarization_verbosity_result\x18\x0e \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.SummarizationVerbosityResultH\x00\x12g\n!question_answering_quality_result\x18\t \x01(\x0b\x32:.google.cloud.aiplatform.v1.QuestionAnsweringQualityResultH\x00\x12x\n*pairwise_question_answering_quality_result\x18\x17 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityResultH\x00\x12k\n#question_answering_relevance_result\x18\x0f \x01(\x0b\x32<.google.cloud.aiplatform.v1.QuestionAnsweringRelevanceResultH\x00\x12o\n%question_answering_helpfulness_result\x18\x10 \x01(\x0b\x32>.google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessResultH\x00\x12o\n%question_answering_correctness_result\x18\x11 \x01(\x0b\x32>.google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessResultH\x00\x12T\n\x17pointwise_metric_result\x18\x1b \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.PointwiseMetricResultH\x00\x12R\n\x16pairwise_metric_result\x18\x1c \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.PairwiseMetricResultH\x00\x12S\n\x17tool_call_valid_results\x18\x12 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ToolCallValidResultsH\x00\x12S\n\x17tool_name_match_results\x18\x13 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ToolNameMatchResultsH\x00\x12\x64\n tool_parameter_key_match_results\x18\x14 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.ToolParameterKeyMatchResultsH\x00\x12\x62\n\x1ftool_parameter_kv_match_results\x18\x15 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.ToolParameterKVMatchResultsH\x00\x12?\n\x0c\x63omet_result\x18\x1d \x01(\x0b\x32\'.google.cloud.aiplatform.v1.CometResultH\x00\x12\x43\n\x0emetricx_result\x18\x1e \x01(\x0b\x32).google.cloud.aiplatform.v1.MetricxResultH\x00\x42\x14\n\x12\x65valuation_results\"\x9f\x01\n\x0f\x45xactMatchInput\x12\x44\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.ExactMatchSpecB\x03\xe0\x41\x02\x12\x46\n\tinstances\x18\x02 \x03(\x0b\x32..google.cloud.aiplatform.v1.ExactMatchInstanceB\x03\xe0\x41\x02\"l\n\x12\x45xactMatchInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"\x10\n\x0e\x45xactMatchSpec\"n\n\x11\x45xactMatchResults\x12Y\n\x19\x65xact_match_metric_values\x18\x01 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.ExactMatchMetricValueB\x03\xe0\x41\x03\":\n\x15\x45xactMatchMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\x8d\x01\n\tBleuInput\x12>\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.BleuSpecB\x03\xe0\x41\x02\x12@\n\tinstances\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.BleuInstanceB\x03\xe0\x41\x02\"f\n\x0c\x42leuInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\",\n\x08\x42leuSpec\x12 \n\x13use_effective_order\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"[\n\x0b\x42leuResults\x12L\n\x12\x62leu_metric_values\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.BleuMetricValueB\x03\xe0\x41\x03\"4\n\x0f\x42leuMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\x90\x01\n\nRougeInput\x12?\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.RougeSpecB\x03\xe0\x41\x02\x12\x41\n\tinstances\x18\x02 \x03(\x0b\x32).google.cloud.aiplatform.v1.RougeInstanceB\x03\xe0\x41\x02\"g\n\rRougeInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"\\\n\tRougeSpec\x12\x17\n\nrouge_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0buse_stemmer\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0fsplit_summaries\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"^\n\x0cRougeResults\x12N\n\x13rouge_metric_values\x18\x01 \x03(\x0b\x32,.google.cloud.aiplatform.v1.RougeMetricValueB\x03\xe0\x41\x03\"5\n\x10RougeMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\x9b\x01\n\x0e\x43oherenceInput\x12\x43\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.CoherenceSpecB\x03\xe0\x41\x02\x12\x44\n\x08instance\x18\x02 \x01(\x0b\x32-.google.cloud.aiplatform.v1.CoherenceInstanceB\x03\xe0\x41\x02\"@\n\x11\x43oherenceInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_prediction\"%\n\rCoherenceSpec\x12\x14\n\x07version\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\"{\n\x0f\x43oherenceResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\x95\x01\n\x0c\x46luencyInput\x12\x41\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.FluencySpecB\x03\xe0\x41\x02\x12\x42\n\x08instance\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FluencyInstanceB\x03\xe0\x41\x02\">\n\x0f\x46luencyInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_prediction\"#\n\x0b\x46luencySpec\x12\x14\n\x07version\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\"y\n\rFluencyResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\x92\x01\n\x0bSafetyInput\x12@\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32&.google.cloud.aiplatform.v1.SafetySpecB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.SafetyInstanceB\x03\xe0\x41\x02\"=\n\x0eSafetyInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_prediction\"\"\n\nSafetySpec\x12\x14\n\x07version\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\"x\n\x0cSafetyResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xa4\x01\n\x11GroundednessInput\x12\x46\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GroundednessSpecB\x03\xe0\x41\x02\x12G\n\x08instance\x18\x02 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.GroundednessInstanceB\x03\xe0\x41\x02\"j\n\x14GroundednessInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\n\n\x08_context\"(\n\x10GroundednessSpec\x12\x14\n\x07version\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\"~\n\x12GroundednessResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xa1\x01\n\x10\x46ulfillmentInput\x12\x45\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FulfillmentSpecB\x03\xe0\x41\x02\x12\x46\n\x08instance\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.FulfillmentInstanceB\x03\xe0\x41\x02\"q\n\x13\x46ulfillmentInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0e\n\x0c_instruction\"\'\n\x0f\x46ulfillmentSpec\x12\x14\n\x07version\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\"}\n\x11\x46ulfillmentResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xbc\x01\n\x19SummarizationQualityInput\x12N\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.SummarizationQualitySpecB\x03\xe0\x41\x02\x12O\n\x08instance\x18\x02 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.SummarizationQualityInstanceB\x03\xe0\x41\x02\"\xcc\x01\n\x1cSummarizationQualityInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x02H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"L\n\x18SummarizationQualitySpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x86\x01\n\x1aSummarizationQualityResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xd4\x01\n!PairwiseSummarizationQualityInput\x12V\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32<.google.cloud.aiplatform.v1.PairwiseSummarizationQualitySpecB\x03\xe0\x41\x02\x12W\n\x08instance\x18\x02 \x01(\x0b\x32@.google.cloud.aiplatform.v1.PairwiseSummarizationQualityInstanceB\x03\xe0\x41\x02\"\x93\x02\n$PairwiseSummarizationQualityInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12%\n\x13\x62\x61seline_prediction\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x12\x1b\n\treference\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x05 \x01(\tB\x03\xe0\x41\x02H\x04\x88\x01\x01\x42\r\n\x0b_predictionB\x16\n\x14_baseline_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"T\n PairwiseSummarizationQualitySpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xb5\x01\n\"PairwiseSummarizationQualityResult\x12H\n\x0fpairwise_choice\x18\x01 \x01(\x0e\x32*.google.cloud.aiplatform.v1.PairwiseChoiceB\x03\xe0\x41\x03\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\r\n\x0b_confidence\"\xc8\x01\n\x1dSummarizationHelpfulnessInput\x12R\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.SummarizationHelpfulnessSpecB\x03\xe0\x41\x02\x12S\n\x08instance\x18\x02 \x01(\x0b\x32<.google.cloud.aiplatform.v1.SummarizationHelpfulnessInstanceB\x03\xe0\x41\x02\"\xd0\x01\n SummarizationHelpfulnessInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x02H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"P\n\x1cSummarizationHelpfulnessSpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8a\x01\n\x1eSummarizationHelpfulnessResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xc2\x01\n\x1bSummarizationVerbosityInput\x12P\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.SummarizationVerbositySpecB\x03\xe0\x41\x02\x12Q\n\x08instance\x18\x02 \x01(\x0b\x32:.google.cloud.aiplatform.v1.SummarizationVerbosityInstanceB\x03\xe0\x41\x02\"\xce\x01\n\x1eSummarizationVerbosityInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x02H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"N\n\x1aSummarizationVerbositySpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x88\x01\n\x1cSummarizationVerbosityResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xc8\x01\n\x1dQuestionAnsweringQualityInput\x12R\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.QuestionAnsweringQualitySpecB\x03\xe0\x41\x02\x12S\n\x08instance\x18\x02 \x01(\x0b\x32<.google.cloud.aiplatform.v1.QuestionAnsweringQualityInstanceB\x03\xe0\x41\x02\"\xd0\x01\n QuestionAnsweringQualityInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x02H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"P\n\x1cQuestionAnsweringQualitySpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8a\x01\n\x1eQuestionAnsweringQualityResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xe0\x01\n%PairwiseQuestionAnsweringQualityInput\x12Z\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32@.google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualitySpecB\x03\xe0\x41\x02\x12[\n\x08instance\x18\x02 \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityInstanceB\x03\xe0\x41\x02\"\x97\x02\n(PairwiseQuestionAnsweringQualityInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12%\n\x13\x62\x61seline_prediction\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x12\x1b\n\treference\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x05 \x01(\tB\x03\xe0\x41\x02H\x04\x88\x01\x01\x42\r\n\x0b_predictionB\x16\n\x14_baseline_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"X\n$PairwiseQuestionAnsweringQualitySpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xb9\x01\n&PairwiseQuestionAnsweringQualityResult\x12H\n\x0fpairwise_choice\x18\x01 \x01(\x0e\x32*.google.cloud.aiplatform.v1.PairwiseChoiceB\x03\xe0\x41\x03\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\r\n\x0b_confidence\"\xce\x01\n\x1fQuestionAnsweringRelevanceInput\x12T\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32:.google.cloud.aiplatform.v1.QuestionAnsweringRelevanceSpecB\x03\xe0\x41\x02\x12U\n\x08instance\x18\x02 \x01(\x0b\x32>.google.cloud.aiplatform.v1.QuestionAnsweringRelevanceInstanceB\x03\xe0\x41\x02\"\xd2\x01\n\"QuestionAnsweringRelevanceInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"R\n\x1eQuestionAnsweringRelevanceSpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8c\x01\n QuestionAnsweringRelevanceResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xd4\x01\n!QuestionAnsweringHelpfulnessInput\x12V\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32<.google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessSpecB\x03\xe0\x41\x02\x12W\n\x08instance\x18\x02 \x01(\x0b\x32@.google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessInstanceB\x03\xe0\x41\x02\"\xd4\x01\n$QuestionAnsweringHelpfulnessInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"T\n QuestionAnsweringHelpfulnessSpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8e\x01\n\"QuestionAnsweringHelpfulnessResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xd4\x01\n!QuestionAnsweringCorrectnessInput\x12V\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32<.google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessSpecB\x03\xe0\x41\x02\x12W\n\x08instance\x18\x02 \x01(\x0b\x32@.google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessInstanceB\x03\xe0\x41\x02\"\xd4\x01\n$QuestionAnsweringCorrectnessInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x19\n\x07\x63ontext\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1d\n\x0binstruction\x18\x04 \x01(\tB\x03\xe0\x41\x02H\x03\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\n\n\x08_contextB\x0e\n\x0c_instruction\"T\n QuestionAnsweringCorrectnessSpec\x12\x1a\n\ruse_reference\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8e\x01\n\"QuestionAnsweringCorrectnessResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\nconfidence\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x08\n\x06_scoreB\r\n\x0b_confidence\"\xad\x01\n\x14PointwiseMetricInput\x12I\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32/.google.cloud.aiplatform.v1.PointwiseMetricSpecB\x03\xe0\x41\x02\x12J\n\x08instance\x18\x02 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.PointwiseMetricInstanceB\x03\xe0\x41\x02\">\n\x17PointwiseMetricInstance\x12\x17\n\rjson_instance\x18\x01 \x01(\tH\x00\x42\n\n\x08instance\"Z\n\x13PointwiseMetricSpec\x12(\n\x16metric_prompt_template\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\x19\n\x17_metric_prompt_template\"T\n\x15PointwiseMetricResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\x42\x08\n\x06_score\"\xaa\x01\n\x13PairwiseMetricInput\x12H\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32..google.cloud.aiplatform.v1.PairwiseMetricSpecB\x03\xe0\x41\x02\x12I\n\x08instance\x18\x02 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.PairwiseMetricInstanceB\x03\xe0\x41\x02\"=\n\x16PairwiseMetricInstance\x12\x17\n\rjson_instance\x18\x01 \x01(\tH\x00\x42\n\n\x08instance\"Y\n\x12PairwiseMetricSpec\x12(\n\x16metric_prompt_template\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\x19\n\x17_metric_prompt_template\"z\n\x14PairwiseMetricResult\x12H\n\x0fpairwise_choice\x18\x01 \x01(\x0e\x32*.google.cloud.aiplatform.v1.PairwiseChoiceB\x03\xe0\x41\x03\x12\x18\n\x0b\x65xplanation\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xa8\x01\n\x12ToolCallValidInput\x12G\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32-.google.cloud.aiplatform.v1.ToolCallValidSpecB\x03\xe0\x41\x02\x12I\n\tinstances\x18\x02 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.ToolCallValidInstanceB\x03\xe0\x41\x02\"\x13\n\x11ToolCallValidSpec\"o\n\x15ToolCallValidInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"x\n\x14ToolCallValidResults\x12`\n\x1dtool_call_valid_metric_values\x18\x01 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.ToolCallValidMetricValueB\x03\xe0\x41\x03\"=\n\x18ToolCallValidMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\xa8\x01\n\x12ToolNameMatchInput\x12G\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32-.google.cloud.aiplatform.v1.ToolNameMatchSpecB\x03\xe0\x41\x02\x12I\n\tinstances\x18\x02 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.ToolNameMatchInstanceB\x03\xe0\x41\x02\"\x13\n\x11ToolNameMatchSpec\"o\n\x15ToolNameMatchInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"x\n\x14ToolNameMatchResults\x12`\n\x1dtool_name_match_metric_values\x18\x01 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.ToolNameMatchMetricValueB\x03\xe0\x41\x03\"=\n\x18ToolNameMatchMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\xc0\x01\n\x1aToolParameterKeyMatchInput\x12O\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.ToolParameterKeyMatchSpecB\x03\xe0\x41\x02\x12Q\n\tinstances\x18\x02 \x03(\x0b\x32\x39.google.cloud.aiplatform.v1.ToolParameterKeyMatchInstanceB\x03\xe0\x41\x02\"\x1b\n\x19ToolParameterKeyMatchSpec\"w\n\x1dToolParameterKeyMatchInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"\x91\x01\n\x1cToolParameterKeyMatchResults\x12q\n&tool_parameter_key_match_metric_values\x18\x01 \x03(\x0b\x32<.google.cloud.aiplatform.v1.ToolParameterKeyMatchMetricValueB\x03\xe0\x41\x03\"E\n ToolParameterKeyMatchMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\xbd\x01\n\x19ToolParameterKVMatchInput\x12N\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.ToolParameterKVMatchSpecB\x03\xe0\x41\x02\x12P\n\tinstances\x18\x02 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.ToolParameterKVMatchInstanceB\x03\xe0\x41\x02\"@\n\x18ToolParameterKVMatchSpec\x12$\n\x17use_strict_string_match\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"v\n\x1cToolParameterKVMatchInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_reference\"\x8e\x01\n\x1bToolParameterKVMatchResults\x12o\n%tool_parameter_kv_match_metric_values\x18\x01 \x03(\x0b\x32;.google.cloud.aiplatform.v1.ToolParameterKVMatchMetricValueB\x03\xe0\x41\x03\"D\n\x1fToolParameterKVMatchMetricValue\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\x8f\x01\n\nCometInput\x12?\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.CometSpecB\x03\xe0\x41\x02\x12@\n\x08instance\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.CometInstanceB\x03\xe0\x41\x02\"\xe7\x01\n\tCometSpec\x12M\n\x07version\x18\x01 \x01(\x0e\x32\x32.google.cloud.aiplatform.v1.CometSpec.CometVersionB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1c\n\x0fsource_language\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0ftarget_language\x18\x03 \x01(\tB\x03\xe0\x41\x01\"C\n\x0c\x43ometVersion\x12\x1d\n\x19\x43OMET_VERSION_UNSPECIFIED\x10\x00\x12\x14\n\x10\x43OMET_22_SRC_REF\x10\x02\x42\n\n\x08_version\"\x8c\x01\n\rCometInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x18\n\x06source\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\t\n\x07_source\"0\n\x0b\x43ometResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score\"\x95\x01\n\x0cMetricxInput\x12\x41\n\x0bmetric_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MetricxSpecB\x03\xe0\x41\x02\x12\x42\n\x08instance\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.MetricxInstanceB\x03\xe0\x41\x02\"\x9b\x02\n\x0bMetricxSpec\x12Q\n\x07version\x18\x01 \x01(\x0e\x32\x36.google.cloud.aiplatform.v1.MetricxSpec.MetricxVersionB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1c\n\x0fsource_language\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0ftarget_language\x18\x03 \x01(\tB\x03\xe0\x41\x01\"q\n\x0eMetricxVersion\x12\x1f\n\x1bMETRICX_VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0eMETRICX_24_REF\x10\x01\x12\x12\n\x0eMETRICX_24_SRC\x10\x02\x12\x16\n\x12METRICX_24_SRC_REF\x10\x03\x42\n\n\x08_version\"\x8e\x01\n\x0fMetricxInstance\x12\x1c\n\nprediction\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x1b\n\treference\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x18\n\x06source\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\r\n\x0b_predictionB\x0c\n\n_referenceB\t\n\x07_source\"2\n\rMetricxResult\x12\x17\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x08\n\x06_score*W\n\x0ePairwiseChoice\x12\x1f\n\x1bPAIRWISE_CHOICE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x42\x41SELINE\x10\x01\x12\r\n\tCANDIDATE\x10\x02\x12\x07\n\x03TIE\x10\x03\x32\xa9\x02\n\x11\x45valuationService\x12\xc4\x01\n\x11\x45valuateInstances\x12\x34.google.cloud.aiplatform.v1.EvaluateInstancesRequest\x1a\x35.google.cloud.aiplatform.v1.EvaluateInstancesResponse\"B\x82\xd3\xe4\x93\x02<\"7/v1/{location=projects/*/locations/*}:evaluateInstances:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16\x45valuationServiceProtoP\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 = [ + ] + 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 + EvaluateInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EvaluateInstancesRequest").msgclass + EvaluateInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EvaluateInstancesResponse").msgclass + ExactMatchInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExactMatchInput").msgclass + ExactMatchInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExactMatchInstance").msgclass + ExactMatchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExactMatchSpec").msgclass + ExactMatchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExactMatchResults").msgclass + ExactMatchMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExactMatchMetricValue").msgclass + BleuInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BleuInput").msgclass + BleuInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BleuInstance").msgclass + BleuSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BleuSpec").msgclass + BleuResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BleuResults").msgclass + BleuMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BleuMetricValue").msgclass + RougeInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RougeInput").msgclass + RougeInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RougeInstance").msgclass + RougeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RougeSpec").msgclass + RougeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RougeResults").msgclass + RougeMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RougeMetricValue").msgclass + CoherenceInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CoherenceInput").msgclass + CoherenceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CoherenceInstance").msgclass + CoherenceSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CoherenceSpec").msgclass + CoherenceResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CoherenceResult").msgclass + FluencyInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FluencyInput").msgclass + FluencyInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FluencyInstance").msgclass + FluencySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FluencySpec").msgclass + FluencyResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FluencyResult").msgclass + SafetyInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyInput").msgclass + SafetyInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyInstance").msgclass + SafetySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetySpec").msgclass + SafetyResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SafetyResult").msgclass + GroundednessInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundednessInput").msgclass + GroundednessInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundednessInstance").msgclass + GroundednessSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundednessSpec").msgclass + GroundednessResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GroundednessResult").msgclass + FulfillmentInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FulfillmentInput").msgclass + FulfillmentInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FulfillmentInstance").msgclass + FulfillmentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FulfillmentSpec").msgclass + FulfillmentResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FulfillmentResult").msgclass + SummarizationQualityInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationQualityInput").msgclass + SummarizationQualityInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationQualityInstance").msgclass + SummarizationQualitySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationQualitySpec").msgclass + SummarizationQualityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationQualityResult").msgclass + PairwiseSummarizationQualityInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseSummarizationQualityInput").msgclass + PairwiseSummarizationQualityInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseSummarizationQualityInstance").msgclass + PairwiseSummarizationQualitySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseSummarizationQualitySpec").msgclass + PairwiseSummarizationQualityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseSummarizationQualityResult").msgclass + SummarizationHelpfulnessInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationHelpfulnessInput").msgclass + SummarizationHelpfulnessInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationHelpfulnessInstance").msgclass + SummarizationHelpfulnessSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationHelpfulnessSpec").msgclass + SummarizationHelpfulnessResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationHelpfulnessResult").msgclass + SummarizationVerbosityInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationVerbosityInput").msgclass + SummarizationVerbosityInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationVerbosityInstance").msgclass + SummarizationVerbositySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationVerbositySpec").msgclass + SummarizationVerbosityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SummarizationVerbosityResult").msgclass + QuestionAnsweringQualityInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringQualityInput").msgclass + QuestionAnsweringQualityInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringQualityInstance").msgclass + QuestionAnsweringQualitySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringQualitySpec").msgclass + QuestionAnsweringQualityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringQualityResult").msgclass + PairwiseQuestionAnsweringQualityInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityInput").msgclass + PairwiseQuestionAnsweringQualityInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityInstance").msgclass + PairwiseQuestionAnsweringQualitySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualitySpec").msgclass + PairwiseQuestionAnsweringQualityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseQuestionAnsweringQualityResult").msgclass + QuestionAnsweringRelevanceInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringRelevanceInput").msgclass + QuestionAnsweringRelevanceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringRelevanceInstance").msgclass + QuestionAnsweringRelevanceSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringRelevanceSpec").msgclass + QuestionAnsweringRelevanceResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringRelevanceResult").msgclass + QuestionAnsweringHelpfulnessInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessInput").msgclass + QuestionAnsweringHelpfulnessInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessInstance").msgclass + QuestionAnsweringHelpfulnessSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessSpec").msgclass + QuestionAnsweringHelpfulnessResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringHelpfulnessResult").msgclass + QuestionAnsweringCorrectnessInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessInput").msgclass + QuestionAnsweringCorrectnessInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessInstance").msgclass + QuestionAnsweringCorrectnessSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessSpec").msgclass + QuestionAnsweringCorrectnessResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QuestionAnsweringCorrectnessResult").msgclass + PointwiseMetricInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PointwiseMetricInput").msgclass + PointwiseMetricInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PointwiseMetricInstance").msgclass + PointwiseMetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PointwiseMetricSpec").msgclass + PointwiseMetricResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PointwiseMetricResult").msgclass + PairwiseMetricInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseMetricInput").msgclass + PairwiseMetricInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseMetricInstance").msgclass + PairwiseMetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseMetricSpec").msgclass + PairwiseMetricResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseMetricResult").msgclass + ToolCallValidInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolCallValidInput").msgclass + ToolCallValidSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolCallValidSpec").msgclass + ToolCallValidInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolCallValidInstance").msgclass + ToolCallValidResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolCallValidResults").msgclass + ToolCallValidMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolCallValidMetricValue").msgclass + ToolNameMatchInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolNameMatchInput").msgclass + ToolNameMatchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolNameMatchSpec").msgclass + ToolNameMatchInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolNameMatchInstance").msgclass + ToolNameMatchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolNameMatchResults").msgclass + ToolNameMatchMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolNameMatchMetricValue").msgclass + ToolParameterKeyMatchInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKeyMatchInput").msgclass + ToolParameterKeyMatchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKeyMatchSpec").msgclass + ToolParameterKeyMatchInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKeyMatchInstance").msgclass + ToolParameterKeyMatchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKeyMatchResults").msgclass + ToolParameterKeyMatchMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKeyMatchMetricValue").msgclass + ToolParameterKVMatchInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKVMatchInput").msgclass + ToolParameterKVMatchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKVMatchSpec").msgclass + ToolParameterKVMatchInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKVMatchInstance").msgclass + ToolParameterKVMatchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKVMatchResults").msgclass + ToolParameterKVMatchMetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolParameterKVMatchMetricValue").msgclass + CometInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CometInput").msgclass + CometSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CometSpec").msgclass + CometSpec::CometVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CometSpec.CometVersion").enummodule + CometInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CometInstance").msgclass + CometResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CometResult").msgclass + MetricxInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetricxInput").msgclass + MetricxSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetricxSpec").msgclass + MetricxSpec::MetricxVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetricxSpec.MetricxVersion").enummodule + MetricxInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetricxInstance").msgclass + MetricxResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetricxResult").msgclass + PairwiseChoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PairwiseChoice").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_services_pb.rb new file mode 100644 index 000000000000..afcdea347958 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/evaluation_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/evaluation_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/evaluation_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module EvaluationService + # Vertex AI Online Evaluation Service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.EvaluationService' + + # Evaluates instances based on a given metric. + rpc :EvaluateInstances, ::Google::Cloud::AIPlatform::V1::EvaluateInstancesRequest, ::Google::Cloud::AIPlatform::V1::EvaluateInstancesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/event_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/event_pb.rb new file mode 100644 index 000000000000..fbdfd66ae1ec --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/event_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/event.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x98\x03\n\x05\x45vent\x12<\n\x08\x61rtifact\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\x12>\n\texecution\x18\x02 \x01(\tB+\xe0\x41\x03\xfa\x41%\n#aiplatform.googleapis.com/Execution\x12\x33\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x04type\x18\x04 \x01(\x0e\x32&.google.cloud.aiplatform.v1.Event.TypeB\x03\xe0\x41\x02\x12=\n\x06labels\x18\x05 \x03(\x0b\x32-.google.cloud.aiplatform.v1.Event.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"3\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05INPUT\x10\x01\x12\n\n\x06OUTPUT\x10\x02\x42\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nEventProtoP\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"], + ] + 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 + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Event").msgclass + Event::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Event.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/execution_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/execution_pb.rb new file mode 100644 index 000000000000..b465a55c1d5d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/execution_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/execution.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/aiplatform/v1/execution.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x05\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12:\n\x05state\x18\x06 \x01(\x0e\x32+.google.cloud.aiplatform.v1.Execution.State\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x41\n\x06labels\x18\n \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.Execution.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0cschema_title\x18\r \x01(\t\x12\x16\n\x0eschema_version\x18\x0e \x01(\t\x12)\n\x08metadata\x18\x0f \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x13\n\x0b\x64\x65scription\x18\x10 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"i\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08\x43OMPLETE\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\n\n\x06\x43\x41\x43HED\x10\x05\x12\r\n\tCANCELLED\x10\x06:\x89\x01\xea\x41\x85\x01\n#aiplatform.googleapis.com/Execution\x12^projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}B\xcc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0e\x45xecutionProtoP\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.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Execution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Execution").msgclass + Execution::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Execution.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb new file mode 100644 index 000000000000..02d8a46e8dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/explanation_metadata.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/explanation_metadata.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xcf\x12\n\x13\x45xplanationMetadata\x12P\n\x06inputs\x18\x01 \x03(\x0b\x32;.google.cloud.aiplatform.v1.ExplanationMetadata.InputsEntryB\x03\xe0\x41\x02\x12R\n\x07outputs\x18\x02 \x03(\x0b\x32<.google.cloud.aiplatform.v1.ExplanationMetadata.OutputsEntryB\x03\xe0\x41\x02\x12\'\n\x1f\x66\x65\x61ture_attributions_schema_uri\x18\x03 \x01(\t\x12\x1b\n\x13latent_space_source\x18\x05 \x01(\t\x1a\xc4\r\n\rInputMetadata\x12/\n\x0finput_baselines\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x19\n\x11input_tensor_name\x18\x02 \x01(\t\x12X\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x46.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Encoding\x12\x10\n\x08modality\x18\x04 \x01(\t\x12n\n\x14\x66\x65\x61ture_value_domain\x18\x05 \x01(\x0b\x32P.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.FeatureValueDomain\x12\x1b\n\x13indices_tensor_name\x18\x06 \x01(\t\x12\x1f\n\x17\x64\x65nse_shape_tensor_name\x18\x07 \x01(\t\x12\x1d\n\x15index_feature_mapping\x18\x08 \x03(\t\x12\x1b\n\x13\x65ncoded_tensor_name\x18\t \x01(\t\x12\x31\n\x11\x65ncoded_baselines\x18\n \x03(\x0b\x32\x16.google.protobuf.Value\x12\x62\n\rvisualization\x18\x0b \x01(\x0b\x32K.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization\x12\x12\n\ngroup_name\x18\x0c \x01(\t\x1aj\n\x12\x46\x65\x61tureValueDomain\x12\x11\n\tmin_value\x18\x01 \x01(\x02\x12\x11\n\tmax_value\x18\x02 \x01(\x02\x12\x15\n\roriginal_mean\x18\x03 \x01(\x02\x12\x17\n\x0foriginal_stddev\x18\x04 \x01(\x02\x1a\xd6\x06\n\rVisualization\x12^\n\x04type\x18\x01 \x01(\x0e\x32P.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Type\x12\x66\n\x08polarity\x18\x02 \x01(\x0e\x32T.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Polarity\x12g\n\tcolor_map\x18\x03 \x01(\x0e\x32T.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.ColorMap\x12\x1f\n\x17\x63lip_percent_upperbound\x18\x04 \x01(\x02\x12\x1f\n\x17\x63lip_percent_lowerbound\x18\x05 \x01(\x02\x12m\n\x0coverlay_type\x18\x06 \x01(\x0e\x32W.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.OverlayType\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06PIXELS\x10\x01\x12\x0c\n\x08OUTLINES\x10\x02\"J\n\x08Polarity\x12\x18\n\x14POLARITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08POSITIVE\x10\x01\x12\x0c\n\x08NEGATIVE\x10\x02\x12\x08\n\x04\x42OTH\x10\x03\"{\n\x08\x43olorMap\x12\x19\n\x15\x43OLOR_MAP_UNSPECIFIED\x10\x00\x12\x0e\n\nPINK_GREEN\x10\x01\x12\x0b\n\x07VIRIDIS\x10\x02\x12\x07\n\x03RED\x10\x03\x12\t\n\x05GREEN\x10\x04\x12\r\n\tRED_GREEN\x10\x06\x12\x14\n\x10PINK_WHITE_GREEN\x10\x05\"b\n\x0bOverlayType\x12\x1c\n\x18OVERLAY_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08ORIGINAL\x10\x02\x12\r\n\tGRAYSCALE\x10\x03\x12\x0e\n\nMASK_BLACK\x10\x04\"\xa0\x01\n\x08\x45ncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08IDENTITY\x10\x01\x12\x13\n\x0f\x42\x41G_OF_FEATURES\x10\x02\x12\x1a\n\x16\x42\x41G_OF_FEATURES_SPARSE\x10\x03\x12\r\n\tINDICATOR\x10\x04\x12\x16\n\x12\x43OMBINED_EMBEDDING\x10\x05\x12\x14\n\x10\x43ONCAT_EMBEDDING\x10\x06\x1a\xa6\x01\n\x0eOutputMetadata\x12<\n\x1aindex_display_name_mapping\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\"\n\x18\x64isplay_name_mapping_key\x18\x02 \x01(\tH\x00\x12\x1a\n\x12output_tensor_name\x18\x03 \x01(\tB\x16\n\x14\x64isplay_name_mapping\x1al\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata:\x02\x38\x01\x1an\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12M\n\x05value\x18\x02 \x01(\x0b\x32>.google.cloud.aiplatform.v1.ExplanationMetadata.OutputMetadata:\x02\x38\x01\x42\xd6\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x18\x45xplanationMetadataProtoP\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.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + ExplanationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata").msgclass + ExplanationMetadata::InputMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata").msgclass + ExplanationMetadata::InputMetadata::FeatureValueDomain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.FeatureValueDomain").msgclass + ExplanationMetadata::InputMetadata::Visualization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization").msgclass + ExplanationMetadata::InputMetadata::Visualization::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Type").enummodule + ExplanationMetadata::InputMetadata::Visualization::Polarity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.Polarity").enummodule + ExplanationMetadata::InputMetadata::Visualization::ColorMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.ColorMap").enummodule + ExplanationMetadata::InputMetadata::Visualization::OverlayType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Visualization.OverlayType").enummodule + ExplanationMetadata::InputMetadata::Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.Encoding").enummodule + ExplanationMetadata::OutputMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadata.OutputMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_pb.rb new file mode 100644 index 000000000000..02167b7a85c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/explanation_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/explanation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/explanation_metadata_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n,google/cloud/aiplatform/v1/explanation.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x35google/cloud/aiplatform/v1/explanation_metadata.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x8f\x01\n\x0b\x45xplanation\x12\x42\n\x0c\x61ttributions\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.AttributionB\x03\xe0\x41\x03\x12<\n\tneighbors\x18\x02 \x03(\x0b\x32$.google.cloud.aiplatform.v1.NeighborB\x03\xe0\x41\x03\"[\n\x10ModelExplanation\x12G\n\x11mean_attributions\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.AttributionB\x03\xe0\x41\x03\"\x89\x02\n\x0b\x41ttribution\x12\"\n\x15\x62\x61seline_output_value\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\x12\"\n\x15instance_output_value\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\x12\x39\n\x14\x66\x65\x61ture_attributions\x18\x03 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12\x19\n\x0coutput_index\x18\x04 \x03(\x05\x42\x03\xe0\x41\x03\x12 \n\x13output_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13\x61pproximation_error\x18\x06 \x01(\x01\x42\x03\xe0\x41\x03\x12\x18\n\x0boutput_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\"D\n\x08Neighbor\x12\x18\n\x0bneighbor_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11neighbor_distance\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\"\xa5\x01\n\x0f\x45xplanationSpec\x12J\n\nparameters\x18\x01 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.ExplanationParametersB\x03\xe0\x41\x02\x12\x46\n\x08metadata\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.ExplanationMetadataB\x03\xe0\x41\x01\"\xad\x03\n\x15\x45xplanationParameters\x12\\\n\x1bsampled_shapley_attribution\x18\x01 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.SampledShapleyAttributionH\x00\x12\x66\n integrated_gradients_attribution\x18\x02 \x01(\x0b\x32:.google.cloud.aiplatform.v1.IntegratedGradientsAttributionH\x00\x12G\n\x10xrai_attribution\x18\x03 \x01(\x0b\x32+.google.cloud.aiplatform.v1.XraiAttributionH\x00\x12\x38\n\x08\x65xamples\x18\x07 \x01(\x0b\x32$.google.cloud.aiplatform.v1.ExamplesH\x00\x12\r\n\x05top_k\x18\x04 \x01(\x05\x12\x32\n\x0eoutput_indices\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x08\n\x06method\"4\n\x19SampledShapleyAttribution\x12\x17\n\npath_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\"\xd1\x01\n\x1eIntegratedGradientsAttribution\x12\x17\n\nstep_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12H\n\x12smooth_grad_config\x18\x02 \x01(\x0b\x32,.google.cloud.aiplatform.v1.SmoothGradConfig\x12L\n\x14\x62lur_baseline_config\x18\x03 \x01(\x0b\x32..google.cloud.aiplatform.v1.BlurBaselineConfig\"\xc2\x01\n\x0fXraiAttribution\x12\x17\n\nstep_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12H\n\x12smooth_grad_config\x18\x02 \x01(\x0b\x32,.google.cloud.aiplatform.v1.SmoothGradConfig\x12L\n\x14\x62lur_baseline_config\x18\x03 \x01(\x0b\x32..google.cloud.aiplatform.v1.BlurBaselineConfig\"\xa9\x01\n\x10SmoothGradConfig\x12\x15\n\x0bnoise_sigma\x18\x01 \x01(\x02H\x00\x12L\n\x13\x66\x65\x61ture_noise_sigma\x18\x02 \x01(\x0b\x32-.google.cloud.aiplatform.v1.FeatureNoiseSigmaH\x00\x12\x1a\n\x12noisy_sample_count\x18\x03 \x01(\x05\x42\x14\n\x12GradientNoiseSigma\"\xa1\x01\n\x11\x46\x65\x61tureNoiseSigma\x12W\n\x0bnoise_sigma\x18\x01 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.FeatureNoiseSigma.NoiseSigmaForFeature\x1a\x33\n\x14NoiseSigmaForFeature\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05sigma\x18\x02 \x01(\x02\",\n\x12\x42lurBaselineConfig\x12\x16\n\x0emax_blur_sigma\x18\x01 \x01(\x02\"\xe2\x03\n\x08\x45xamples\x12S\n\x12\x65xample_gcs_source\x18\x05 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceH\x00\x12@\n\x1enearest_neighbor_search_config\x18\x02 \x01(\x0b\x32\x16.google.protobuf.ValueH\x01\x12\x36\n\x07presets\x18\x04 \x01(\x0b\x32#.google.cloud.aiplatform.v1.PresetsH\x01\x12\x16\n\x0eneighbor_count\x18\x03 \x01(\x05\x1a\xda\x01\n\x10\x45xampleGcsSource\x12U\n\x0b\x64\x61ta_format\x18\x01 \x01(\x0e\x32@.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat\x12\x39\n\ngcs_source\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSource\"4\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05JSONL\x10\x01\x42\x08\n\x06sourceB\x08\n\x06\x63onfig\"\xfa\x01\n\x07Presets\x12=\n\x05query\x18\x01 \x01(\x0e\x32).google.cloud.aiplatform.v1.Presets.QueryH\x00\x88\x01\x01\x12>\n\x08modality\x18\x02 \x01(\x0e\x32,.google.cloud.aiplatform.v1.Presets.Modality\"\x1e\n\x05Query\x12\x0b\n\x07PRECISE\x10\x00\x12\x08\n\x04\x46\x41ST\x10\x01\"F\n\x08Modality\x12\x18\n\x14MODALITY_UNSPECIFIED\x10\x00\x12\t\n\x05IMAGE\x10\x01\x12\x08\n\x04TEXT\x10\x02\x12\x0b\n\x07TABULAR\x10\x03\x42\x08\n\x06_query\"\xf4\x01\n\x17\x45xplanationSpecOverride\x12\x45\n\nparameters\x18\x01 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.ExplanationParameters\x12I\n\x08metadata\x18\x02 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.ExplanationMetadataOverride\x12G\n\x11\x65xamples_override\x18\x03 \x01(\x0b\x32,.google.cloud.aiplatform.v1.ExamplesOverride\"\xbf\x02\n\x1b\x45xplanationMetadataOverride\x12X\n\x06inputs\x18\x01 \x03(\x0b\x32\x43.google.cloud.aiplatform.v1.ExplanationMetadataOverride.InputsEntryB\x03\xe0\x41\x02\x1aH\n\x15InputMetadataOverride\x12/\n\x0finput_baselines\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value\x1a|\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\\\n\x05value\x18\x02 \x01(\x0b\x32M.google.cloud.aiplatform.v1.ExplanationMetadataOverride.InputMetadataOverride:\x02\x38\x01\"\xc6\x02\n\x10\x45xamplesOverride\x12\x16\n\x0eneighbor_count\x18\x01 \x01(\x05\x12\x16\n\x0e\x63rowding_count\x18\x02 \x01(\x05\x12O\n\x0crestrictions\x18\x03 \x03(\x0b\x32\x39.google.cloud.aiplatform.v1.ExamplesRestrictionsNamespace\x12\x19\n\x11return_embeddings\x18\x04 \x01(\x08\x12L\n\x0b\x64\x61ta_format\x18\x05 \x01(\x0e\x32\x37.google.cloud.aiplatform.v1.ExamplesOverride.DataFormat\"H\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\r\n\tINSTANCES\x10\x01\x12\x0e\n\nEMBEDDINGS\x10\x02\"T\n\x1d\x45xamplesRestrictionsNamespace\x12\x16\n\x0enamespace_name\x18\x01 \x01(\t\x12\r\n\x05\x61llow\x18\x02 \x03(\t\x12\x0c\n\x04\x64\x65ny\x18\x03 \x03(\tB\xce\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x10\x45xplanationProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.ExplanationMetadata", "google/cloud/aiplatform/v1/explanation_metadata.proto"], + ["google.cloud.aiplatform.v1.GcsSource", "google/cloud/aiplatform/v1/io.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 + Explanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Explanation").msgclass + ModelExplanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelExplanation").msgclass + Attribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Attribution").msgclass + Neighbor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Neighbor").msgclass + ExplanationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationSpec").msgclass + ExplanationParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationParameters").msgclass + SampledShapleyAttribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SampledShapleyAttribution").msgclass + IntegratedGradientsAttribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IntegratedGradientsAttribution").msgclass + XraiAttribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.XraiAttribution").msgclass + SmoothGradConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SmoothGradConfig").msgclass + FeatureNoiseSigma = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureNoiseSigma").msgclass + FeatureNoiseSigma::NoiseSigmaForFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureNoiseSigma.NoiseSigmaForFeature").msgclass + BlurBaselineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BlurBaselineConfig").msgclass + Examples = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Examples").msgclass + Examples::ExampleGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Examples.ExampleGcsSource").msgclass + Examples::ExampleGcsSource::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat").enummodule + Presets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Presets").msgclass + Presets::Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Presets.Query").enummodule + Presets::Modality = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Presets.Modality").enummodule + ExplanationSpecOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationSpecOverride").msgclass + ExplanationMetadataOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadataOverride").msgclass + ExplanationMetadataOverride::InputMetadataOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplanationMetadataOverride.InputMetadataOverride").msgclass + ExamplesOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExamplesOverride").msgclass + ExamplesOverride::DataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExamplesOverride.DataFormat").enummodule + ExamplesRestrictionsNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExamplesRestrictionsNamespace").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_group_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_group_pb.rb new file mode 100644 index 000000000000..254a2dc03cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_group_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_group.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/aiplatform/v1/feature_group.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xce\x06\n\x0c\x46\x65\x61tureGroup\x12\x46\n\tbig_query\x18\x07 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.FeatureGroup.BigQueryH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12I\n\x06labels\x18\x05 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.FeatureGroup.LabelsEntryB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1a\xb2\x02\n\x08\x42igQuery\x12L\n\x10\x62ig_query_source\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceB\x06\xe0\x41\x05\xe0\x41\x02\x12\x1e\n\x11\x65ntity_id_columns\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12static_data_source\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12V\n\x0btime_series\x18\x04 \x01(\x0b\x32<.google.cloud.aiplatform.v1.FeatureGroup.BigQuery.TimeSeriesB\x03\xe0\x41\x01\x12\x12\n\x05\x64\x65nse\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a+\n\nTimeSeries\x12\x1d\n\x10timestamp_column\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x90\x01\xea\x41\x8c\x01\n&aiplatform.googleapis.com/FeatureGroup\x12\x45projects/{project}/locations/{location}/featureGroups/{feature_group}*\rfeatureGroups2\x0c\x66\x65\x61tureGroupB\x08\n\x06sourceB\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11\x46\x65\x61tureGroupProtoP\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.cloud.aiplatform.v1.BigQuerySource", "google/cloud/aiplatform/v1/io.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 + FeatureGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureGroup").msgclass + FeatureGroup::BigQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureGroup.BigQuery").msgclass + FeatureGroup::BigQuery::TimeSeries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureGroup.BigQuery.TimeSeries").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb new file mode 100644 index 000000000000..46c5b41591e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_monitoring_stats.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/aiplatform/v1/feature_monitoring_stats.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xef\x01\n\x13\x46\x65\x61tureStatsAnomaly\x12\r\n\x05score\x18\x01 \x01(\x01\x12\x11\n\tstats_uri\x18\x03 \x01(\t\x12\x13\n\x0b\x61nomaly_uri\x18\x04 \x01(\t\x12\x1e\n\x16\x64istribution_deviation\x18\x05 \x01(\x01\x12#\n\x1b\x61nomaly_detection_threshold\x18\t \x01(\x01\x12.\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xd9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1b\x46\x65\x61tureMonitoringStatsProtoP\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"], + ] + 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 + FeatureStatsAnomaly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureStatsAnomaly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb new file mode 100644 index 000000000000..0cca4915bce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_online_store_admin_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/feature_online_store_pb' +require 'google/cloud/aiplatform/v1/feature_view_pb' +require 'google/cloud/aiplatform/v1/feature_view_sync_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nCgoogle/cloud/aiplatform/v1/feature_online_store_admin_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\x35google/cloud/aiplatform/v1/feature_online_store.proto\x1a-google/cloud/aiplatform/v1/feature_view.proto\x1a\x32google/cloud/aiplatform/v1/feature_view_sync.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xe0\x01\n\x1f\x43reateFeatureOnlineStoreRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,aiplatform.googleapis.com/FeatureOnlineStore\x12Q\n\x14\x66\x65\x61ture_online_store\x18\x02 \x01(\x0b\x32..google.cloud.aiplatform.v1.FeatureOnlineStoreB\x03\xe0\x41\x02\x12$\n\x17\x66\x65\x61ture_online_store_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"b\n\x1cGetFeatureOnlineStoreRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/FeatureOnlineStore\"\xaf\x01\n\x1eListFeatureOnlineStoresRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,aiplatform.googleapis.com/FeatureOnlineStore\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x89\x01\n\x1fListFeatureOnlineStoresResponse\x12M\n\x15\x66\x65\x61ture_online_stores\x18\x01 \x03(\x0b\x32..google.cloud.aiplatform.v1.FeatureOnlineStore\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa5\x01\n\x1fUpdateFeatureOnlineStoreRequest\x12Q\n\x14\x66\x65\x61ture_online_store\x18\x01 \x01(\x0b\x32..google.cloud.aiplatform.v1.FeatureOnlineStoreB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"t\n\x1f\x44\x65leteFeatureOnlineStoreRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/FeatureOnlineStore\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xe5\x01\n\x18\x43reateFeatureViewRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/FeatureOnlineStore\x12\x42\n\x0c\x66\x65\x61ture_view\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.FeatureViewB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66\x65\x61ture_view_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14run_sync_immediately\x18\x04 \x01(\x08\x42\x03\xe0\x41\x05\"T\n\x15GetFeatureViewRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/FeatureView\"\xa1\x01\n\x17ListFeatureViewsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%aiplatform.googleapis.com/FeatureView\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"s\n\x18ListFeatureViewsResponse\x12>\n\rfeature_views\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.FeatureView\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8f\x01\n\x18UpdateFeatureViewRequest\x12\x42\n\x0c\x66\x65\x61ture_view\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.FeatureViewB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"W\n\x18\x44\x65leteFeatureViewRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/FeatureView\"{\n)CreateFeatureOnlineStoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"{\n)UpdateFeatureOnlineStoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"t\n\"CreateFeatureViewOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"t\n\"UpdateFeatureViewOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"]\n\x16SyncFeatureViewRequest\x12\x43\n\x0c\x66\x65\x61ture_view\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/FeatureView\"4\n\x17SyncFeatureViewResponse\x12\x19\n\x11\x66\x65\x61ture_view_sync\x18\x01 \x01(\t\"\\\n\x19GetFeatureViewSyncRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/FeatureViewSync\"\xa5\x01\n\x1bListFeatureViewSyncsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/FeatureView\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x80\x01\n\x1cListFeatureViewSyncsResponse\x12G\n\x12\x66\x65\x61ture_view_syncs\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.FeatureViewSync\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd0\x1a\n\x1e\x46\x65\x61tureOnlineStoreAdminService\x12\xc6\x02\n\x18\x43reateFeatureOnlineStore\x12;.google.cloud.aiplatform.v1.CreateFeatureOnlineStoreRequest\x1a\x1d.google.longrunning.Operation\"\xcd\x01\xca\x41?\n\x12\x46\x65\x61tureOnlineStore\x12)CreateFeatureOnlineStoreOperationMetadata\xda\x41\x33parent,feature_online_store,feature_online_store_id\x82\xd3\xe4\x93\x02O\"7/v1/{parent=projects/*/locations/*}/featureOnlineStores:\x14\x66\x65\x61ture_online_store\x12\xc9\x01\n\x15GetFeatureOnlineStore\x12\x38.google.cloud.aiplatform.v1.GetFeatureOnlineStoreRequest\x1a..google.cloud.aiplatform.v1.FeatureOnlineStore\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/featureOnlineStores/*}\x12\xdc\x01\n\x17ListFeatureOnlineStores\x12:.google.cloud.aiplatform.v1.ListFeatureOnlineStoresRequest\x1a;.google.cloud.aiplatform.v1.ListFeatureOnlineStoresResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}/featureOnlineStores\x12\xc8\x02\n\x18UpdateFeatureOnlineStore\x12;.google.cloud.aiplatform.v1.UpdateFeatureOnlineStoreRequest\x1a\x1d.google.longrunning.Operation\"\xcf\x01\xca\x41?\n\x12\x46\x65\x61tureOnlineStore\x12)UpdateFeatureOnlineStoreOperationMetadata\xda\x41 feature_online_store,update_mask\x82\xd3\xe4\x93\x02\x64\x32L/v1/{feature_online_store.name=projects/*/locations/*/featureOnlineStores/*}:\x14\x66\x65\x61ture_online_store\x12\xf7\x01\n\x18\x44\x65leteFeatureOnlineStore\x12;.google.cloud.aiplatform.v1.DeleteFeatureOnlineStoreRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/featureOnlineStores/*}\x12\xa1\x02\n\x11\x43reateFeatureView\x12\x34.google.cloud.aiplatform.v1.CreateFeatureViewRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x01\xca\x41\x31\n\x0b\x46\x65\x61tureView\x12\"CreateFeatureViewOperationMetadata\xda\x41#parent,feature_view,feature_view_id\x82\xd3\xe4\x93\x02V\"F/v1/{parent=projects/*/locations/*/featureOnlineStores/*}/featureViews:\x0c\x66\x65\x61ture_view\x12\xc3\x01\n\x0eGetFeatureView\x12\x31.google.cloud.aiplatform.v1.GetFeatureViewRequest\x1a\'.google.cloud.aiplatform.v1.FeatureView\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}\x12\xd6\x01\n\x10ListFeatureViews\x12\x33.google.cloud.aiplatform.v1.ListFeatureViewsRequest\x1a\x34.google.cloud.aiplatform.v1.ListFeatureViewsResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/featureOnlineStores/*}/featureViews\x12\xa3\x02\n\x11UpdateFeatureView\x12\x34.google.cloud.aiplatform.v1.UpdateFeatureViewRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41\x31\n\x0b\x46\x65\x61tureView\x12\"UpdateFeatureViewOperationMetadata\xda\x41\x18\x66\x65\x61ture_view,update_mask\x82\xd3\xe4\x93\x02\x63\x32S/v1/{feature_view.name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:\x0c\x66\x65\x61ture_view\x12\xf3\x01\n\x11\x44\x65leteFeatureView\x12\x34.google.cloud.aiplatform.v1.DeleteFeatureViewRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02H*F/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}\x12\xe9\x01\n\x0fSyncFeatureView\x12\x32.google.cloud.aiplatform.v1.SyncFeatureViewRequest\x1a\x33.google.cloud.aiplatform.v1.SyncFeatureViewResponse\"m\xda\x41\x0c\x66\x65\x61ture_view\x82\xd3\xe4\x93\x02X\"S/v1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:sync:\x01*\x12\xe2\x01\n\x12GetFeatureViewSync\x12\x35.google.cloud.aiplatform.v1.GetFeatureViewSyncRequest\x1a+.google.cloud.aiplatform.v1.FeatureViewSync\"h\xda\x41\x04name\x82\xd3\xe4\x93\x02[\x12Y/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/featureViewSyncs/*}\x12\xf5\x01\n\x14ListFeatureViewSyncs\x12\x37.google.cloud.aiplatform.v1.ListFeatureViewSyncsRequest\x1a\x38.google.cloud.aiplatform.v1.ListFeatureViewSyncsResponse\"j\xda\x41\x06parent\x82\xd3\xe4\x93\x02[\x12Y/v1/{parent=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/featureViewSyncs\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B#FeatureOnlineStoreAdminServiceProtoP\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.FeatureOnlineStore", "google/cloud/aiplatform/v1/feature_online_store.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.FeatureView", "google/cloud/aiplatform/v1/feature_view.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.cloud.aiplatform.v1.FeatureViewSync", "google/cloud/aiplatform/v1/feature_view_sync.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 + CreateFeatureOnlineStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureOnlineStoreRequest").msgclass + GetFeatureOnlineStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeatureOnlineStoreRequest").msgclass + ListFeatureOnlineStoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureOnlineStoresRequest").msgclass + ListFeatureOnlineStoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureOnlineStoresResponse").msgclass + UpdateFeatureOnlineStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureOnlineStoreRequest").msgclass + DeleteFeatureOnlineStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureOnlineStoreRequest").msgclass + CreateFeatureViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureViewRequest").msgclass + GetFeatureViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeatureViewRequest").msgclass + ListFeatureViewsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureViewsRequest").msgclass + ListFeatureViewsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureViewsResponse").msgclass + UpdateFeatureViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureViewRequest").msgclass + DeleteFeatureViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureViewRequest").msgclass + CreateFeatureOnlineStoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata").msgclass + UpdateFeatureOnlineStoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureOnlineStoreOperationMetadata").msgclass + CreateFeatureViewOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureViewOperationMetadata").msgclass + UpdateFeatureViewOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureViewOperationMetadata").msgclass + SyncFeatureViewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SyncFeatureViewRequest").msgclass + SyncFeatureViewResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SyncFeatureViewResponse").msgclass + GetFeatureViewSyncRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeatureViewSyncRequest").msgclass + ListFeatureViewSyncsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureViewSyncsRequest").msgclass + ListFeatureViewSyncsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureViewSyncsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_services_pb.rb new file mode 100644 index 000000000000..eaf6f4f0f4c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_services_pb.rb @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/feature_online_store_admin_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/feature_online_store_admin_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreAdminService + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.FeatureOnlineStoreAdminService' + + # Creates a new FeatureOnlineStore in a given project and location. + rpc :CreateFeatureOnlineStore, ::Google::Cloud::AIPlatform::V1::CreateFeatureOnlineStoreRequest, ::Google::Longrunning::Operation + # Gets details of a single FeatureOnlineStore. + rpc :GetFeatureOnlineStore, ::Google::Cloud::AIPlatform::V1::GetFeatureOnlineStoreRequest, ::Google::Cloud::AIPlatform::V1::FeatureOnlineStore + # Lists FeatureOnlineStores in a given project and location. + rpc :ListFeatureOnlineStores, ::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest, ::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresResponse + # Updates the parameters of a single FeatureOnlineStore. + rpc :UpdateFeatureOnlineStore, ::Google::Cloud::AIPlatform::V1::UpdateFeatureOnlineStoreRequest, ::Google::Longrunning::Operation + # Deletes a single FeatureOnlineStore. The FeatureOnlineStore must not + # contain any FeatureViews. + rpc :DeleteFeatureOnlineStore, ::Google::Cloud::AIPlatform::V1::DeleteFeatureOnlineStoreRequest, ::Google::Longrunning::Operation + # Creates a new FeatureView in a given FeatureOnlineStore. + rpc :CreateFeatureView, ::Google::Cloud::AIPlatform::V1::CreateFeatureViewRequest, ::Google::Longrunning::Operation + # Gets details of a single FeatureView. + rpc :GetFeatureView, ::Google::Cloud::AIPlatform::V1::GetFeatureViewRequest, ::Google::Cloud::AIPlatform::V1::FeatureView + # Lists FeatureViews in a given FeatureOnlineStore. + rpc :ListFeatureViews, ::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest, ::Google::Cloud::AIPlatform::V1::ListFeatureViewsResponse + # Updates the parameters of a single FeatureView. + rpc :UpdateFeatureView, ::Google::Cloud::AIPlatform::V1::UpdateFeatureViewRequest, ::Google::Longrunning::Operation + # Deletes a single FeatureView. + rpc :DeleteFeatureView, ::Google::Cloud::AIPlatform::V1::DeleteFeatureViewRequest, ::Google::Longrunning::Operation + # Triggers on-demand sync for the FeatureView. + rpc :SyncFeatureView, ::Google::Cloud::AIPlatform::V1::SyncFeatureViewRequest, ::Google::Cloud::AIPlatform::V1::SyncFeatureViewResponse + # Gets details of a single FeatureViewSync. + rpc :GetFeatureViewSync, ::Google::Cloud::AIPlatform::V1::GetFeatureViewSyncRequest, ::Google::Cloud::Aiplatform::V1::FeatureViewSync + # Lists FeatureViewSyncs in a given FeatureView. + rpc :ListFeatureViewSyncs, ::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest, ::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb new file mode 100644 index 000000000000..34183d2a58e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_online_store.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/service_networking_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/feature_online_store.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\x33google/cloud/aiplatform/v1/service_networking.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x89\x0b\n\x12\x46\x65\x61tureOnlineStore\x12K\n\x08\x62igtable\x18\x08 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.FeatureOnlineStore.BigtableH\x00\x12M\n\toptimized\x18\x0c \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.FeatureOnlineStore.OptimizedH\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\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12O\n\x06labels\x18\x06 \x03(\x0b\x32:.google.cloud.aiplatform.v1.FeatureOnlineStore.LabelsEntryB\x03\xe0\x41\x01\x12H\n\x05state\x18\x07 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.FeatureOnlineStore.StateB\x03\xe0\x41\x03\x12p\n\x1a\x64\x65\x64icated_serving_endpoint\x18\n \x01(\x0b\x32G.google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpointB\x03\xe0\x41\x01\x12H\n\x0f\x65ncryption_spec\x18\r \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xd8\x01\n\x08\x42igtable\x12^\n\x0c\x61uto_scaling\x18\x01 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.FeatureOnlineStore.Bigtable.AutoScalingB\x03\xe0\x41\x02\x1al\n\x0b\x41utoScaling\x12\x1b\n\x0emin_node_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1b\n\x0emax_node_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12#\n\x16\x63pu_utilization_target\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x0b\n\tOptimized\x1a\xcb\x01\n\x18\x44\x65\x64icatedServingEndpoint\x12(\n\x1bpublic_endpoint_domain_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x1eprivate_service_connect_config\x18\x03 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.PrivateServiceConnectConfigB\x03\xe0\x41\x01\x12\x1f\n\x12service_attachment\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06STABLE\x10\x01\x12\x0c\n\x08UPDATING\x10\x02:\x86\x01\xea\x41\x82\x01\n,aiplatform.googleapis.com/FeatureOnlineStore\x12Rprojects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}B\x0e\n\x0cstorage_typeB\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17\x46\x65\x61tureOnlineStoreProtoP\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.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.PrivateServiceConnectConfig", "google/cloud/aiplatform/v1/service_networking.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 + FeatureOnlineStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore").msgclass + FeatureOnlineStore::Bigtable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore.Bigtable").msgclass + FeatureOnlineStore::Bigtable::AutoScaling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore.Bigtable.AutoScaling").msgclass + FeatureOnlineStore::Optimized = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore.Optimized").msgclass + FeatureOnlineStore::DedicatedServingEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint").msgclass + FeatureOnlineStore::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureOnlineStore.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb new file mode 100644 index 000000000000..bada08f6835b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_online_store_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/featurestore_online_service_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n=google/cloud/aiplatform/v1/feature_online_store_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.NearestNeighborQuery.NumericFilterB\x03\xe0\x41\x01\x12\x32\n%per_crowding_attribute_neighbor_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12T\n\nparameters\x18\x07 \x01(\x0b\x32;.google.cloud.aiplatform.v1.NearestNeighborQuery.ParametersB\x03\xe0\x41\x01\x1a\x1f\n\tEmbedding\x12\x12\n\x05value\x18\x01 \x03(\x02\x42\x03\xe0\x41\x01\x1aV\n\x0cStringFilter\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x61llow_tokens\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65ny_tokens\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1a\xcf\x02\n\rNumericFilter\x12\x13\n\tvalue_int\x18\x02 \x01(\x03H\x00\x12\x15\n\x0bvalue_float\x18\x03 \x01(\x02H\x00\x12\x16\n\x0cvalue_double\x18\x04 \x01(\x01H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12]\n\x02op\x18\x05 \x01(\x0e\x32G.google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.OperatorB\x03\xe0\x41\x01H\x01\x88\x01\x01\"x\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x08\n\x04LESS\x10\x01\x12\x0e\n\nLESS_EQUAL\x10\x02\x12\t\n\x05\x45QUAL\x10\x03\x12\x11\n\rGREATER_EQUAL\x10\x04\x12\x0b\n\x07GREATER\x10\x05\x12\r\n\tNOT_EQUAL\x10\x06\x42\x07\n\x05ValueB\x05\n\x03_op\x1a\x63\n\nParameters\x12,\n\x1f\x61pproximate_neighbor_candidates\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\'\n\x1aleaf_nodes_search_fraction\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x42\n\n\x08instance\"\xca\x01\n\x1cSearchNearestEntitiesRequest\x12\x43\n\x0c\x66\x65\x61ture_view\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/FeatureView\x12\x44\n\x05query\x18\x02 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.NearestNeighborQueryB\x03\xe0\x41\x02\x12\x1f\n\x12return_full_entity\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xe1\x01\n\x10NearestNeighbors\x12H\n\tneighbors\x18\x01 \x03(\x0b\x32\x35.google.cloud.aiplatform.v1.NearestNeighbors.Neighbor\x1a\x82\x01\n\x08Neighbor\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x10\n\x08\x64istance\x18\x02 \x01(\x01\x12Q\n\x11\x65ntity_key_values\x18\x03 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.FetchFeatureValuesResponse\"h\n\x1dSearchNearestEntitiesResponse\x12G\n\x11nearest_neighbors\x18\x01 \x01(\x0b\x32,.google.cloud.aiplatform.v1.NearestNeighbors*b\n\x15\x46\x65\x61tureViewDataFormat\x12(\n$FEATURE_VIEW_DATA_FORMAT_UNSPECIFIED\x10\x00\x12\r\n\tKEY_VALUE\x10\x01\x12\x10\n\x0cPROTO_STRUCT\x10\x02\x32\xf8\x04\n\x19\x46\x65\x61tureOnlineStoreService\x12\x8b\x02\n\x12\x46\x65tchFeatureValues\x12\x35.google.cloud.aiplatform.v1.FetchFeatureValuesRequest\x1a\x36.google.cloud.aiplatform.v1.FetchFeatureValuesResponse\"\x85\x01\xda\x41\x16\x66\x65\x61ture_view, data_key\x82\xd3\xe4\x93\x02\x66\"a/v1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:fetchFeatureValues:\x01*\x12\xfd\x01\n\x15SearchNearestEntities\x12\x38.google.cloud.aiplatform.v1.SearchNearestEntitiesRequest\x1a\x39.google.cloud.aiplatform.v1.SearchNearestEntitiesResponse\"o\x82\xd3\xe4\x93\x02i\"d/v1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:searchNearestEntities:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xdc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1e\x46\x65\x61tureOnlineStoreServiceProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.FeatureValue", "google/cloud/aiplatform/v1/featurestore_online_service.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 + FeatureViewDataKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureViewDataKey").msgclass + FeatureViewDataKey::CompositeKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureViewDataKey.CompositeKey").msgclass + FetchFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FetchFeatureValuesRequest").msgclass + FetchFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FetchFeatureValuesResponse").msgclass + FetchFeatureValuesResponse::FeatureNameValuePairList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FetchFeatureValuesResponse.FeatureNameValuePairList").msgclass + FetchFeatureValuesResponse::FeatureNameValuePairList::FeatureNameValuePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FetchFeatureValuesResponse.FeatureNameValuePairList.FeatureNameValuePair").msgclass + NearestNeighborQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery").msgclass + NearestNeighborQuery::Embedding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding").msgclass + NearestNeighborQuery::StringFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter").msgclass + NearestNeighborQuery::NumericFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter").msgclass + NearestNeighborQuery::NumericFilter::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.Operator").enummodule + NearestNeighborQuery::Parameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters").msgclass + SearchNearestEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchNearestEntitiesRequest").msgclass + NearestNeighbors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighbors").msgclass + NearestNeighbors::Neighbor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighbors.Neighbor").msgclass + SearchNearestEntitiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchNearestEntitiesResponse").msgclass + FeatureViewDataFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureViewDataFormat").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb new file mode 100644 index 000000000000..f2986a14ac46 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/feature_online_store_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/feature_online_store_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureOnlineStoreService + # A service for fetching feature values from the online store. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.FeatureOnlineStoreService' + + # Fetch feature values under a FeatureView. + rpc :FetchFeatureValues, ::Google::Cloud::AIPlatform::V1::FetchFeatureValuesRequest, ::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse + # Search the nearest entities under a FeatureView. + # Search only works for indexable feature view; if a feature view isn't + # indexable, returns Invalid argument response. + rpc :SearchNearestEntities, ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest, ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_pb.rb new file mode 100644 index 000000000000..c676d949d9f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/feature_monitoring_stats_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/feature.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/aiplatform/v1/feature_monitoring_stats.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8c\n\n\x07\x46\x65\x61ture\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x46\n\nvalue_type\x18\x03 \x01(\x0e\x32-.google.cloud.aiplatform.v1.Feature.ValueTypeB\x03\xe0\x41\x05\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\x44\n\x06labels\x18\x06 \x03(\x0b\x32/.google.cloud.aiplatform.v1.Feature.LabelsEntryB\x03\xe0\x41\x01\x12\x0c\n\x04\x65tag\x18\x07 \x01(\t\x12\x1f\n\x12\x64isable_monitoring\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\x63\n\x1amonitoring_stats_anomalies\x18\x0b \x03(\x0b\x32:.google.cloud.aiplatform.v1.Feature.MonitoringStatsAnomalyB\x03\xe0\x41\x03\x12\x1b\n\x13version_column_name\x18j \x01(\t\x12\x18\n\x10point_of_contact\x18k \x01(\t\x1a\xa7\x02\n\x16MonitoringStatsAnomaly\x12\\\n\tobjective\x18\x01 \x01(\x0e\x32\x44.google.cloud.aiplatform.v1.Feature.MonitoringStatsAnomaly.ObjectiveB\x03\xe0\x41\x03\x12S\n\x15\x66\x65\x61ture_stats_anomaly\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.FeatureStatsAnomalyB\x03\xe0\x41\x03\"Z\n\tObjective\x12\x19\n\x15OBJECTIVE_UNSPECIFIED\x10\x00\x12\x1b\n\x17IMPORT_FEATURE_ANALYSIS\x10\x01\x12\x15\n\x11SNAPSHOT_ANALYSIS\x10\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb0\x01\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\x0e\n\nBOOL_ARRAY\x10\x02\x12\n\n\x06\x44OUBLE\x10\x03\x12\x10\n\x0c\x44OUBLE_ARRAY\x10\x04\x12\t\n\x05INT64\x10\t\x12\x0f\n\x0bINT64_ARRAY\x10\n\x12\n\n\x06STRING\x10\x0b\x12\x10\n\x0cSTRING_ARRAY\x10\x0c\x12\t\n\x05\x42YTES\x10\r\x12\n\n\x06STRUCT\x10\x0e:\x87\x02\xea\x41\x83\x02\n!aiplatform.googleapis.com/Feature\x12qprojects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}\x12Xprojects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}*\x08\x66\x65\x61tures2\x07\x66\x65\x61tureB\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0c\x46\x65\x61tureProtoP\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.cloud.aiplatform.v1.FeatureStatsAnomaly", "google/cloud/aiplatform/v1/feature_monitoring_stats.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 + Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Feature").msgclass + Feature::MonitoringStatsAnomaly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Feature.MonitoringStatsAnomaly").msgclass + Feature::MonitoringStatsAnomaly::Objective = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Feature.MonitoringStatsAnomaly.Objective").enummodule + Feature::ValueType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Feature.ValueType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb new file mode 100644 index 000000000000..d4f9c8028f42 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_registry_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/feature_pb' +require 'google/cloud/aiplatform/v1/feature_group_pb' +require 'google/cloud/aiplatform/v1/featurestore_service_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n9google/cloud/aiplatform/v1/feature_registry_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/feature.proto\x1a.google/cloud/aiplatform/v1/feature_group.proto\x1a\x35google/cloud/aiplatform/v1/featurestore_service.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xc0\x01\n\x19\x43reateFeatureGroupRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&aiplatform.googleapis.com/FeatureGroup\x12\x44\n\rfeature_group\x18\x02 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeatureGroupB\x03\xe0\x41\x02\x12\x1d\n\x10\x66\x65\x61ture_group_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"V\n\x16GetFeatureGroupRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/FeatureGroup\"\xa3\x01\n\x18ListFeatureGroupsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&aiplatform.googleapis.com/FeatureGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"v\n\x19ListFeatureGroupsResponse\x12@\n\x0e\x66\x65\x61ture_groups\x18\x01 \x03(\x0b\x32(.google.cloud.aiplatform.v1.FeatureGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x01\n\x19UpdateFeatureGroupRequest\x12\x44\n\rfeature_group\x18\x01 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeatureGroupB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"h\n\x19\x44\x65leteFeatureGroupRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/FeatureGroup\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"u\n#CreateFeatureGroupOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"u\n#UpdateFeatureGroupOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"x\n&CreateRegistryFeatureOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"p\n\x1eUpdateFeatureOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\xe3\x14\n\x16\x46\x65\x61tureRegistryService\x12\x93\x02\n\x12\x43reateFeatureGroup\x12\x35.google.cloud.aiplatform.v1.CreateFeatureGroupRequest\x1a\x1d.google.longrunning.Operation\"\xa6\x01\xca\x41\x33\n\x0c\x46\x65\x61tureGroup\x12#CreateFeatureGroupOperationMetadata\xda\x41%parent,feature_group,feature_group_id\x82\xd3\xe4\x93\x02\x42\"1/v1/{parent=projects/*/locations/*}/featureGroups:\rfeature_group\x12\xb1\x01\n\x0fGetFeatureGroup\x12\x32.google.cloud.aiplatform.v1.GetFeatureGroupRequest\x1a(.google.cloud.aiplatform.v1.FeatureGroup\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/featureGroups/*}\x12\xc4\x01\n\x11ListFeatureGroups\x12\x34.google.cloud.aiplatform.v1.ListFeatureGroupsRequest\x1a\x35.google.cloud.aiplatform.v1.ListFeatureGroupsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/featureGroups\x12\x95\x02\n\x12UpdateFeatureGroup\x12\x35.google.cloud.aiplatform.v1.UpdateFeatureGroupRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41\x33\n\x0c\x46\x65\x61tureGroup\x12#UpdateFeatureGroupOperationMetadata\xda\x41\x19\x66\x65\x61ture_group,update_mask\x82\xd3\xe4\x93\x02P2?/v1/{feature_group.name=projects/*/locations/*/featureGroups/*}:\rfeature_group\x12\xe5\x01\n\x12\x44\x65leteFeatureGroup\x12\x35.google.cloud.aiplatform.v1.DeleteFeatureGroupRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/featureGroups/*}\x12\xf8\x01\n\rCreateFeature\x12\x30.google.cloud.aiplatform.v1.CreateFeatureRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41)\n\x07\x46\x65\x61ture\x12\x1e\x43reateFeatureOperationMetadata\xda\x41\x19parent,feature,feature_id\x82\xd3\xe4\x93\x02G\"\x12\x12*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.FeatureGroup", "google/cloud/aiplatform/v1/feature_group.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + CreateFeatureGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureGroupRequest").msgclass + GetFeatureGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeatureGroupRequest").msgclass + ListFeatureGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureGroupsRequest").msgclass + ListFeatureGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeatureGroupsResponse").msgclass + UpdateFeatureGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureGroupRequest").msgclass + DeleteFeatureGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureGroupRequest").msgclass + CreateFeatureGroupOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureGroupOperationMetadata").msgclass + UpdateFeatureGroupOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureGroupOperationMetadata").msgclass + CreateRegistryFeatureOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateRegistryFeatureOperationMetadata").msgclass + UpdateFeatureOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_services_pb.rb new file mode 100644 index 000000000000..4382fc2c17a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_registry_service_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/feature_registry_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/feature_registry_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module FeatureRegistryService + # The service that handles CRUD and List for resources for + # FeatureRegistry. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.FeatureRegistryService' + + # Creates a new FeatureGroup in a given project and location. + rpc :CreateFeatureGroup, ::Google::Cloud::AIPlatform::V1::CreateFeatureGroupRequest, ::Google::Longrunning::Operation + # Gets details of a single FeatureGroup. + rpc :GetFeatureGroup, ::Google::Cloud::AIPlatform::V1::GetFeatureGroupRequest, ::Google::Cloud::AIPlatform::V1::FeatureGroup + # Lists FeatureGroups in a given project and location. + rpc :ListFeatureGroups, ::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest, ::Google::Cloud::AIPlatform::V1::ListFeatureGroupsResponse + # Updates the parameters of a single FeatureGroup. + rpc :UpdateFeatureGroup, ::Google::Cloud::AIPlatform::V1::UpdateFeatureGroupRequest, ::Google::Longrunning::Operation + # Deletes a single FeatureGroup. + rpc :DeleteFeatureGroup, ::Google::Cloud::AIPlatform::V1::DeleteFeatureGroupRequest, ::Google::Longrunning::Operation + # Creates a new Feature in a given FeatureGroup. + rpc :CreateFeature, ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Google::Longrunning::Operation + # Creates a batch of Features in a given FeatureGroup. + rpc :BatchCreateFeatures, ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::Google::Longrunning::Operation + # Gets details of a single Feature. + rpc :GetFeature, ::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::Google::Cloud::AIPlatform::V1::Feature + # Lists Features in a given FeatureGroup. + rpc :ListFeatures, ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::Google::Cloud::AIPlatform::V1::ListFeaturesResponse + # Updates the parameters of a single Feature. + rpc :UpdateFeature, ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::Google::Longrunning::Operation + # Deletes a single Feature. + rpc :DeleteFeature, ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb new file mode 100644 index 000000000000..2fb3e220aa23 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_selector.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/feature_selector.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x1d\n\tIdMatcher\x12\x10\n\x03ids\x18\x01 \x03(\tB\x03\xe0\x41\x02\"Q\n\x0f\x46\x65\x61tureSelector\x12>\n\nid_matcher\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.IdMatcherB\x03\xe0\x41\x02\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x46\x65\x61tureSelectorProtoP\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 = [ + ] + 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 + IdMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IdMatcher").msgclass + FeatureSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureSelector").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_pb.rb new file mode 100644 index 000000000000..ee1d33c33704 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_view.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/aiplatform/v1/feature_view.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd1\x10\n\x0b\x46\x65\x61tureView\x12W\n\x10\x62ig_query_source\x18\x06 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.FeatureView.BigQuerySourceB\x03\xe0\x41\x01H\x00\x12\x65\n\x17\x66\x65\x61ture_registry_source\x18\t \x01(\x0b\x32=.google.cloud.aiplatform.v1.FeatureView.FeatureRegistrySourceB\x03\xe0\x41\x01H\x00\x12Y\n\x11vertex_rag_source\x18\x12 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.FeatureView.VertexRagSourceB\x03\xe0\x41\x01H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12H\n\x06labels\x18\x05 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.FeatureView.LabelsEntryB\x03\xe0\x41\x01\x12G\n\x0bsync_config\x18\x07 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.FeatureView.SyncConfig\x12N\n\x0cindex_config\x18\x0f \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.FeatureView.IndexConfigB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1a\x42\n\x0e\x42igQuerySource\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11\x65ntity_id_columns\x18\x02 \x03(\tB\x03\xe0\x41\x02\x1a\x33\n\nSyncConfig\x12\x0c\n\x04\x63ron\x18\x01 \x01(\t\x12\x17\n\ncontinuous\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xe7\x05\n\x0bIndexConfig\x12_\n\x0etree_ah_config\x18\x06 \x01(\x0b\x32@.google.cloud.aiplatform.v1.FeatureView.IndexConfig.TreeAHConfigB\x03\xe0\x41\x01H\x00\x12g\n\x12\x62rute_force_config\x18\x07 \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.FeatureView.IndexConfig.BruteForceConfigB\x03\xe0\x41\x01H\x00\x12\x1d\n\x10\x65mbedding_column\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x66ilter_columns\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63rowding_column\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x13\x65mbedding_dimension\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12k\n\x15\x64istance_measure_type\x18\x05 \x01(\x0e\x32G.google.cloud.aiplatform.v1.FeatureView.IndexConfig.DistanceMeasureTypeB\x03\xe0\x41\x01\x1a\x12\n\x10\x42ruteForceConfig\x1aY\n\x0cTreeAHConfig\x12+\n\x19leaf_node_embedding_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x1c\n\x1a_leaf_node_embedding_count\"\x84\x01\n\x13\x44istanceMeasureType\x12%\n!DISTANCE_MEASURE_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13SQUARED_L2_DISTANCE\x10\x01\x12\x13\n\x0f\x43OSINE_DISTANCE\x10\x02\x12\x18\n\x14\x44OT_PRODUCT_DISTANCE\x10\x03\x42\x12\n\x10\x61lgorithm_configB\x16\n\x14_embedding_dimension\x1a\xfe\x01\n\x15\x46\x65\x61tureRegistrySource\x12g\n\x0e\x66\x65\x61ture_groups\x18\x01 \x03(\x0b\x32J.google.cloud.aiplatform.v1.FeatureView.FeatureRegistrySource.FeatureGroupB\x03\xe0\x41\x02\x12 \n\x0eproject_number\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x1aG\n\x0c\x46\x65\x61tureGroup\x12\x1d\n\x10\x66\x65\x61ture_group_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x66\x65\x61ture_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\x42\x11\n\x0f_project_number\x1a?\n\x0fVertexRagSource\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rrag_corpus_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9b\x01\xea\x41\x97\x01\n%aiplatform.googleapis.com/FeatureView\x12nprojects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}B\x08\n\x06sourceB\xce\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x10\x46\x65\x61tureViewProtoP\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"], + ] + 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 + FeatureView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView").msgclass + FeatureView::BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.BigQuerySource").msgclass + FeatureView::SyncConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.SyncConfig").msgclass + FeatureView::IndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.IndexConfig").msgclass + FeatureView::IndexConfig::BruteForceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.IndexConfig.BruteForceConfig").msgclass + FeatureView::IndexConfig::TreeAHConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.IndexConfig.TreeAHConfig").msgclass + FeatureView::IndexConfig::DistanceMeasureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.IndexConfig.DistanceMeasureType").enummodule + FeatureView::FeatureRegistrySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.FeatureRegistrySource").msgclass + FeatureView::FeatureRegistrySource::FeatureGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.FeatureRegistrySource.FeatureGroup").msgclass + FeatureView::VertexRagSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureView.VertexRagSource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb new file mode 100644 index 000000000000..c61c080b1984 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/feature_view_sync.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/interval_pb' + + +descriptor_data = "\n2google/cloud/aiplatform/v1/feature_view_sync.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1agoogle/type/interval.proto\"\x85\x05\n\x0f\x46\x65\x61tureViewSync\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x08run_time\x18\x05 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x03\x12-\n\x0c\x66inal_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12R\n\x0csync_summary\x18\x06 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.FeatureViewSync.SyncSummaryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03\x1az\n\x0bSyncSummary\x12\x17\n\nrow_synced\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x17\n\ntotal_slot\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x39\n\x15system_watermark_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\xc3\x01\xea\x41\xbf\x01\n)aiplatform.googleapis.com/FeatureViewSync\x12\x91\x01projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_syncB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14\x46\x65\x61tureViewSyncProtoP\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.type.Interval", "google/type/interval.proto"], + ["google.rpc.Status", "google/rpc/status.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 + FeatureViewSync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureViewSync").msgclass + FeatureViewSync::SyncSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureViewSync.SyncSummary").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb new file mode 100644 index 000000000000..e7764120e5fe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/featurestore_monitoring.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/cloud/aiplatform/v1/featurestore_monitoring.proto\x12\x1agoogle.cloud.aiplatform.v1\"\xa9\x08\n\x1c\x46\x65\x61turestoreMonitoringConfig\x12\x64\n\x11snapshot_analysis\x18\x01 \x01(\x0b\x32I.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis\x12q\n\x18import_features_analysis\x18\x02 \x01(\x0b\x32O.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis\x12l\n\x1anumerical_threshold_config\x18\x03 \x01(\x0b\x32H.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ThresholdConfig\x12n\n\x1c\x63\x61tegorical_threshold_config\x18\x04 \x01(\x0b\x32H.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ThresholdConfig\x1a^\n\x10SnapshotAnalysis\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08\x12 \n\x18monitoring_interval_days\x18\x03 \x01(\x05\x12\x16\n\x0estaleness_days\x18\x04 \x01(\x05\x1a\xc0\x03\n\x16ImportFeaturesAnalysis\x12\x64\n\x05state\x18\x01 \x01(\x0e\x32U.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.State\x12|\n\x1a\x61nomaly_detection_baseline\x18\x02 \x01(\x0e\x32X.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.Baseline\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\"z\n\x08\x42\x61seline\x12\x18\n\x14\x42\x41SELINE_UNSPECIFIED\x10\x00\x12\x10\n\x0cLATEST_STATS\x10\x01\x12\x1e\n\x1aMOST_RECENT_SNAPSHOT_STATS\x10\x02\x12\"\n\x1ePREVIOUS_IMPORT_FEATURES_STATS\x10\x03\x1a/\n\x0fThresholdConfig\x12\x0f\n\x05value\x18\x01 \x01(\x01H\x00\x42\x0b\n\tthresholdB\xd9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1b\x46\x65\x61turestoreMonitoringProtoP\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 = [ + ] + 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 + FeaturestoreMonitoringConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig").msgclass + FeaturestoreMonitoringConfig::SnapshotAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis").msgclass + FeaturestoreMonitoringConfig::ImportFeaturesAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis").msgclass + FeaturestoreMonitoringConfig::ImportFeaturesAnalysis::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.State").enummodule + FeaturestoreMonitoringConfig::ImportFeaturesAnalysis::Baseline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis.Baseline").enummodule + FeaturestoreMonitoringConfig::ThresholdConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ThresholdConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb new file mode 100644 index 000000000000..da74c7c869a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/featurestore_online_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/feature_selector_pb' +require 'google/cloud/aiplatform/v1/types_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\n\x0b\x65ntity_type\x18\x01 \x01(\tB)\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x12\x64\n\x13\x66\x65\x61ture_descriptors\x18\x02 \x03(\x0b\x32G.google.cloud.aiplatform.v1.ReadFeatureValuesResponse.FeatureDescriptor\x1a\x80\x02\n\nEntityView\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12S\n\x04\x64\x61ta\x18\x02 \x03(\x0b\x32\x45.google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.Data\x1a\x89\x01\n\x04\x44\x61ta\x12\x39\n\x05value\x18\x01 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeatureValueH\x00\x12>\n\x06values\x18\x02 \x01(\x0b\x32,.google.cloud.aiplatform.v1.FeatureValueListH\x00\x42\x06\n\x04\x64\x61ta\"\xcb\x01\n!StreamingReadFeatureValuesRequest\x12\x41\n\x0b\x65ntity_type\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x12\x17\n\nentity_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12J\n\x10\x66\x65\x61ture_selector\x18\x03 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FeatureSelectorB\x03\xe0\x41\x02\"\xe6\x04\n\x0c\x46\x65\x61tureValue\x12\x14\n\nbool_value\x18\x01 \x01(\x08H\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bint64_value\x18\x05 \x01(\x03H\x00\x12\x16\n\x0cstring_value\x18\x06 \x01(\tH\x00\x12\x41\n\x10\x62ool_array_value\x18\x07 \x01(\x0b\x32%.google.cloud.aiplatform.v1.BoolArrayH\x00\x12\x45\n\x12\x64ouble_array_value\x18\x08 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.DoubleArrayH\x00\x12\x43\n\x11int64_array_value\x18\x0b \x01(\x0b\x32&.google.cloud.aiplatform.v1.Int64ArrayH\x00\x12\x45\n\x12string_array_value\x18\x0c \x01(\x0b\x32\'.google.cloud.aiplatform.v1.StringArrayH\x00\x12\x15\n\x0b\x62ytes_value\x18\r \x01(\x0cH\x00\x12?\n\x0cstruct_value\x18\x0f \x01(\x0b\x32\'.google.cloud.aiplatform.v1.StructValueH\x00\x12\x43\n\x08metadata\x18\x0e \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.FeatureValue.Metadata\x1a=\n\x08Metadata\x12\x31\n\rgenerate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x07\n\x05value\"K\n\x0bStructValue\x12<\n\x06values\x18\x01 \x03(\x0b\x32,.google.cloud.aiplatform.v1.StructFieldValue\"Y\n\x10StructFieldValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeatureValue\"L\n\x10\x46\x65\x61tureValueList\x12\x38\n\x06values\x18\x01 \x03(\x0b\x32(.google.cloud.aiplatform.v1.FeatureValue2\xfd\x06\n FeaturestoreOnlineServingService\x12\xf3\x01\n\x11ReadFeatureValues\x12\x34.google.cloud.aiplatform.v1.ReadFeatureValuesRequest\x1a\x35.google.cloud.aiplatform.v1.ReadFeatureValuesResponse\"q\xda\x41\x0b\x65ntity_type\x82\xd3\xe4\x93\x02]\"X/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:readFeatureValues:\x01*\x12\x90\x02\n\x1aStreamingReadFeatureValues\x12=.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest\x1a\x35.google.cloud.aiplatform.v1.ReadFeatureValuesResponse\"z\xda\x41\x0b\x65ntity_type\x82\xd3\xe4\x93\x02\x66\"a/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:streamingReadFeatureValues:\x01*0\x01\x12\x80\x02\n\x12WriteFeatureValues\x12\x35.google.cloud.aiplatform.v1.WriteFeatureValuesRequest\x1a\x36.google.cloud.aiplatform.v1.WriteFeatureValuesResponse\"{\xda\x41\x14\x65ntity_type,payloads\x82\xd3\xe4\x93\x02^\"Y/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xdc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1e\x46\x65\x61turestoreOnlineServiceProtoP\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.FeatureSelector", "google/cloud/aiplatform/v1/feature_selector.proto"], + ["google.cloud.aiplatform.v1.BoolArray", "google/cloud/aiplatform/v1/types.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + WriteFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteFeatureValuesRequest").msgclass + WriteFeatureValuesPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteFeatureValuesPayload").msgclass + WriteFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteFeatureValuesResponse").msgclass + ReadFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesRequest").msgclass + ReadFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesResponse").msgclass + ReadFeatureValuesResponse::FeatureDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesResponse.FeatureDescriptor").msgclass + ReadFeatureValuesResponse::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesResponse.Header").msgclass + ReadFeatureValuesResponse::EntityView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView").msgclass + ReadFeatureValuesResponse::EntityView::Data = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.Data").msgclass + StreamingReadFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest").msgclass + FeatureValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureValue").msgclass + FeatureValue::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureValue.Metadata").msgclass + StructValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StructValue").msgclass + StructFieldValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StructFieldValue").msgclass + FeatureValueList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureValueList").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_services_pb.rb new file mode 100644 index 000000000000..0530c6b82d6d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_online_service_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/featurestore_online_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/featurestore_online_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreOnlineServingService + # A service for serving online feature values. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.FeaturestoreOnlineServingService' + + # Reads Feature values of a specific entity of an EntityType. For reading + # feature values of multiple entities of an EntityType, please use + # StreamingReadFeatureValues. + rpc :ReadFeatureValues, ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest, ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse + # Reads Feature values for multiple entities. Depending on their size, data + # for different entities may be broken + # up across multiple responses. + rpc :StreamingReadFeatureValues, ::Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest, stream(::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse) + # Writes Feature values of one or more entities of an EntityType. + # + # The Feature values are merged into existing entities if any. The Feature + # values to be written must have timestamp within the online storage + # retention. + rpc :WriteFeatureValues, ::Google::Cloud::AIPlatform::V1::WriteFeatureValuesRequest, ::Google::Cloud::AIPlatform::V1::WriteFeatureValuesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_pb.rb new file mode 100644 index 000000000000..2fdbbbfe1838 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/featurestore.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/aiplatform/v1/featurestore.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\x1fgoogle/protobuf/timestamp.proto\"\x83\x08\n\x0c\x46\x65\x61turestore\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\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\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12I\n\x06labels\x18\x06 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.Featurestore.LabelsEntryB\x03\xe0\x41\x01\x12`\n\x15online_serving_config\x18\x07 \x01(\x0b\x32<.google.cloud.aiplatform.v1.Featurestore.OnlineServingConfigB\x03\xe0\x41\x01\x12\x42\n\x05state\x18\x08 \x01(\x0e\x32..google.cloud.aiplatform.v1.Featurestore.StateB\x03\xe0\x41\x03\x12$\n\x17online_storage_ttl_days\x18\r \x01(\x05\x42\x03\xe0\x41\x01\x12H\n\x0f\x65ncryption_spec\x18\n \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x1a\xeb\x01\n\x13OnlineServingConfig\x12\x18\n\x10\x66ixed_node_count\x18\x02 \x01(\x05\x12U\n\x07scaling\x18\x04 \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.Featurestore.OnlineServingConfig.Scaling\x1a\x63\n\x07Scaling\x12\x1b\n\x0emin_node_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\x0emax_node_count\x18\x02 \x01(\x05\x12#\n\x16\x63pu_utilization_target\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06STABLE\x10\x01\x12\x0c\n\x08UPDATING\x10\x02:q\xea\x41n\n&aiplatform.googleapis.com/Featurestore\x12\x44projects/{project}/locations/{location}/featurestores/{featurestore}B\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11\x46\x65\x61turestoreProtoP\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.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + Featurestore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Featurestore").msgclass + Featurestore::OnlineServingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Featurestore.OnlineServingConfig").msgclass + Featurestore::OnlineServingConfig::Scaling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Featurestore.OnlineServingConfig.Scaling").msgclass + Featurestore::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Featurestore.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb new file mode 100644 index 000000000000..155ddb060da5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/featurestore_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/entity_type_pb' +require 'google/cloud/aiplatform/v1/feature_pb' +require 'google/cloud/aiplatform/v1/feature_selector_pb' +require 'google/cloud/aiplatform/v1/featurestore_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/interval_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/featurestore_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/entity_type.proto\x1a(google/cloud/aiplatform/v1/feature.proto\x1a\x31google/cloud/aiplatform/v1/feature_selector.proto\x1a-google/cloud/aiplatform/v1/featurestore.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1agoogle/type/interval.proto\"\xbe\x01\n\x19\x43reateFeaturestoreRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&aiplatform.googleapis.com/Featurestore\x12\x43\n\x0c\x66\x65\x61turestore\x18\x02 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeaturestoreB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66\x65\x61turestore_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"V\n\x16GetFeaturestoreRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/Featurestore\"\xd2\x01\n\x18ListFeaturestoresRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&aiplatform.googleapis.com/Featurestore\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"u\n\x19ListFeaturestoresResponse\x12?\n\rfeaturestores\x18\x01 \x03(\x0b\x32(.google.cloud.aiplatform.v1.Featurestore\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x91\x01\n\x19UpdateFeaturestoreRequest\x12\x43\n\x0c\x66\x65\x61turestore\x18\x01 \x01(\x0b\x32(.google.cloud.aiplatform.v1.FeaturestoreB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"h\n\x19\x44\x65leteFeaturestoreRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/Featurestore\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x9e\x05\n\x1aImportFeatureValuesRequest\x12=\n\x0b\x61vro_source\x18\x02 \x01(\x0b\x32&.google.cloud.aiplatform.v1.AvroSourceH\x00\x12\x45\n\x0f\x62igquery_source\x18\x03 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceH\x00\x12;\n\ncsv_source\x18\x04 \x01(\x0b\x32%.google.cloud.aiplatform.v1.CsvSourceH\x00\x12\x1c\n\x12\x66\x65\x61ture_time_field\x18\x06 \x01(\tH\x01\x12\x32\n\x0c\x66\x65\x61ture_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x41\n\x0b\x65ntity_type\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x12\x17\n\x0f\x65ntity_id_field\x18\x05 \x01(\t\x12^\n\rfeature_specs\x18\x08 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.ImportFeatureValuesRequest.FeatureSpecB\x03\xe0\x41\x02\x12\x1e\n\x16\x64isable_online_serving\x18\t \x01(\x08\x12\x14\n\x0cworker_count\x18\x0b \x01(\x05\x12\"\n\x1a\x64isable_ingestion_analysis\x18\x0c \x01(\x08\x1a\x34\n\x0b\x46\x65\x61tureSpec\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0csource_field\x18\x02 \x01(\tB\x08\n\x06sourceB\x15\n\x13\x66\x65\x61ture_time_source\"\xad\x01\n\x1bImportFeatureValuesResponse\x12\x1d\n\x15imported_entity_count\x18\x01 \x01(\x03\x12$\n\x1cimported_feature_value_count\x18\x02 \x01(\x03\x12\x19\n\x11invalid_row_count\x18\x06 \x01(\x03\x12.\n×tamp_outside_retention_rows_count\x18\x04 \x01(\x03\"\xd1\x06\n\x1d\x42\x61tchReadFeatureValuesRequest\x12\x43\n\x12\x63sv_read_instances\x18\x03 \x01(\x0b\x32%.google.cloud.aiplatform.v1.CsvSourceH\x00\x12M\n\x17\x62igquery_read_instances\x18\x05 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceH\x00\x12\x44\n\x0c\x66\x65\x61turestore\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/Featurestore\x12M\n\x0b\x64\x65stination\x18\x04 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.FeatureValueDestinationB\x03\xe0\x41\x02\x12g\n\x13pass_through_fields\x18\x08 \x03(\x0b\x32J.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.PassThroughField\x12h\n\x11\x65ntity_type_specs\x18\x07 \x03(\x0b\x32H.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.EntityTypeSpecB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x1a+\n\x10PassThroughField\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xc2\x01\n\x0e\x45ntityTypeSpec\x12\x1b\n\x0e\x65ntity_type_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x10\x66\x65\x61ture_selector\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FeatureSelectorB\x03\xe0\x41\x02\x12G\n\x08settings\x18\x03 \x03(\x0b\x32\x35.google.cloud.aiplatform.v1.DestinationFeatureSettingB\r\n\x0bread_option\"\xe8\x05\n\x1a\x45xportFeatureValuesRequest\x12`\n\x0fsnapshot_export\x18\x03 \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.ExportFeatureValuesRequest.SnapshotExportH\x00\x12X\n\x0b\x66ull_export\x18\x07 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.ExportFeatureValuesRequest.FullExportH\x00\x12\x41\n\x0b\x65ntity_type\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x12M\n\x0b\x64\x65stination\x18\x04 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.FeatureValueDestinationB\x03\xe0\x41\x02\x12J\n\x10\x66\x65\x61ture_selector\x18\x05 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FeatureSelectorB\x03\xe0\x41\x02\x12G\n\x08settings\x18\x06 \x03(\x0b\x32\x35.google.cloud.aiplatform.v1.DestinationFeatureSetting\x1as\n\x0eSnapshotExport\x12\x31\n\rsnapshot_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aj\n\nFullExport\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04mode\"O\n\x19\x44\x65stinationFeatureSetting\x12\x17\n\nfeature_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x11\x64\x65stination_field\x18\x02 \x01(\t\"\x91\x02\n\x17\x46\x65\x61tureValueDestination\x12O\n\x14\x62igquery_destination\x18\x01 \x01(\x0b\x32/.google.cloud.aiplatform.v1.BigQueryDestinationH\x00\x12O\n\x14tfrecord_destination\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.TFRecordDestinationH\x00\x12\x45\n\x0f\x63sv_destination\x18\x03 \x01(\x0b\x32*.google.cloud.aiplatform.v1.CsvDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\x1d\n\x1b\x45xportFeatureValuesResponse\" \n\x1e\x42\x61tchReadFeatureValuesResponse\"\xb3\x01\n\x17\x43reateEntityTypeRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&aiplatform.googleapis.com/Featurestore\x12;\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32&.google.cloud.aiplatform.v1.EntityType\x12\x1b\n\x0e\x65ntity_type_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"R\n\x14GetEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\"\xce\x01\n\x16ListEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$aiplatform.googleapis.com/EntityType\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"p\n\x17ListEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.aiplatform.v1.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n\x17UpdateEntityTypeRequest\x12@\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32&.google.cloud.aiplatform.v1.EntityTypeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x17\x44\x65leteEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\xa5\x01\n\x14\x43reateFeatureRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!aiplatform.googleapis.com/Feature\x12\x39\n\x07\x66\x65\x61ture\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.FeatureB\x03\xe0\x41\x02\x12\x17\n\nfeature_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa0\x01\n\x1a\x42\x61tchCreateFeaturesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!aiplatform.googleapis.com/Feature\x12G\n\x08requests\x18\x02 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.CreateFeatureRequestB\x03\xe0\x41\x02\"T\n\x1b\x42\x61tchCreateFeaturesResponse\x12\x35\n\x08\x66\x65\x61tures\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Feature\"L\n\x11GetFeatureRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Feature\"\xe4\x01\n\x13ListFeaturesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!aiplatform.googleapis.com/Feature\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x1a\n\x12latest_stats_count\x18\x07 \x01(\x05\"f\n\x14ListFeaturesResponse\x12\x35\n\x08\x66\x65\x61tures\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Feature\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x15SearchFeaturesRequest\x12;\n\x08location\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"h\n\x16SearchFeaturesResponse\x12\x35\n\x08\x66\x65\x61tures\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Feature\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x82\x01\n\x14UpdateFeatureRequest\x12\x39\n\x07\x66\x65\x61ture\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.FeatureB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"O\n\x14\x44\x65leteFeatureRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Feature\"u\n#CreateFeaturestoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"u\n#UpdateFeaturestoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xbb\x02\n$ImportFeatureValuesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x1d\n\x15imported_entity_count\x18\x02 \x01(\x03\x12$\n\x1cimported_feature_value_count\x18\x03 \x01(\x03\x12\x13\n\x0bsource_uris\x18\x04 \x03(\t\x12\x19\n\x11invalid_row_count\x18\x06 \x01(\x03\x12.\n×tamp_outside_retention_rows_count\x18\x07 \x01(\x03\x12\x1e\n\x16\x62locking_operation_ids\x18\x08 \x03(\x03\"v\n$ExportFeatureValuesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"y\n\'BatchReadFeatureValuesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"v\n$DeleteFeatureValuesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"s\n!CreateEntityTypeOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"p\n\x1e\x43reateFeatureOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"v\n$BatchCreateFeaturesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xe5\x04\n\x1a\x44\x65leteFeatureValuesRequest\x12\\\n\rselect_entity\x18\x02 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectEntityH\x00\x12y\n\x1dselect_time_range_and_feature\x18\x03 \x01(\x0b\x32P.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeatureH\x00\x12\x41\n\x0b\x65ntity_type\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$aiplatform.googleapis.com/EntityType\x1a]\n\x0cSelectEntity\x12M\n\x12\x65ntity_id_selector\x18\x01 \x01(\x0b\x32,.google.cloud.aiplatform.v1.EntityIdSelectorB\x03\xe0\x41\x02\x1a\xbb\x01\n\x19SelectTimeRangeAndFeature\x12.\n\ntime_range\x18\x01 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x02\x12J\n\x10\x66\x65\x61ture_selector\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.FeatureSelectorB\x03\xe0\x41\x02\x12\"\n\x1askip_online_storage_delete\x18\x03 \x01(\x08\x42\x0e\n\x0c\x44\x65leteOption\"\x92\x04\n\x1b\x44\x65leteFeatureValuesResponse\x12]\n\rselect_entity\x18\x01 \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.DeleteFeatureValuesResponse.SelectEntityH\x00\x12z\n\x1dselect_time_range_and_feature\x18\x02 \x01(\x0b\x32Q.google.cloud.aiplatform.v1.DeleteFeatureValuesResponse.SelectTimeRangeAndFeatureH\x00\x1am\n\x0cSelectEntity\x12\x30\n(offline_storage_deleted_entity_row_count\x18\x01 \x01(\x03\x12+\n#online_storage_deleted_entity_count\x18\x02 \x01(\x03\x1a\x9c\x01\n\x19SelectTimeRangeAndFeature\x12\x1e\n\x16impacted_feature_count\x18\x01 \x01(\x03\x12\x31\n)offline_storage_modified_entity_row_count\x18\x02 \x01(\x03\x12,\n$online_storage_modified_entity_count\x18\x03 \x01(\x03\x42\n\n\x08response\"{\n\x10\x45ntityIdSelector\x12;\n\ncsv_source\x18\x03 \x01(\x0b\x32%.google.cloud.aiplatform.v1.CsvSourceH\x00\x12\x17\n\x0f\x65ntity_id_field\x18\x05 \x01(\tB\x11\n\x0f\x45ntityIdsSource2\xe6)\n\x13\x46\x65\x61turestoreService\x12\xa6\x02\n\x12\x43reateFeaturestore\x12\x35.google.cloud.aiplatform.v1.CreateFeaturestoreRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x33\n\x0c\x46\x65\x61turestore\x12#CreateFeaturestoreOperationMetadata\xda\x41\x13parent,featurestore\xda\x41#parent,featurestore,featurestore_id\x82\xd3\xe4\x93\x02\x41\"1/v1/{parent=projects/*/locations/*}/featurestores:\x0c\x66\x65\x61turestore\x12\xb1\x01\n\x0fGetFeaturestore\x12\x32.google.cloud.aiplatform.v1.GetFeaturestoreRequest\x1a(.google.cloud.aiplatform.v1.Featurestore\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/featurestores/*}\x12\xc4\x01\n\x11ListFeaturestores\x12\x34.google.cloud.aiplatform.v1.ListFeaturestoresRequest\x1a\x35.google.cloud.aiplatform.v1.ListFeaturestoresResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/featurestores\x12\x92\x02\n\x12UpdateFeaturestore\x12\x35.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest\x1a\x1d.google.longrunning.Operation\"\xa5\x01\xca\x41\x33\n\x0c\x46\x65\x61turestore\x12#UpdateFeaturestoreOperationMetadata\xda\x41\x18\x66\x65\x61turestore,update_mask\x82\xd3\xe4\x93\x02N2>/v1/{featurestore.name=projects/*/locations/*/featurestores/*}:\x0c\x66\x65\x61turestore\x12\xed\x01\n\x12\x44\x65leteFeaturestore\x12\x35.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/featurestores/*}\x12\xa8\x02\n\x10\x43reateEntityType\x12\x33.google.cloud.aiplatform.v1.CreateEntityTypeRequest\x1a\x1d.google.longrunning.Operation\"\xbf\x01\xca\x41/\n\nEntityType\x12!CreateEntityTypeOperationMetadata\xda\x41\x12parent,entity_type\xda\x41!parent,entity_type,entity_type_id\x82\xd3\xe4\x93\x02N\"?/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes:\x0b\x65ntity_type\x12\xb9\x01\n\rGetEntityType\x12\x30.google.cloud.aiplatform.v1.GetEntityTypeRequest\x1a&.google.cloud.aiplatform.v1.EntityType\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}\x12\xcc\x01\n\x0fListEntityTypes\x12\x32.google.cloud.aiplatform.v1.ListEntityTypesRequest\x1a\x33.google.cloud.aiplatform.v1.ListEntityTypesResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes\x12\xeb\x01\n\x10UpdateEntityType\x12\x33.google.cloud.aiplatform.v1.UpdateEntityTypeRequest\x1a&.google.cloud.aiplatform.v1.EntityType\"z\xda\x41\x17\x65ntity_type,update_mask\x82\xd3\xe4\x93\x02Z2K/v1/{entity_type.name=projects/*/locations/*/featurestores/*/entityTypes/*}:\x0b\x65ntity_type\x12\xf7\x01\n\x10\x44\x65leteEntityType\x12\x33.google.cloud.aiplatform.v1.DeleteEntityTypeRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}\x12\x97\x02\n\rCreateFeature\x12\x30.google.cloud.aiplatform.v1.CreateFeatureRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41)\n\x07\x46\x65\x61ture\x12\x1e\x43reateFeatureOperationMetadata\xda\x41\x0eparent,feature\xda\x41\x19parent,feature,feature_id\x82\xd3\xe4\x93\x02U\"J/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:\x07\x66\x65\x61ture\x12\xa8\x02\n\x13\x42\x61tchCreateFeatures\x12\x36.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x43\n\x1b\x42\x61tchCreateFeaturesResponse\x12$BatchCreateFeaturesOperationMetadata\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02[\"V/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:batchCreate:\x01*\x12\xbb\x01\n\nGetFeature\x12-.google.cloud.aiplatform.v1.GetFeatureRequest\x1a#.google.cloud.aiplatform.v1.Feature\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\x12J/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}\x12\xce\x01\n\x0cListFeatures\x12/.google.cloud.aiplatform.v1.ListFeaturesRequest\x1a\x30.google.cloud.aiplatform.v1.ListFeaturesResponse\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L\x12J/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features\x12\xe1\x01\n\rUpdateFeature\x12\x30.google.cloud.aiplatform.v1.UpdateFeatureRequest\x1a#.google.cloud.aiplatform.v1.Feature\"y\xda\x41\x13\x66\x65\x61ture,update_mask\x82\xd3\xe4\x93\x02]2R/v1/{feature.name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}:\x07\x66\x65\x61ture\x12\xef\x01\n\rDeleteFeature\x12\x30.google.cloud.aiplatform.v1.DeleteFeatureRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02L*J/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}\x12\xa8\x02\n\x13ImportFeatureValues\x12\x36.google.cloud.aiplatform.v1.ImportFeatureValuesRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x43\n\x1bImportFeatureValuesResponse\x12$ImportFeatureValuesOperationMetadata\xda\x41\x0b\x65ntity_type\x82\xd3\xe4\x93\x02_\"Z/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:importFeatureValues:\x01*\x12\xab\x02\n\x16\x42\x61tchReadFeatureValues\x12\x39.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x01\xca\x41I\n\x1e\x42\x61tchReadFeatureValuesResponse\x12\'BatchReadFeatureValuesOperationMetadata\xda\x41\x0c\x66\x65\x61turestore\x82\xd3\xe4\x93\x02U\"P/v1/{featurestore=projects/*/locations/*/featurestores/*}:batchReadFeatureValues:\x01*\x12\xa8\x02\n\x13\x45xportFeatureValues\x12\x36.google.cloud.aiplatform.v1.ExportFeatureValuesRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x43\n\x1b\x45xportFeatureValuesResponse\x12$ExportFeatureValuesOperationMetadata\xda\x41\x0b\x65ntity_type\x82\xd3\xe4\x93\x02_\"Z/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:exportFeatureValues:\x01*\x12\xa8\x02\n\x13\x44\x65leteFeatureValues\x12\x36.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x43\n\x1b\x44\x65leteFeatureValuesResponse\x12$DeleteFeatureValuesOperationMetadata\xda\x41\x0b\x65ntity_type\x82\xd3\xe4\x93\x02_\"Z/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:deleteFeatureValues:\x01*\x12\xdf\x01\n\x0eSearchFeatures\x12\x31.google.cloud.aiplatform.v1.SearchFeaturesRequest\x1a\x32.google.cloud.aiplatform.v1.SearchFeaturesResponse\"f\xda\x41\x08location\xda\x41\x0elocation,query\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{location=projects/*/locations/*}/featurestores:searchFeatures\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd6\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x18\x46\x65\x61turestoreServiceProtoP\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.Featurestore", "google/cloud/aiplatform/v1/featurestore.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.AvroSource", "google/cloud/aiplatform/v1/io.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.FeatureSelector", "google/cloud/aiplatform/v1/feature_selector.proto"], + ["google.cloud.aiplatform.v1.EntityType", "google/cloud/aiplatform/v1/entity_type.proto"], + ["google.cloud.aiplatform.v1.Feature", "google/cloud/aiplatform/v1/feature.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.type.Interval", "google/type/interval.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 + CreateFeaturestoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeaturestoreRequest").msgclass + GetFeaturestoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeaturestoreRequest").msgclass + ListFeaturestoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeaturestoresRequest").msgclass + ListFeaturestoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeaturestoresResponse").msgclass + UpdateFeaturestoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeaturestoreRequest").msgclass + DeleteFeaturestoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeaturestoreRequest").msgclass + ImportFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportFeatureValuesRequest").msgclass + ImportFeatureValuesRequest::FeatureSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportFeatureValuesRequest.FeatureSpec").msgclass + ImportFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportFeatureValuesResponse").msgclass + BatchReadFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest").msgclass + BatchReadFeatureValuesRequest::PassThroughField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.PassThroughField").msgclass + BatchReadFeatureValuesRequest::EntityTypeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.EntityTypeSpec").msgclass + ExportFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFeatureValuesRequest").msgclass + ExportFeatureValuesRequest::SnapshotExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFeatureValuesRequest.SnapshotExport").msgclass + ExportFeatureValuesRequest::FullExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFeatureValuesRequest.FullExport").msgclass + DestinationFeatureSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DestinationFeatureSetting").msgclass + FeatureValueDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureValueDestination").msgclass + ExportFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFeatureValuesResponse").msgclass + BatchReadFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadFeatureValuesResponse").msgclass + CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateEntityTypeRequest").msgclass + GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetEntityTypeRequest").msgclass + ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEntityTypesRequest").msgclass + ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEntityTypesResponse").msgclass + UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateEntityTypeRequest").msgclass + DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteEntityTypeRequest").msgclass + CreateFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureRequest").msgclass + BatchCreateFeaturesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateFeaturesRequest").msgclass + BatchCreateFeaturesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateFeaturesResponse").msgclass + GetFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetFeatureRequest").msgclass + ListFeaturesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeaturesRequest").msgclass + ListFeaturesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListFeaturesResponse").msgclass + SearchFeaturesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchFeaturesRequest").msgclass + SearchFeaturesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchFeaturesResponse").msgclass + UpdateFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeatureRequest").msgclass + DeleteFeatureRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureRequest").msgclass + CreateFeaturestoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeaturestoreOperationMetadata").msgclass + UpdateFeaturestoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateFeaturestoreOperationMetadata").msgclass + ImportFeatureValuesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportFeatureValuesOperationMetadata").msgclass + ExportFeatureValuesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportFeatureValuesOperationMetadata").msgclass + BatchReadFeatureValuesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadFeatureValuesOperationMetadata").msgclass + DeleteFeatureValuesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesOperationMetadata").msgclass + CreateEntityTypeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateEntityTypeOperationMetadata").msgclass + CreateFeatureOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateFeatureOperationMetadata").msgclass + BatchCreateFeaturesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateFeaturesOperationMetadata").msgclass + DeleteFeatureValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesRequest").msgclass + DeleteFeatureValuesRequest::SelectEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectEntity").msgclass + DeleteFeatureValuesRequest::SelectTimeRangeAndFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeature").msgclass + DeleteFeatureValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesResponse").msgclass + DeleteFeatureValuesResponse::SelectEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesResponse.SelectEntity").msgclass + DeleteFeatureValuesResponse::SelectTimeRangeAndFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteFeatureValuesResponse.SelectTimeRangeAndFeature").msgclass + EntityIdSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EntityIdSelector").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_services_pb.rb new file mode 100644 index 000000000000..7cd0a1941e4e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_services_pb.rb @@ -0,0 +1,120 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/featurestore_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/featurestore_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module FeaturestoreService + # The service that handles CRUD and List for resources for Featurestore. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.FeaturestoreService' + + # Creates a new Featurestore in a given project and location. + rpc :CreateFeaturestore, ::Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest, ::Google::Longrunning::Operation + # Gets details of a single Featurestore. + rpc :GetFeaturestore, ::Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest, ::Google::Cloud::AIPlatform::V1::Featurestore + # Lists Featurestores in a given project and location. + rpc :ListFeaturestores, ::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest, ::Google::Cloud::AIPlatform::V1::ListFeaturestoresResponse + # Updates the parameters of a single Featurestore. + rpc :UpdateFeaturestore, ::Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest, ::Google::Longrunning::Operation + # Deletes a single Featurestore. The Featurestore must not contain any + # EntityTypes or `force` must be set to true for the request to succeed. + rpc :DeleteFeaturestore, ::Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest, ::Google::Longrunning::Operation + # Creates a new EntityType in a given Featurestore. + rpc :CreateEntityType, ::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest, ::Google::Longrunning::Operation + # Gets details of a single EntityType. + rpc :GetEntityType, ::Google::Cloud::AIPlatform::V1::GetEntityTypeRequest, ::Google::Cloud::AIPlatform::V1::EntityType + # Lists EntityTypes in a given Featurestore. + rpc :ListEntityTypes, ::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest, ::Google::Cloud::AIPlatform::V1::ListEntityTypesResponse + # Updates the parameters of a single EntityType. + rpc :UpdateEntityType, ::Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest, ::Google::Cloud::AIPlatform::V1::EntityType + # Deletes a single EntityType. The EntityType must not have any Features + # or `force` must be set to true for the request to succeed. + rpc :DeleteEntityType, ::Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest, ::Google::Longrunning::Operation + # Creates a new Feature in a given EntityType. + rpc :CreateFeature, ::Google::Cloud::AIPlatform::V1::CreateFeatureRequest, ::Google::Longrunning::Operation + # Creates a batch of Features in a given EntityType. + rpc :BatchCreateFeatures, ::Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest, ::Google::Longrunning::Operation + # Gets details of a single Feature. + rpc :GetFeature, ::Google::Cloud::AIPlatform::V1::GetFeatureRequest, ::Google::Cloud::AIPlatform::V1::Feature + # Lists Features in a given EntityType. + rpc :ListFeatures, ::Google::Cloud::AIPlatform::V1::ListFeaturesRequest, ::Google::Cloud::AIPlatform::V1::ListFeaturesResponse + # Updates the parameters of a single Feature. + rpc :UpdateFeature, ::Google::Cloud::AIPlatform::V1::UpdateFeatureRequest, ::Google::Cloud::AIPlatform::V1::Feature + # Deletes a single Feature. + rpc :DeleteFeature, ::Google::Cloud::AIPlatform::V1::DeleteFeatureRequest, ::Google::Longrunning::Operation + # Imports Feature values into the Featurestore from a source storage. + # + # The progress of the import is tracked by the returned operation. The + # imported features are guaranteed to be visible to subsequent read + # operations after the operation is marked as successfully done. + # + # If an import operation fails, the Feature values returned from + # reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same import request again and wait till + # the new operation returned is marked as successfully done. + # + # There are also scenarios where the caller can cause inconsistency. + # + # - Source data for import contains multiple distinct Feature values for + # the same entity ID and timestamp. + # - Source is modified during an import. This includes adding, updating, or + # removing source data and/or metadata. Examples of updating metadata + # include but are not limited to changing storage location, storage class, + # or retention policy. + # - Online serving cluster is under-provisioned. + rpc :ImportFeatureValues, ::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest, ::Google::Longrunning::Operation + # Batch reads Feature values from a Featurestore. + # + # This API enables batch reading Feature values, where each read + # instance in the batch may read Feature values of entities from one or + # more EntityTypes. Point-in-time correctness is guaranteed for Feature + # values of each read instance as of each instance's read timestamp. + rpc :BatchReadFeatureValues, ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest, ::Google::Longrunning::Operation + # Exports Feature values from all the entities of a target EntityType. + rpc :ExportFeatureValues, ::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest, ::Google::Longrunning::Operation + # Delete Feature values from Featurestore. + # + # The progress of the deletion is tracked by the returned operation. The + # deleted feature values are guaranteed to be invisible to subsequent read + # operations after the operation is marked as successfully done. + # + # If a delete feature values operation fails, the feature values + # returned from reads and exports may be inconsistent. If consistency is + # required, the caller must retry the same delete request again and wait till + # the new operation returned is marked as successfully done. + rpc :DeleteFeatureValues, ::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest, ::Google::Longrunning::Operation + # Searches Features matching a query in a given project. + rpc :SearchFeatures, ::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest, ::Google::Cloud::AIPlatform::V1::SearchFeaturesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_pb.rb new file mode 100644 index 000000000000..3db6dd9ebd68 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/gen_ai_cache_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/cached_content_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/gen_ai_cache_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/cached_content.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa5\x01\n\x1a\x43reateCachedContentRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'aiplatform.googleapis.com/CachedContent\x12\x46\n\x0e\x63\x61\x63hed_content\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.CachedContentB\x03\xe0\x41\x02\"X\n\x17GetCachedContentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/CachedContent\"\x9a\x01\n\x1aUpdateCachedContentRequest\x12\x46\n\x0e\x63\x61\x63hed_content\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.CachedContentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"[\n\x1a\x44\x65leteCachedContentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/CachedContent\"\x8d\x01\n\x19ListCachedContentsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'aiplatform.googleapis.com/CachedContent\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\"y\n\x1aListCachedContentsResponse\x12\x42\n\x0f\x63\x61\x63hed_contents\x18\x01 \x03(\x0b\x32).google.cloud.aiplatform.v1.CachedContent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe2\x08\n\x11GenAiCacheService\x12\xdc\x01\n\x13\x43reateCachedContent\x12\x36.google.cloud.aiplatform.v1.CreateCachedContentRequest\x1a).google.cloud.aiplatform.v1.CachedContent\"b\xda\x41\x15parent,cached_content\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/cachedContents:\x0e\x63\x61\x63hed_content\x12\xb5\x01\n\x10GetCachedContent\x12\x33.google.cloud.aiplatform.v1.GetCachedContentRequest\x1a).google.cloud.aiplatform.v1.CachedContent\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/cachedContents/*}\x12\xf0\x01\n\x13UpdateCachedContent\x12\x36.google.cloud.aiplatform.v1.UpdateCachedContentRequest\x1a).google.cloud.aiplatform.v1.CachedContent\"v\xda\x41\x1a\x63\x61\x63hed_content,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{cached_content.name=projects/*/locations/*/cachedContents/*}:\x0e\x63\x61\x63hed_content\x12\xa8\x01\n\x13\x44\x65leteCachedContent\x12\x36.google.cloud.aiplatform.v1.DeleteCachedContentRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/cachedContents/*}\x12\xc8\x01\n\x12ListCachedContents\x12\x35.google.cloud.aiplatform.v1.ListCachedContentsRequest\x1a\x36.google.cloud.aiplatform.v1.ListCachedContentsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/cachedContents\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16GenAiCacheServiceProtoP\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.CachedContent", "google/cloud/aiplatform/v1/cached_content.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 + CreateCachedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateCachedContentRequest").msgclass + GetCachedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetCachedContentRequest").msgclass + UpdateCachedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateCachedContentRequest").msgclass + DeleteCachedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteCachedContentRequest").msgclass + ListCachedContentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListCachedContentsRequest").msgclass + ListCachedContentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListCachedContentsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb.rb new file mode 100644 index 000000000000..ea89eac8a86f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/gen_ai_cache_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/gen_ai_cache_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiCacheService + # Service for managing Vertex AI's CachedContent resource. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.GenAiCacheService' + + # Creates cached content, this call will initialize the cached content in the + # data storage, and users need to pay for the cache data storage. + rpc :CreateCachedContent, ::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest, ::Google::Cloud::AIPlatform::V1::CachedContent + # Gets cached content configurations + rpc :GetCachedContent, ::Google::Cloud::AIPlatform::V1::GetCachedContentRequest, ::Google::Cloud::AIPlatform::V1::CachedContent + # Updates cached content configurations + rpc :UpdateCachedContent, ::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest, ::Google::Cloud::AIPlatform::V1::CachedContent + # Deletes cached content + rpc :DeleteCachedContent, ::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest, ::Google::Protobuf::Empty + # Lists cached contents in a project + rpc :ListCachedContents, ::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest, ::Google::Cloud::AIPlatform::V1::ListCachedContentsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb new file mode 100644 index 000000000000..2e464b6a9c27 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/genai_tuning_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/io_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/cloud/aiplatform/v1/tuning_job_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/genai_tuning_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/io.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a+google/cloud/aiplatform/v1/tuning_job.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x93\x01\n\x16\x43reateTuningJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12>\n\ntuning_job\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.TuningJobB\x03\xe0\x41\x02\"P\n\x13GetTuningJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/TuningJob\"\x98\x01\n\x15ListTuningJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"m\n\x16ListTuningJobsResponse\x12:\n\x0btuning_jobs\x18\x01 \x03(\x0b\x32%.google.cloud.aiplatform.v1.TuningJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x16\x43\x61ncelTuningJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/TuningJob\"\xd2\x02\n\x17RebaseTunedModelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12G\n\x0ftuned_model_ref\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.TunedModelRefB\x03\xe0\x41\x02\x12>\n\ntuning_job\x18\x03 \x01(\x0b\x32%.google.cloud.aiplatform.v1.TuningJobB\x03\xe0\x41\x01\x12M\n\x14\x61rtifact_destination\x18\x04 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationB\x03\xe0\x41\x01\x12$\n\x17\x64\x65ploy_to_same_endpoint\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"s\n!RebaseTunedModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\xb6\x08\n\x12GenAiTuningService\x12\xc4\x01\n\x0f\x43reateTuningJob\x12\x32.google.cloud.aiplatform.v1.CreateTuningJobRequest\x1a%.google.cloud.aiplatform.v1.TuningJob\"V\xda\x41\x11parent,tuning_job\x82\xd3\xe4\x93\x02<\"./v1/{parent=projects/*/locations/*}/tuningJobs:\ntuning_job\x12\xa5\x01\n\x0cGetTuningJob\x12/.google.cloud.aiplatform.v1.GetTuningJobRequest\x1a%.google.cloud.aiplatform.v1.TuningJob\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/tuningJobs/*}\x12\xb8\x01\n\x0eListTuningJobs\x12\x31.google.cloud.aiplatform.v1.ListTuningJobsRequest\x1a\x32.google.cloud.aiplatform.v1.ListTuningJobsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/tuningJobs\x12\xa6\x01\n\x0f\x43\x61ncelTuningJob\x12\x32.google.cloud.aiplatform.v1.CancelTuningJobRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/tuningJobs/*}:cancel:\x01*\x12\xfd\x01\n\x10RebaseTunedModel\x12\x33.google.cloud.aiplatform.v1.RebaseTunedModelRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41.\n\tTuningJob\x12!RebaseTunedModelOperationMetadata\xda\x41\x16parent,tuned_model_ref\x82\xd3\xe4\x93\x02\x44\"?/v1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17GenAiTuningServiceProtoP\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.TuningJob", "google/cloud/aiplatform/v1/tuning_job.proto"], + ["google.cloud.aiplatform.v1.GcsDestination", "google/cloud/aiplatform/v1/io.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + CreateTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTuningJobRequest").msgclass + GetTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTuningJobRequest").msgclass + ListTuningJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTuningJobsRequest").msgclass + ListTuningJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTuningJobsResponse").msgclass + CancelTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelTuningJobRequest").msgclass + RebaseTunedModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RebaseTunedModelRequest").msgclass + RebaseTunedModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb new file mode 100644 index 000000000000..128610673133 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/genai_tuning_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/genai_tuning_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module GenAiTuningService + # A service for creating and managing GenAI Tuning Jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.GenAiTuningService' + + # Creates a TuningJob. A created TuningJob right away will be attempted to + # be run. + rpc :CreateTuningJob, ::Google::Cloud::AIPlatform::V1::CreateTuningJobRequest, ::Google::Cloud::AIPlatform::V1::TuningJob + # Gets a TuningJob. + rpc :GetTuningJob, ::Google::Cloud::AIPlatform::V1::GetTuningJobRequest, ::Google::Cloud::AIPlatform::V1::TuningJob + # Lists TuningJobs in a Location. + rpc :ListTuningJobs, ::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest, ::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse + # Cancels a TuningJob. + # Starts asynchronous cancellation on the TuningJob. The server makes a best + # effort to cancel the job, but success is not guaranteed. Clients can use + # [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob] + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, the + # TuningJob is not deleted; instead it becomes a job with a + # [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a + # [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + # `Code.CANCELLED`, and + # [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to + # `CANCELLED`. + rpc :CancelTuningJob, ::Google::Cloud::AIPlatform::V1::CancelTuningJobRequest, ::Google::Protobuf::Empty + # Rebase a TunedModel. + rpc :RebaseTunedModel, ::Google::Cloud::AIPlatform::V1::RebaseTunedModelRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb new file mode 100644 index 000000000000..8921959bc61c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/custom_job_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/study_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/aiplatform/v1/custom_job.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a&google/cloud/aiplatform/v1/study.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb3\x08\n\x17HyperparameterTuningJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\nstudy_spec\x18\x04 \x01(\x0b\x32%.google.cloud.aiplatform.v1.StudySpecB\x03\xe0\x41\x02\x12\x1c\n\x0fmax_trial_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x02\x12!\n\x14parallel_trial_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x16max_failed_trial_count\x18\x07 \x01(\x05\x12\x46\n\x0etrial_job_spec\x18\x08 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12\x36\n\x06trials\x18\t \x03(\x0b\x32!.google.cloud.aiplatform.v1.TrialB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12O\n\x06labels\x18\x10 \x03(\x0b\x32?.google.cloud.aiplatform.v1.HyperparameterTuningJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x11 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x1a\n\rsatisfies_pzs\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x95\x01\xea\x41\x91\x01\n1aiplatform.googleapis.com/HyperparameterTuningJob\x12\\projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}B\xda\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1cHyperparameterTuningJobProtoP\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.StudySpec", "google/cloud/aiplatform/v1/study.proto"], + ["google.cloud.aiplatform.v1.CustomJobSpec", "google/cloud/aiplatform/v1/custom_job.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + HyperparameterTuningJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.HyperparameterTuningJob").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb new file mode 100644 index 000000000000..9babe9814159 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/index_endpoint.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/service_networking_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/aiplatform/v1/index_endpoint.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\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x33google/cloud/aiplatform/v1/service_networking.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x07\n\rIndexEndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12H\n\x10\x64\x65ployed_indexes\x18\x04 \x03(\x0b\x32).google.cloud.aiplatform.v1.DeployedIndexB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x05 \x01(\t\x12\x45\n\x06labels\x18\x06 \x03(\x0b\x32\x35.google.cloud.aiplatform.v1.IndexEndpoint.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07network\x18\t \x01(\tB\x03\xe0\x41\x01\x12-\n\x1e\x65nable_private_service_connect\x18\n \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x64\n\x1eprivate_service_connect_config\x18\x0c \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.PrivateServiceConnectConfigB\x03\xe0\x41\x01\x12$\n\x17public_endpoint_enabled\x18\r \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1bpublic_endpoint_domain_name\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12H\n\x0f\x65ncryption_spec\x18\x0f \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x05\x12\x1a\n\rsatisfies_pzs\x18\x11 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:u\xea\x41r\n\'aiplatform.googleapis.com/IndexEndpoint\x12Gprojects/{project}/locations/{location}/indexEndpoints/{index_endpoint}\"\xed\x05\n\rDeployedIndex\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x05index\x18\x02 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Index\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x11private_endpoints\x18\x05 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.IndexPrivateEndpointsB\x03\xe0\x41\x03\x12\x38\n\x0findex_sync_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x13\x61utomatic_resources\x18\x07 \x01(\x0b\x32..google.cloud.aiplatform.v1.AutomaticResourcesB\x03\xe0\x41\x01\x12P\n\x13\x64\x65\x64icated_resources\x18\x10 \x01(\x0b\x32..google.cloud.aiplatform.v1.DedicatedResourcesB\x03\xe0\x41\x01\x12\"\n\x15\x65nable_access_logging\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\\\n\x1a\x64\x65ployed_index_auth_config\x18\t \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.DeployedIndexAuthConfigB\x03\xe0\x41\x01\x12\x1f\n\x12reserved_ip_ranges\x18\n \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x64\x65ployment_group\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12T\n\x16psc_automation_configs\x18\x13 \x03(\x0b\x32/.google.cloud.aiplatform.v1.PSCAutomationConfigB\x03\xe0\x41\x01\"\xae\x01\n\x17\x44\x65ployedIndexAuthConfig\x12W\n\rauth_provider\x18\x01 \x01(\x0b\x32@.google.cloud.aiplatform.v1.DeployedIndexAuthConfig.AuthProvider\x1a:\n\x0c\x41uthProvider\x12\x11\n\taudiences\x18\x01 \x03(\t\x12\x17\n\x0f\x61llowed_issuers\x18\x02 \x03(\t\"\xb2\x01\n\x15IndexPrivateEndpoints\x12\x1f\n\x12match_grpc_address\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12service_attachment\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12W\n\x17psc_automated_endpoints\x18\x03 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.PscAutomatedEndpointsB\x03\xe0\x41\x03\x42\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12IndexEndpointProtoP\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.cloud.aiplatform.v1.PrivateServiceConnectConfig", "google/cloud/aiplatform/v1/service_networking.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.AutomaticResources", "google/cloud/aiplatform/v1/machine_resources.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 + IndexEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexEndpoint").msgclass + DeployedIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedIndex").msgclass + DeployedIndexAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedIndexAuthConfig").msgclass + DeployedIndexAuthConfig::AuthProvider = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployedIndexAuthConfig.AuthProvider").msgclass + IndexPrivateEndpoints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexPrivateEndpoints").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb new file mode 100644 index 000000000000..e9d8e43c48bd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/index_endpoint_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/index_endpoint_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n7google/cloud/aiplatform/v1/index_endpoint_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/index_endpoint.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9f\x01\n\x1a\x43reateIndexEndpointRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x46\n\x0eindex_endpoint\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.IndexEndpointB\x03\xe0\x41\x02\"v\n$CreateIndexEndpointOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"X\n\x17GetIndexEndpointRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\"\xd0\x01\n\x19ListIndexEndpointsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"y\n\x1aListIndexEndpointsResponse\x12\x42\n\x0findex_endpoints\x18\x01 \x03(\x0b\x32).google.cloud.aiplatform.v1.IndexEndpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9a\x01\n\x1aUpdateIndexEndpointRequest\x12\x46\n\x0eindex_endpoint\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.IndexEndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"[\n\x1a\x44\x65leteIndexEndpointRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\"\xa5\x01\n\x12\x44\x65ployIndexRequest\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x46\n\x0e\x64\x65ployed_index\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedIndexB\x03\xe0\x41\x02\"X\n\x13\x44\x65ployIndexResponse\x12\x41\n\x0e\x64\x65ployed_index\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedIndex\"\x89\x01\n\x1c\x44\x65ployIndexOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x19\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\t\"\x7f\n\x14UndeployIndexRequest\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x1e\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x17\n\x15UndeployIndexResponse\"p\n\x1eUndeployIndexOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xad\x01\n\x1aMutateDeployedIndexRequest\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x46\n\x0e\x64\x65ployed_index\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedIndexB\x03\xe0\x41\x02\"`\n\x1bMutateDeployedIndexResponse\x12\x41\n\x0e\x64\x65ployed_index\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.DeployedIndex\"\x91\x01\n$MutateDeployedIndexOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x19\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\t2\xaf\x10\n\x14IndexEndpointService\x12\x89\x02\n\x13\x43reateIndexEndpoint\x12\x36.google.cloud.aiplatform.v1.CreateIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41\x35\n\rIndexEndpoint\x12$CreateIndexEndpointOperationMetadata\xda\x41\x15parent,index_endpoint\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/indexEndpoints:\x0eindex_endpoint\x12\xb5\x01\n\x10GetIndexEndpoint\x12\x33.google.cloud.aiplatform.v1.GetIndexEndpointRequest\x1a).google.cloud.aiplatform.v1.IndexEndpoint\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\xc8\x01\n\x12ListIndexEndpoints\x12\x35.google.cloud.aiplatform.v1.ListIndexEndpointsRequest\x1a\x36.google.cloud.aiplatform.v1.ListIndexEndpointsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/indexEndpoints\x12\xf0\x01\n\x13UpdateIndexEndpoint\x12\x36.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest\x1a).google.cloud.aiplatform.v1.IndexEndpoint\"v\xda\x41\x1aindex_endpoint,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}:\x0eindex_endpoint\x12\xe2\x01\n\x13\x44\x65leteIndexEndpoint\x12\x36.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\x88\x02\n\x0b\x44\x65ployIndex\x12..google.cloud.aiplatform.v1.DeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41\x33\n\x13\x44\x65ployIndexResponse\x12\x1c\x44\x65ployIndexOperationMetadata\xda\x41\x1dindex_endpoint,deployed_index\x82\xd3\xe4\x93\x02M\"H/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex:\x01*\x12\x95\x02\n\rUndeployIndex\x12\x30.google.cloud.aiplatform.v1.UndeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x37\n\x15UndeployIndexResponse\x12\x1eUndeployIndexOperationMetadata\xda\x41 index_endpoint,deployed_index_id\x82\xd3\xe4\x93\x02O\"J/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex:\x01*\x12\xbd\x02\n\x13MutateDeployedIndex\x12\x36.google.cloud.aiplatform.v1.MutateDeployedIndexRequest\x1a\x1d.google.longrunning.Operation\"\xce\x01\xca\x41\x43\n\x1bMutateDeployedIndexResponse\x12$MutateDeployedIndexOperationMetadata\xda\x41\x1dindex_endpoint,deployed_index\x82\xd3\xe4\x93\x02\x62\"P/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex:\x0e\x64\x65ployed_index\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd7\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x19IndexEndpointServiceProtoP\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.IndexEndpoint", "google/cloud/aiplatform/v1/index_endpoint.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 + CreateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateIndexEndpointRequest").msgclass + CreateIndexEndpointOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateIndexEndpointOperationMetadata").msgclass + GetIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetIndexEndpointRequest").msgclass + ListIndexEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListIndexEndpointsRequest").msgclass + ListIndexEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListIndexEndpointsResponse").msgclass + UpdateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateIndexEndpointRequest").msgclass + DeleteIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteIndexEndpointRequest").msgclass + DeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployIndexRequest").msgclass + DeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployIndexResponse").msgclass + DeployIndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeployIndexOperationMetadata").msgclass + UndeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployIndexRequest").msgclass + UndeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployIndexResponse").msgclass + UndeployIndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UndeployIndexOperationMetadata").msgclass + MutateDeployedIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedIndexRequest").msgclass + MutateDeployedIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedIndexResponse").msgclass + MutateDeployedIndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MutateDeployedIndexOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_services_pb.rb new file mode 100644 index 000000000000..3d417000de36 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_endpoint_service_services_pb.rb @@ -0,0 +1,62 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/index_endpoint_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/index_endpoint_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module IndexEndpointService + # A service for managing Vertex AI's IndexEndpoints. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.IndexEndpointService' + + # Creates an IndexEndpoint. + rpc :CreateIndexEndpoint, ::Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest, ::Google::Longrunning::Operation + # Gets an IndexEndpoint. + rpc :GetIndexEndpoint, ::Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest, ::Google::Cloud::AIPlatform::V1::IndexEndpoint + # Lists IndexEndpoints in a Location. + rpc :ListIndexEndpoints, ::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest, ::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse + # Updates an IndexEndpoint. + rpc :UpdateIndexEndpoint, ::Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest, ::Google::Cloud::AIPlatform::V1::IndexEndpoint + # Deletes an IndexEndpoint. + rpc :DeleteIndexEndpoint, ::Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest, ::Google::Longrunning::Operation + # Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + # it. + # Only non-empty Indexes can be deployed. + rpc :DeployIndex, ::Google::Cloud::AIPlatform::V1::DeployIndexRequest, ::Google::Longrunning::Operation + # Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + # and freeing all resources it's using. + rpc :UndeployIndex, ::Google::Cloud::AIPlatform::V1::UndeployIndexRequest, ::Google::Longrunning::Operation + # Update an existing DeployedIndex under an IndexEndpoint. + rpc :MutateDeployedIndex, ::Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_pb.rb new file mode 100644 index 000000000000..8168d9dadb25 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/index.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/deployed_index_ref_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/index.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/aiplatform/v1/deployed_index_ref.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa4\x07\n\x05Index\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12 \n\x13metadata_schema_uri\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12(\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.Value\x12K\n\x10\x64\x65ployed_indexes\x18\x07 \x03(\x0b\x32,.google.cloud.aiplatform.v1.DeployedIndexRefB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x08 \x01(\t\x12=\n\x06labels\x18\t \x03(\x0b\x32-.google.cloud.aiplatform.v1.Index.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x0bindex_stats\x18\x0e \x01(\x0b\x32&.google.cloud.aiplatform.v1.IndexStatsB\x03\xe0\x41\x03\x12U\n\x13index_update_method\x18\x10 \x01(\x0e\x32\x33.google.cloud.aiplatform.v1.Index.IndexUpdateMethodB\x03\xe0\x41\x05\x12H\n\x0f\x65ncryption_spec\x18\x11 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x05\x12\x1a\n\rsatisfies_pzs\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"]\n\x11IndexUpdateMethod\x12#\n\x1fINDEX_UPDATE_METHOD_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x42\x41TCH_UPDATE\x10\x01\x12\x11\n\rSTREAM_UPDATE\x10\x02:]\xea\x41Z\n\x1f\x61iplatform.googleapis.com/Index\x12\x37projects/{project}/locations/{location}/indexes/{index}\"\x9f\x07\n\x0eIndexDatapoint\x12\x19\n\x0c\x64\x61tapoint_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0e\x66\x65\x61ture_vector\x18\x02 \x03(\x02\x42\x03\xe0\x41\x02\x12Y\n\x10sparse_embedding\x18\x07 \x01(\x0b\x32:.google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbeddingB\x03\xe0\x41\x01\x12N\n\trestricts\x18\x04 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.IndexDatapoint.RestrictionB\x03\xe0\x41\x01\x12]\n\x11numeric_restricts\x18\x06 \x03(\x0b\x32=.google.cloud.aiplatform.v1.IndexDatapoint.NumericRestrictionB\x03\xe0\x41\x01\x12Q\n\x0c\x63rowding_tag\x18\x05 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.IndexDatapoint.CrowdingTagB\x03\xe0\x41\x01\x1a?\n\x0fSparseEmbedding\x12\x13\n\x06values\x18\x01 \x03(\x02\x42\x03\xe0\x41\x02\x12\x17\n\ndimensions\x18\x02 \x03(\x03\x42\x03\xe0\x41\x02\x1aG\n\x0bRestriction\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x12\n\nallow_list\x18\x02 \x03(\t\x12\x11\n\tdeny_list\x18\x03 \x03(\t\x1a\xc2\x02\n\x12NumericRestriction\x12\x13\n\tvalue_int\x18\x02 \x01(\x03H\x00\x12\x15\n\x0bvalue_float\x18\x03 \x01(\x02H\x00\x12\x16\n\x0cvalue_double\x18\x04 \x01(\x01H\x00\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12R\n\x02op\x18\x05 \x01(\x0e\x32\x46.google.cloud.aiplatform.v1.IndexDatapoint.NumericRestriction.Operator\"x\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x08\n\x04LESS\x10\x01\x12\x0e\n\nLESS_EQUAL\x10\x02\x12\t\n\x05\x45QUAL\x10\x03\x12\x11\n\rGREATER_EQUAL\x10\x04\x12\x0b\n\x07GREATER\x10\x05\x12\r\n\tNOT_EQUAL\x10\x06\x42\x07\n\x05Value\x1a)\n\x0b\x43rowdingTag\x12\x1a\n\x12\x63rowding_attribute\x18\x01 \x01(\t\"f\n\nIndexStats\x12\x1a\n\rvectors_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12!\n\x14sparse_vectors_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0cshards_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x42\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nIndexProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.DeployedIndexRef", "google/cloud/aiplatform/v1/deployed_index_ref.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Index").msgclass + Index::IndexUpdateMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Index.IndexUpdateMethod").enummodule + IndexDatapoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint").msgclass + IndexDatapoint::SparseEmbedding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint.SparseEmbedding").msgclass + IndexDatapoint::Restriction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint.Restriction").msgclass + IndexDatapoint::NumericRestriction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint.NumericRestriction").msgclass + IndexDatapoint::NumericRestriction::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint.NumericRestriction.Operator").enummodule + IndexDatapoint::CrowdingTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexDatapoint.CrowdingTag").msgclass + IndexStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.IndexStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_pb.rb new file mode 100644 index 000000000000..b01ae8bf9a1e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/index_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/index_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google/cloud/aiplatform/v1/index_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/index.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x86\x01\n\x12\x43reateIndexRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x35\n\x05index\x18\x02 \x01(\x0b\x32!.google.cloud.aiplatform.v1.IndexB\x03\xe0\x41\x02\"\xe6\x01\n\x1c\x43reateIndexOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12v\n*nearest_neighbor_search_operation_metadata\x18\x02 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata\"H\n\x0fGetIndexRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Index\"\xb5\x01\n\x12ListIndexesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x13ListIndexesResponse\x12\x32\n\x07indexes\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"|\n\x12UpdateIndexRequest\x12\x35\n\x05index\x18\x01 \x01(\x0b\x32!.google.cloud.aiplatform.v1.IndexB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xe6\x01\n\x1cUpdateIndexOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12v\n*nearest_neighbor_search_operation_metadata\x18\x02 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata\"K\n\x12\x44\x65leteIndexRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Index\"\xc7\x01\n\x17UpsertDatapointsRequest\x12\x36\n\x05index\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Index\x12>\n\ndatapoints\x18\x02 \x03(\x0b\x32*.google.cloud.aiplatform.v1.IndexDatapoint\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x1a\n\x18UpsertDatapointsResponse\"h\n\x17RemoveDatapointsRequest\x12\x36\n\x05index\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Index\x12\x15\n\rdatapoint_ids\x18\x02 \x03(\t\"\x1a\n\x18RemoveDatapointsResponse\"\x85\t\n&NearestNeighborSearchOperationMetadata\x12{\n\x18\x63ontent_validation_stats\x18\x01 \x03(\x0b\x32Y.google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.ContentValidationStats\x12\x18\n\x10\x64\x61ta_bytes_count\x18\x02 \x01(\x03\x1a\xa6\x05\n\x0bRecordError\x12r\n\nerror_type\x18\x01 \x01(\x0e\x32^.google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError.RecordErrorType\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12\x16\n\x0esource_gcs_uri\x18\x03 \x01(\t\x12\x14\n\x0c\x65mbedding_id\x18\x04 \x01(\t\x12\x12\n\nraw_record\x18\x05 \x01(\t\"\xc9\x03\n\x0fRecordErrorType\x12\x1a\n\x16\x45RROR_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nEMPTY_LINE\x10\x01\x12\x17\n\x13INVALID_JSON_SYNTAX\x10\x02\x12\x16\n\x12INVALID_CSV_SYNTAX\x10\x03\x12\x17\n\x13INVALID_AVRO_SYNTAX\x10\x04\x12\x18\n\x14INVALID_EMBEDDING_ID\x10\x05\x12\x1b\n\x17\x45MBEDDING_SIZE_MISMATCH\x10\x06\x12\x15\n\x11NAMESPACE_MISSING\x10\x07\x12\x11\n\rPARSING_ERROR\x10\x08\x12\x17\n\x13\x44UPLICATE_NAMESPACE\x10\t\x12\x13\n\x0fOP_IN_DATAPOINT\x10\n\x12\x13\n\x0fMULTIPLE_VALUES\x10\x0b\x12\x19\n\x15INVALID_NUMERIC_VALUE\x10\x0c\x12\x14\n\x10INVALID_ENCODING\x10\r\x12\x1d\n\x19INVALID_SPARSE_DIMENSIONS\x10\x0e\x12\x17\n\x13INVALID_TOKEN_VALUE\x10\x0f\x12\x1c\n\x18INVALID_SPARSE_EMBEDDING\x10\x10\x12\x15\n\x11INVALID_EMBEDDING\x10\x11\x1a\x9a\x02\n\x16\x43ontentValidationStats\x12\x16\n\x0esource_gcs_uri\x18\x01 \x01(\t\x12\x1a\n\x12valid_record_count\x18\x02 \x01(\x03\x12\x1c\n\x14invalid_record_count\x18\x03 \x01(\x03\x12\x66\n\x0epartial_errors\x18\x04 \x03(\x0b\x32N.google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError\x12!\n\x19valid_sparse_record_count\x18\x05 \x01(\x03\x12#\n\x1binvalid_sparse_record_count\x18\x06 \x01(\x03\x32\xb6\x0b\n\x0cIndexService\x12\xcf\x01\n\x0b\x43reateIndex\x12..google.cloud.aiplatform.v1.CreateIndexRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41%\n\x05Index\x12\x1c\x43reateIndexOperationMetadata\xda\x41\x0cparent,index\x82\xd3\xe4\x93\x02\x34\"+/v1/{parent=projects/*/locations/*}/indexes:\x05index\x12\x96\x01\n\x08GetIndex\x12+.google.cloud.aiplatform.v1.GetIndexRequest\x1a!.google.cloud.aiplatform.v1.Index\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/indexes/*}\x12\xac\x01\n\x0bListIndexes\x12..google.cloud.aiplatform.v1.ListIndexesRequest\x1a/.google.cloud.aiplatform.v1.ListIndexesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/indexes\x12\xda\x01\n\x0bUpdateIndex\x12..google.cloud.aiplatform.v1.UpdateIndexRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41%\n\x05Index\x12\x1cUpdateIndexOperationMetadata\xda\x41\x11index,update_mask\x82\xd3\xe4\x93\x02:21/v1/{index.name=projects/*/locations/*/indexes/*}:\x05index\x12\xcb\x01\n\x0b\x44\x65leteIndex\x12..google.cloud.aiplatform.v1.DeleteIndexRequest\x1a\x1d.google.longrunning.Operation\"m\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/indexes/*}\x12\xc7\x01\n\x10UpsertDatapoints\x12\x33.google.cloud.aiplatform.v1.UpsertDatapointsRequest\x1a\x34.google.cloud.aiplatform.v1.UpsertDatapointsResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints:\x01*\x12\xc7\x01\n\x10RemoveDatapoints\x12\x33.google.cloud.aiplatform.v1.RemoveDatapointsRequest\x1a\x34.google.cloud.aiplatform.v1.RemoveDatapointsResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{index=projects/*/locations/*/indexes/*}:removeDatapoints:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11IndexServiceProtoP\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.Index", "google/cloud/aiplatform/v1/index.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 + CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateIndexRequest").msgclass + CreateIndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateIndexOperationMetadata").msgclass + GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetIndexRequest").msgclass + ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListIndexesRequest").msgclass + ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListIndexesResponse").msgclass + UpdateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateIndexRequest").msgclass + UpdateIndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateIndexOperationMetadata").msgclass + DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteIndexRequest").msgclass + UpsertDatapointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpsertDatapointsRequest").msgclass + UpsertDatapointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpsertDatapointsResponse").msgclass + RemoveDatapointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RemoveDatapointsRequest").msgclass + RemoveDatapointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RemoveDatapointsResponse").msgclass + NearestNeighborSearchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata").msgclass + NearestNeighborSearchOperationMetadata::RecordError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError").msgclass + NearestNeighborSearchOperationMetadata::RecordError::RecordErrorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError.RecordErrorType").enummodule + NearestNeighborSearchOperationMetadata::ContentValidationStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.ContentValidationStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_services_pb.rb new file mode 100644 index 000000000000..293e4cb55a8d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/index_service_services_pb.rb @@ -0,0 +1,60 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/index_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/index_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module IndexService + # A service for creating and managing Vertex AI's Index resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.IndexService' + + # Creates an Index. + rpc :CreateIndex, ::Google::Cloud::AIPlatform::V1::CreateIndexRequest, ::Google::Longrunning::Operation + # Gets an Index. + rpc :GetIndex, ::Google::Cloud::AIPlatform::V1::GetIndexRequest, ::Google::Cloud::AIPlatform::V1::Index + # Lists Indexes in a Location. + rpc :ListIndexes, ::Google::Cloud::AIPlatform::V1::ListIndexesRequest, ::Google::Cloud::AIPlatform::V1::ListIndexesResponse + # Updates an Index. + rpc :UpdateIndex, ::Google::Cloud::AIPlatform::V1::UpdateIndexRequest, ::Google::Longrunning::Operation + # Deletes an Index. + # An Index can only be deleted when all its + # [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had + # been undeployed. + rpc :DeleteIndex, ::Google::Cloud::AIPlatform::V1::DeleteIndexRequest, ::Google::Longrunning::Operation + # Add/update Datapoints into an Index. + rpc :UpsertDatapoints, ::Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest, ::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse + # Remove Datapoints from an Index. + rpc :RemoveDatapoints, ::Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest, ::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/io_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/io_pb.rb new file mode 100644 index 000000000000..1f140c968a3a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/io_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/io.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/api_auth_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n#google/cloud/aiplatform/v1/io.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a)google/cloud/aiplatform/v1/api_auth.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"L\n\nAvroSource\x12>\n\ngcs_source\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceB\x03\xe0\x41\x02\"K\n\tCsvSource\x12>\n\ngcs_source\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceB\x03\xe0\x41\x02\"\x1e\n\tGcsSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\"(\n\x0e\x42igQuerySource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\".\n\x13\x42igQueryDestination\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"Z\n\x0e\x43svDestination\x12H\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationB\x03\xe0\x41\x02\"_\n\x13TFRecordDestination\x12H\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationB\x03\xe0\x41\x02\"7\n\x1c\x43ontainerRegistryDestination\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xd5\x02\n\x11GoogleDriveSource\x12S\n\x0cresource_ids\x18\x01 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceIdB\x03\xe0\x41\x02\x1a\xea\x01\n\nResourceId\x12\x61\n\rresource_type\x18\x01 \x01(\x0e\x32\x45.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceTypeB\x03\xe0\x41\x02\x12\x18\n\x0bresource_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"_\n\x0cResourceType\x12\x1d\n\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_TYPE_FILE\x10\x01\x12\x18\n\x14RESOURCE_TYPE_FOLDER\x10\x02\"\x14\n\x12\x44irectUploadSource\"\xa9\x03\n\x0bSlackSource\x12L\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x35.google.cloud.aiplatform.v1.SlackSource.SlackChannelsB\x03\xe0\x41\x02\x1a\xcb\x02\n\rSlackChannels\x12Y\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannelB\x03\xe0\x41\x02\x12M\n\x0e\x61pi_key_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfigB\x03\xe0\x41\x02\x1a\x8f\x01\n\x0cSlackChannel\x12\x17\n\nchannel_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x91\x02\n\nJiraSource\x12M\n\x0cjira_queries\x18\x01 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.JiraSource.JiraQueriesB\x03\xe0\x41\x02\x1a\xb3\x01\n\x0bJiraQueries\x12\x10\n\x08projects\x18\x03 \x03(\t\x12\x16\n\x0e\x63ustom_queries\x18\x04 \x03(\t\x12\x12\n\x05\x65mail\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nserver_uri\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12M\n\x0e\x61pi_key_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfigB\x03\xe0\x41\x02\"\xb5\x03\n\x11SharePointSources\x12[\n\x13share_point_sources\x18\x01 \x03(\x0b\x32>.google.cloud.aiplatform.v1.SharePointSources.SharePointSource\x1a\xc2\x02\n\x10SharePointSource\x12 \n\x16sharepoint_folder_path\x18\x05 \x01(\tH\x00\x12\x1e\n\x14sharepoint_folder_id\x18\x06 \x01(\tH\x00\x12\x14\n\ndrive_name\x18\x07 \x01(\tH\x01\x12\x12\n\x08\x64rive_id\x18\x08 \x01(\tH\x01\x12\x11\n\tclient_id\x18\x01 \x01(\t\x12G\n\rclient_secret\x18\x02 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig\x12\x11\n\ttenant_id\x18\x03 \x01(\t\x12\x1c\n\x14sharepoint_site_name\x18\x04 \x01(\t\x12\x14\n\x07\x66ile_id\x18\t \x01(\tB\x03\xe0\x41\x03\x42\x0f\n\rfolder_sourceB\x0e\n\x0c\x64rive_sourceB\xc5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x07IoProtoP\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.ApiAuth.ApiKeyConfig", "google/cloud/aiplatform/v1/api_auth.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + AvroSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AvroSource").msgclass + CsvSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CsvSource").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GcsSource").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GcsDestination").msgclass + BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BigQuerySource").msgclass + BigQueryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BigQueryDestination").msgclass + CsvDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CsvDestination").msgclass + TFRecordDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TFRecordDestination").msgclass + ContainerRegistryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ContainerRegistryDestination").msgclass + GoogleDriveSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GoogleDriveSource").msgclass + GoogleDriveSource::ResourceId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId").msgclass + GoogleDriveSource::ResourceId::ResourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType").enummodule + DirectUploadSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DirectUploadSource").msgclass + SlackSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SlackSource").msgclass + SlackSource::SlackChannels = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SlackSource.SlackChannels").msgclass + SlackSource::SlackChannels::SlackChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel").msgclass + JiraSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.JiraSource").msgclass + JiraSource::JiraQueries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.JiraSource.JiraQueries").msgclass + SharePointSources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SharePointSources").msgclass + SharePointSources::SharePointSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SharePointSources.SharePointSource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_pb.rb new file mode 100644 index 000000000000..05b3692ad51a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_pb.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/job_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/batch_prediction_job_pb' +require 'google/cloud/aiplatform/v1/custom_job_pb' +require 'google/cloud/aiplatform/v1/data_labeling_job_pb' +require 'google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb' +require 'google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb' +require 'google/cloud/aiplatform/v1/nas_job_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/aiplatform/v1/job_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\x35google/cloud/aiplatform/v1/batch_prediction_job.proto\x1a+google/cloud/aiplatform/v1/custom_job.proto\x1a\x32google/cloud/aiplatform/v1/data_labeling_job.proto\x1a:google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto\x1a@google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto\x1a(google/cloud/aiplatform/v1/nas_job.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x93\x01\n\x16\x43reateCustomJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12>\n\ncustom_job\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.CustomJobB\x03\xe0\x41\x02\"P\n\x13GetCustomJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\"\xb8\x01\n\x15ListCustomJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"m\n\x16ListCustomJobsResponse\x12:\n\x0b\x63ustom_jobs\x18\x01 \x03(\x0b\x32%.google.cloud.aiplatform.v1.CustomJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x16\x44\x65leteCustomJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\"S\n\x16\x43\x61ncelCustomJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\"\xa6\x01\n\x1c\x43reateDataLabelingJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12K\n\x11\x64\x61ta_labeling_job\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.DataLabelingJobB\x03\xe0\x41\x02\"\\\n\x19GetDataLabelingJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/DataLabelingJob\"\xd0\x01\n\x1bListDataLabelingJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"\x80\x01\n\x1cListDataLabelingJobsResponse\x12G\n\x12\x64\x61ta_labeling_jobs\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.DataLabelingJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1c\x44\x65leteDataLabelingJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/DataLabelingJob\"_\n\x1c\x43\x61ncelDataLabelingJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/DataLabelingJob\"\xbe\x01\n$CreateHyperparameterTuningJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12[\n\x19hyperparameter_tuning_job\x18\x02 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.HyperparameterTuningJobB\x03\xe0\x41\x02\"l\n!GetHyperparameterTuningJobRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/HyperparameterTuningJob\"\xc6\x01\n#ListHyperparameterTuningJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x98\x01\n$ListHyperparameterTuningJobsResponse\x12W\n\x1ahyperparameter_tuning_jobs\x18\x01 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.HyperparameterTuningJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n$DeleteHyperparameterTuningJobRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/HyperparameterTuningJob\"o\n$CancelHyperparameterTuningJobRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/HyperparameterTuningJob\"\x8a\x01\n\x13\x43reateNasJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x38\n\x07nas_job\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.NasJobB\x03\xe0\x41\x02\"J\n\x10GetNasJobRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n aiplatform.googleapis.com/NasJob\"\xb5\x01\n\x12ListNasJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x13ListNasJobsResponse\x12\x34\n\x08nas_jobs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.NasJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"M\n\x13\x44\x65leteNasJobRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n aiplatform.googleapis.com/NasJob\"M\n\x13\x43\x61ncelNasJobRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n aiplatform.googleapis.com/NasJob\"Z\n\x18GetNasTrialDetailRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/NasTrialDetail\"}\n\x1aListNasTrialDetailsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n aiplatform.googleapis.com/NasJob\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"}\n\x1bListNasTrialDetailsResponse\x12\x45\n\x11nas_trial_details\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.NasTrialDetail\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xaf\x01\n\x1f\x43reateBatchPredictionJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12Q\n\x14\x62\x61tch_prediction_job\x18\x02 \x01(\x0b\x32..google.cloud.aiplatform.v1.BatchPredictionJobB\x03\xe0\x41\x02\"b\n\x1cGetBatchPredictionJobRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/BatchPredictionJob\"\xc1\x01\n\x1eListBatchPredictionJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x89\x01\n\x1fListBatchPredictionJobsResponse\x12M\n\x15\x62\x61tch_prediction_jobs\x18\x01 \x03(\x0b\x32..google.cloud.aiplatform.v1.BatchPredictionJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"e\n\x1f\x44\x65leteBatchPredictionJobRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/BatchPredictionJob\"e\n\x1f\x43\x61ncelBatchPredictionJobRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,aiplatform.googleapis.com/BatchPredictionJob\"\xce\x01\n)CreateModelDeploymentMonitoringJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x66\n\x1fmodel_deployment_monitoring_job\x18\x02 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJobB\x03\xe0\x41\x02\"\xef\x04\n4SearchModelDeploymentMonitoringStatsAnomaliesRequest\x12g\n\x1fmodel_deployment_monitoring_job\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\x12\x1e\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x14\x66\x65\x61ture_display_name\x18\x03 \x01(\t\x12\x81\x01\n\nobjectives\x18\x04 \x03(\x0b\x32h.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.StatsAnomaliesObjectiveB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12.\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x86\x01\n\x17StatsAnomaliesObjective\x12P\n\x04type\x18\x01 \x01(\x0e\x32\x42.google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType\x12\x19\n\x11top_feature_count\x18\x04 \x01(\x05\"\xa5\x01\n5SearchModelDeploymentMonitoringStatsAnomaliesResponse\x12S\n\x10monitoring_stats\x18\x01 \x03(\x0b\x32\x39.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"v\n&GetModelDeploymentMonitoringJobRequest\x12L\n\x04name\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\"\xcb\x01\n(ListModelDeploymentMonitoringJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa8\x01\n)ListModelDeploymentMonitoringJobsResponse\x12\x62\n model_deployment_monitoring_jobs\x18\x01 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc9\x01\n)UpdateModelDeploymentMonitoringJobRequest\x12\x66\n\x1fmodel_deployment_monitoring_job\x18\x01 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJobB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"y\n)DeleteModelDeploymentMonitoringJobRequest\x12L\n\x04name\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\"x\n(PauseModelDeploymentMonitoringJobRequest\x12L\n\x04name\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\"y\n)ResumeModelDeploymentMonitoringJobRequest\x12L\n\x04name\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\"\x85\x01\n3UpdateModelDeploymentMonitoringJobOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\xf0?\n\nJobService\x12\xc4\x01\n\x0f\x43reateCustomJob\x12\x32.google.cloud.aiplatform.v1.CreateCustomJobRequest\x1a%.google.cloud.aiplatform.v1.CustomJob\"V\xda\x41\x11parent,custom_job\x82\xd3\xe4\x93\x02<\"./v1/{parent=projects/*/locations/*}/customJobs:\ncustom_job\x12\xa5\x01\n\x0cGetCustomJob\x12/.google.cloud.aiplatform.v1.GetCustomJobRequest\x1a%.google.cloud.aiplatform.v1.CustomJob\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/customJobs/*}\x12\xb8\x01\n\x0eListCustomJobs\x12\x31.google.cloud.aiplatform.v1.ListCustomJobsRequest\x1a\x32.google.cloud.aiplatform.v1.ListCustomJobsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/customJobs\x12\xd6\x01\n\x0f\x44\x65leteCustomJob\x12\x32.google.cloud.aiplatform.v1.DeleteCustomJobRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/customJobs/*}\x12\xa6\x01\n\x0f\x43\x61ncelCustomJob\x12\x32.google.cloud.aiplatform.v1.CancelCustomJobRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/customJobs/*}:cancel:\x01*\x12\xea\x01\n\x15\x43reateDataLabelingJob\x12\x38.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest\x1a+.google.cloud.aiplatform.v1.DataLabelingJob\"j\xda\x41\x18parent,data_labeling_job\x82\xd3\xe4\x93\x02I\"4/v1/{parent=projects/*/locations/*}/dataLabelingJobs:\x11\x64\x61ta_labeling_job\x12\xbd\x01\n\x12GetDataLabelingJob\x12\x35.google.cloud.aiplatform.v1.GetDataLabelingJobRequest\x1a+.google.cloud.aiplatform.v1.DataLabelingJob\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/dataLabelingJobs/*}\x12\xd0\x01\n\x14ListDataLabelingJobs\x12\x37.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest\x1a\x38.google.cloud.aiplatform.v1.ListDataLabelingJobsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/dataLabelingJobs\x12\xe8\x01\n\x15\x44\x65leteDataLabelingJob\x12\x38.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/dataLabelingJobs/*}\x12\xb8\x01\n\x15\x43\x61ncelDataLabelingJob\x12\x38.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v1/{name=projects/*/locations/*/dataLabelingJobs/*}:cancel:\x01*\x12\x9b\x02\n\x1d\x43reateHyperparameterTuningJob\x12@.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest\x1a\x33.google.cloud.aiplatform.v1.HyperparameterTuningJob\"\x82\x01\xda\x41 parent,hyperparameter_tuning_job\x82\xd3\xe4\x93\x02Y\"\x12\x12*/v1/{name=projects/*/locations/*/batchPredictionJobs/*}:cancel:\x01*\x12\xbb\x02\n\"CreateModelDeploymentMonitoringJob\x12\x45.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest\x1a\x38.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob\"\x93\x01\xda\x41&parent,model_deployment_monitoring_job\x82\xd3\xe4\x93\x02\x64\"A/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs:\x1fmodel_deployment_monitoring_job\x12\xa2\x03\n-SearchModelDeploymentMonitoringStatsAnomalies\x12P.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest\x1aQ.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesResponse\"\xcb\x01\xda\x41\x31model_deployment_monitoring_job,deployed_model_id\x82\xd3\xe4\x93\x02\x90\x01\"\x8a\x01/v1/{model_deployment_monitoring_job=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:searchModelDeploymentMonitoringStatsAnomalies:\x01*\x12\xf1\x01\n\x1fGetModelDeploymentMonitoringJob\x12\x42.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest\x1a\x38.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}\x12\x84\x02\n!ListModelDeploymentMonitoringJobs\x12\x44.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest\x1a\x45.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs\x12\x9c\x03\n\"UpdateModelDeploymentMonitoringJob\x12\x45.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest\x1a\x1d.google.longrunning.Operation\"\x8f\x02\xca\x41S\n\x1cModelDeploymentMonitoringJob\x12\x33UpdateModelDeploymentMonitoringJobOperationMetadata\xda\x41+model_deployment_monitoring_job,update_mask\x82\xd3\xe4\x93\x02\x84\x01\x32\x61/v1/{model_deployment_monitoring_job.name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:\x1fmodel_deployment_monitoring_job\x12\x90\x02\n\"DeleteModelDeploymentMonitoringJob\x12\x45.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43*A/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}\x12\xdc\x01\n!PauseModelDeploymentMonitoringJob\x12\x44.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest\x1a\x16.google.protobuf.Empty\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\"G/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:pause:\x01*\x12\xdf\x01\n\"ResumeModelDeploymentMonitoringJob\x12\x45.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest\x1a\x16.google.protobuf.Empty\"Z\xda\x41\x04name\x82\xd3\xe4\x93\x02M\"H/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:resume:\x01*\x1a\x86\x01\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xcd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0fJobServiceProtoP\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.CustomJob", "google/cloud/aiplatform/v1/custom_job.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.DataLabelingJob", "google/cloud/aiplatform/v1/data_labeling_job.proto"], + ["google.cloud.aiplatform.v1.HyperparameterTuningJob", "google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto"], + ["google.cloud.aiplatform.v1.NasJob", "google/cloud/aiplatform/v1/nas_job.proto"], + ["google.cloud.aiplatform.v1.BatchPredictionJob", "google/cloud/aiplatform/v1/batch_prediction_job.proto"], + ["google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob", "google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + CreateCustomJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateCustomJobRequest").msgclass + GetCustomJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetCustomJobRequest").msgclass + ListCustomJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListCustomJobsRequest").msgclass + ListCustomJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListCustomJobsResponse").msgclass + DeleteCustomJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteCustomJobRequest").msgclass + CancelCustomJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelCustomJobRequest").msgclass + CreateDataLabelingJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateDataLabelingJobRequest").msgclass + GetDataLabelingJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetDataLabelingJobRequest").msgclass + ListDataLabelingJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDataLabelingJobsRequest").msgclass + ListDataLabelingJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListDataLabelingJobsResponse").msgclass + DeleteDataLabelingJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest").msgclass + CancelDataLabelingJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelDataLabelingJobRequest").msgclass + CreateHyperparameterTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest").msgclass + GetHyperparameterTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest").msgclass + ListHyperparameterTuningJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest").msgclass + ListHyperparameterTuningJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse").msgclass + DeleteHyperparameterTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest").msgclass + CancelHyperparameterTuningJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest").msgclass + CreateNasJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateNasJobRequest").msgclass + GetNasJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetNasJobRequest").msgclass + ListNasJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNasJobsRequest").msgclass + ListNasJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNasJobsResponse").msgclass + DeleteNasJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteNasJobRequest").msgclass + CancelNasJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelNasJobRequest").msgclass + GetNasTrialDetailRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetNasTrialDetailRequest").msgclass + ListNasTrialDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNasTrialDetailsRequest").msgclass + ListNasTrialDetailsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNasTrialDetailsResponse").msgclass + CreateBatchPredictionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest").msgclass + GetBatchPredictionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetBatchPredictionJobRequest").msgclass + ListBatchPredictionJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest").msgclass + ListBatchPredictionJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse").msgclass + DeleteBatchPredictionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest").msgclass + CancelBatchPredictionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest").msgclass + CreateModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest").msgclass + SearchModelDeploymentMonitoringStatsAnomaliesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest").msgclass + SearchModelDeploymentMonitoringStatsAnomaliesRequest::StatsAnomaliesObjective = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.StatsAnomaliesObjective").msgclass + SearchModelDeploymentMonitoringStatsAnomaliesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesResponse").msgclass + GetModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest").msgclass + ListModelDeploymentMonitoringJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest").msgclass + ListModelDeploymentMonitoringJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsResponse").msgclass + UpdateModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest").msgclass + DeleteModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest").msgclass + PauseModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest").msgclass + ResumeModelDeploymentMonitoringJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest").msgclass + UpdateModelDeploymentMonitoringJobOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_services_pb.rb new file mode 100644 index 000000000000..3bbbc4b9909b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_service_services_pb.rb @@ -0,0 +1,170 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/job_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/job_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module JobService + # A service for creating and managing Vertex AI's jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.JobService' + + # Creates a CustomJob. A created CustomJob right away + # will be attempted to be run. + rpc :CreateCustomJob, ::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest, ::Google::Cloud::AIPlatform::V1::CustomJob + # Gets a CustomJob. + rpc :GetCustomJob, ::Google::Cloud::AIPlatform::V1::GetCustomJobRequest, ::Google::Cloud::AIPlatform::V1::CustomJob + # Lists CustomJobs in a Location. + rpc :ListCustomJobs, ::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest, ::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse + # Deletes a CustomJob. + rpc :DeleteCustomJob, ::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest, ::Google::Longrunning::Operation + # Cancels a CustomJob. + # Starts asynchronous cancellation on the CustomJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob] + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the CustomJob is not deleted; instead it becomes a job with + # a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with + # a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + # `Code.CANCELLED`, and + # [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to + # `CANCELLED`. + rpc :CancelCustomJob, ::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest, ::Google::Protobuf::Empty + # Creates a DataLabelingJob. + rpc :CreateDataLabelingJob, ::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest, ::Google::Cloud::AIPlatform::V1::DataLabelingJob + # Gets a DataLabelingJob. + rpc :GetDataLabelingJob, ::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest, ::Google::Cloud::AIPlatform::V1::DataLabelingJob + # Lists DataLabelingJobs in a Location. + rpc :ListDataLabelingJobs, ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest, ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsResponse + # Deletes a DataLabelingJob. + rpc :DeleteDataLabelingJob, ::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest, ::Google::Longrunning::Operation + # Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + rpc :CancelDataLabelingJob, ::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest, ::Google::Protobuf::Empty + # Creates a HyperparameterTuningJob + rpc :CreateHyperparameterTuningJob, ::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest, ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob + # Gets a HyperparameterTuningJob + rpc :GetHyperparameterTuningJob, ::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest, ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob + # Lists HyperparameterTuningJobs in a Location. + rpc :ListHyperparameterTuningJobs, ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest, ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse + # Deletes a HyperparameterTuningJob. + rpc :DeleteHyperparameterTuningJob, ::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest, ::Google::Longrunning::Operation + # Cancels a HyperparameterTuningJob. + # Starts asynchronous cancellation on the HyperparameterTuningJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob] + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the HyperparameterTuningJob is not deleted; instead it becomes a job with + # a + # [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error] + # value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`, and + # [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] + # is set to `CANCELLED`. + rpc :CancelHyperparameterTuningJob, ::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest, ::Google::Protobuf::Empty + # Creates a NasJob + rpc :CreateNasJob, ::Google::Cloud::AIPlatform::V1::CreateNasJobRequest, ::Google::Cloud::AIPlatform::V1::NasJob + # Gets a NasJob + rpc :GetNasJob, ::Google::Cloud::AIPlatform::V1::GetNasJobRequest, ::Google::Cloud::AIPlatform::V1::NasJob + # Lists NasJobs in a Location. + rpc :ListNasJobs, ::Google::Cloud::AIPlatform::V1::ListNasJobsRequest, ::Google::Cloud::AIPlatform::V1::ListNasJobsResponse + # Deletes a NasJob. + rpc :DeleteNasJob, ::Google::Cloud::AIPlatform::V1::DeleteNasJobRequest, ::Google::Longrunning::Operation + # Cancels a NasJob. + # Starts asynchronous cancellation on the NasJob. The server + # makes a best effort to cancel the job, but success is not + # guaranteed. Clients can use + # [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or + # other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On successful cancellation, + # the NasJob is not deleted; instead it becomes a job with + # a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a + # [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + # `Code.CANCELLED`, and + # [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to + # `CANCELLED`. + rpc :CancelNasJob, ::Google::Cloud::AIPlatform::V1::CancelNasJobRequest, ::Google::Protobuf::Empty + # Gets a NasTrialDetail. + rpc :GetNasTrialDetail, ::Google::Cloud::AIPlatform::V1::GetNasTrialDetailRequest, ::Google::Cloud::AIPlatform::V1::NasTrialDetail + # List top NasTrialDetails of a NasJob. + rpc :ListNasTrialDetails, ::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest, ::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse + # Creates a BatchPredictionJob. A BatchPredictionJob once created will + # right away be attempted to start. + rpc :CreateBatchPredictionJob, ::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest, ::Google::Cloud::AIPlatform::V1::BatchPredictionJob + # Gets a BatchPredictionJob + rpc :GetBatchPredictionJob, ::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest, ::Google::Cloud::AIPlatform::V1::BatchPredictionJob + # Lists BatchPredictionJobs in a Location. + rpc :ListBatchPredictionJobs, ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest, ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse + # Deletes a BatchPredictionJob. Can only be called on jobs that already + # finished. + rpc :DeleteBatchPredictionJob, ::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest, ::Google::Longrunning::Operation + # Cancels a BatchPredictionJob. + # + # Starts asynchronous cancellation on the BatchPredictionJob. The server + # makes the best effort to cancel the job, but success is not + # guaranteed. Clients can use + # [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] + # or other methods to check whether the cancellation succeeded or whether the + # job completed despite cancellation. On a successful cancellation, + # the BatchPredictionJob is not deleted;instead its + # [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] + # is set to `CANCELLED`. Any files already outputted by the job are not + # deleted. + rpc :CancelBatchPredictionJob, ::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest, ::Google::Protobuf::Empty + # Creates a ModelDeploymentMonitoringJob. It will run periodically on a + # configured interval. + rpc :CreateModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest, ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob + # Searches Model Monitoring Statistics generated within a given time window. + rpc :SearchModelDeploymentMonitoringStatsAnomalies, ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest, ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesResponse + # Gets a ModelDeploymentMonitoringJob. + rpc :GetModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest, ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob + # Lists ModelDeploymentMonitoringJobs in a Location. + rpc :ListModelDeploymentMonitoringJobs, ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest, ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsResponse + # Updates a ModelDeploymentMonitoringJob. + rpc :UpdateModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest, ::Google::Longrunning::Operation + # Deletes a ModelDeploymentMonitoringJob. + rpc :DeleteModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest, ::Google::Longrunning::Operation + # Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + # makes a best effort to cancel the job. Will mark + # [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state] + # to 'PAUSED'. + rpc :PauseModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest, ::Google::Protobuf::Empty + # Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + # next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + # resumed. + rpc :ResumeModelDeploymentMonitoringJob, ::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_state_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_state_pb.rb new file mode 100644 index 000000000000..b5b2ba76673a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/job_state_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/job_state.proto + +require 'google/protobuf' + + +descriptor_data = "\n*google/cloud/aiplatform/v1/job_state.proto\x12\x1agoogle.cloud.aiplatform.v1*\xb3\x02\n\x08JobState\x12\x19\n\x15JOB_STATE_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_STATE_QUEUED\x10\x01\x12\x15\n\x11JOB_STATE_PENDING\x10\x02\x12\x15\n\x11JOB_STATE_RUNNING\x10\x03\x12\x17\n\x13JOB_STATE_SUCCEEDED\x10\x04\x12\x14\n\x10JOB_STATE_FAILED\x10\x05\x12\x18\n\x14JOB_STATE_CANCELLING\x10\x06\x12\x17\n\x13JOB_STATE_CANCELLED\x10\x07\x12\x14\n\x10JOB_STATE_PAUSED\x10\x08\x12\x15\n\x11JOB_STATE_EXPIRED\x10\t\x12\x16\n\x12JOB_STATE_UPDATING\x10\n\x12!\n\x1dJOB_STATE_PARTIALLY_SUCCEEDED\x10\x0b\x42\xcb\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\rJobStateProtoP\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 = [ + ] + 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 + JobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.JobState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb new file mode 100644 index 000000000000..75e5eb76a7dc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/lineage_subgraph.proto + +require 'google/protobuf' + +require 'google/cloud/aiplatform/v1/artifact_pb' +require 'google/cloud/aiplatform/v1/event_pb' +require 'google/cloud/aiplatform/v1/execution_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/lineage_subgraph.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a)google/cloud/aiplatform/v1/artifact.proto\x1a&google/cloud/aiplatform/v1/event.proto\x1a*google/cloud/aiplatform/v1/execution.proto\"\xb8\x01\n\x0fLineageSubgraph\x12\x37\n\tartifacts\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.Artifact\x12\x39\n\nexecutions\x18\x02 \x03(\x0b\x32%.google.cloud.aiplatform.v1.Execution\x12\x31\n\x06\x65vents\x18\x03 \x03(\x0b\x32!.google.cloud.aiplatform.v1.EventB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14LineageSubgraphProtoP\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.Artifact", "google/cloud/aiplatform/v1/artifact.proto"], + ["google.cloud.aiplatform.v1.Execution", "google/cloud/aiplatform/v1/execution.proto"], + ["google.cloud.aiplatform.v1.Event", "google/cloud/aiplatform/v1/event.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 + LineageSubgraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LineageSubgraph").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb new file mode 100644 index 000000000000..77f6a74051a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/llm_utility_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/content_pb' +require 'google/cloud/aiplatform/v1/prediction_service_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n4google/cloud/aiplatform/v1/llm_utility_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/content.proto\x1a\x33google/cloud/aiplatform/v1/prediction_service.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xd4\x01\n\x14\x43omputeTokensRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12:\n\x08\x63ontents\x18\x04 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\"B\n\nTokensInfo\x12\x0e\n\x06tokens\x18\x01 \x03(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x03\x12\x11\n\x04role\x18\x03 \x01(\tB\x03\xe0\x41\x01\"T\n\x15\x43omputeTokensResponse\x12;\n\x0btokens_info\x18\x01 \x03(\x0b\x32&.google.cloud.aiplatform.v1.TokensInfo2\xf8\x06\n\x11LlmUtilityService\x12\x81\x03\n\x0b\x43ountTokens\x12..google.cloud.aiplatform.v1.CountTokensRequest\x1a/.google.cloud.aiplatform.v1.CountTokensResponse\"\x90\x02\xda\x41\x12\x65ndpoint,instances\x82\xd3\xe4\x93\x02\xf4\x01\"=/v1/{endpoint=projects/*/locations/*/endpoints/*}:countTokens:\x01*ZL\"G/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens:\x01*Z+\"&/v1/{endpoint=endpoints/*}:countTokens:\x01*Z5\"0/v1/{endpoint=publishers/*/models/*}:countTokens:\x01*\x12\x8f\x03\n\rComputeTokens\x12\x30.google.cloud.aiplatform.v1.ComputeTokensRequest\x1a\x31.google.cloud.aiplatform.v1.ComputeTokensResponse\"\x98\x02\xda\x41\x12\x65ndpoint,instances\x82\xd3\xe4\x93\x02\xfc\x01\"?/v1/{endpoint=projects/*/locations/*/endpoints/*}:computeTokens:\x01*ZN\"I/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:computeTokens:\x01*Z-\"(/v1/{endpoint=endpoints/*}:computeTokens:\x01*Z7\"2/v1/{endpoint=publishers/*/models/*}:computeTokens:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16LlmUtilityServiceProtoP\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.Value", "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 + ComputeTokensRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ComputeTokensRequest").msgclass + TokensInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TokensInfo").msgclass + ComputeTokensResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ComputeTokensResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_services_pb.rb new file mode 100644 index 000000000000..9d261d034e18 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/llm_utility_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/llm_utility_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/llm_utility_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module LlmUtilityService + # Service for LLM related utility functions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.LlmUtilityService' + + # Perform a token counting. + rpc :CountTokens, ::Google::Cloud::AIPlatform::V1::CountTokensRequest, ::Google::Cloud::AIPlatform::V1::CountTokensResponse + # Return a list of tokens based on the input text. + rpc :ComputeTokens, ::Google::Cloud::AIPlatform::V1::ComputeTokensRequest, ::Google::Cloud::AIPlatform::V1::ComputeTokensResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb new file mode 100644 index 000000000000..29ff11970f22 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/machine_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/accelerator_type_pb' +require 'google/cloud/aiplatform/v1/reservation_affinity_pb' + + +descriptor_data = "\n2google/cloud/aiplatform/v1/machine_resources.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x31google/cloud/aiplatform/v1/accelerator_type.proto\x1a\x35google/cloud/aiplatform/v1/reservation_affinity.proto\"\x81\x02\n\x0bMachineSpec\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12J\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\x0e\x32+.google.cloud.aiplatform.v1.AcceleratorTypeB\x03\xe0\x41\x05\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x03 \x01(\x05\x12\x19\n\x0ctpu_topology\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12U\n\x14reservation_affinity\x18\x05 \x01(\x0b\x32/.google.cloud.aiplatform.v1.ReservationAffinityB\x06\xe0\x41\x05\xe0\x41\x01\"\xb0\x02\n\x12\x44\x65\x64icatedResources\x12\x45\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12!\n\x11min_replica_count\x18\x02 \x01(\x05\x42\x06\xe0\x41\x02\xe0\x41\x05\x12\x1e\n\x11max_replica_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x05\x12#\n\x16required_replica_count\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12X\n\x18\x61utoscaling_metric_specs\x18\x04 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.AutoscalingMetricSpecB\x03\xe0\x41\x05\x12\x11\n\x04spot\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"T\n\x12\x41utomaticResources\x12\x1e\n\x11min_replica_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x05\x12\x1e\n\x11max_replica_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x05\"\xa5\x01\n\x17\x42\x61tchDedicatedResources\x12\x45\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12#\n\x16starting_replica_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x05\x12\x1e\n\x11max_replica_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x05\"/\n\x11ResourcesConsumed\x12\x1a\n\rreplica_hours\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\"=\n\x08\x44iskSpec\x12\x16\n\x0e\x62oot_disk_type\x18\x01 \x01(\t\x12\x19\n\x11\x62oot_disk_size_gb\x18\x02 \x01(\x05\"=\n\x12PersistentDiskSpec\x12\x11\n\tdisk_type\x18\x01 \x01(\t\x12\x14\n\x0c\x64isk_size_gb\x18\x02 \x01(\x03\"L\n\x08NfsMount\x12\x13\n\x06server\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04path\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bmount_point\x18\x03 \x01(\tB\x03\xe0\x41\x02\"A\n\x15\x41utoscalingMetricSpec\x12\x18\n\x0bmetric_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06target\x18\x02 \x01(\x05\".\n\x10ShieldedVmConfig\x12\x1a\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\xd3\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x15MachineResourcesProtoP\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.ReservationAffinity", "google/cloud/aiplatform/v1/reservation_affinity.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 + MachineSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MachineSpec").msgclass + DedicatedResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DedicatedResources").msgclass + AutomaticResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AutomaticResources").msgclass + BatchDedicatedResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchDedicatedResources").msgclass + ResourcesConsumed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResourcesConsumed").msgclass + DiskSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DiskSpec").msgclass + PersistentDiskSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PersistentDiskSpec").msgclass + NfsMount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NfsMount").msgclass + AutoscalingMetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AutoscalingMetricSpec").msgclass + ShieldedVmConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ShieldedVmConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb new file mode 100644 index 000000000000..ebe616066a9b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n?google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\"6\n\x1bManualBatchTuningParameters\x12\x17\n\nbatch_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x05\x42\xde\x01\n\x1e\x63om.google.cloud.aiplatform.v1B ManualBatchTuningParametersProtoP\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 = [ + ] + 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 + ManualBatchTuningParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ManualBatchTuningParameters").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_pb.rb new file mode 100644 index 000000000000..21bf08f1e9e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/match_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/index_pb' + + +descriptor_data = "\n.google/cloud/aiplatform/v1/match_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/index.proto\"\xc1\x04\n\x14\x46indNeighborsRequest\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x19\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\t\x12G\n\x07queries\x18\x03 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.FindNeighborsRequest.Query\x12\x1d\n\x15return_full_datapoint\x18\x04 \x01(\x08\x1a\xdc\x02\n\x05Query\x12N\n\x03rrf\x18\x06 \x01(\x0b\x32:.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRFB\x03\xe0\x41\x01H\x00\x12\x42\n\tdatapoint\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.IndexDatapointB\x03\xe0\x41\x02\x12\x16\n\x0eneighbor_count\x18\x02 \x01(\x05\x12-\n%per_crowding_attribute_neighbor_count\x18\x03 \x01(\x05\x12\"\n\x1a\x61pproximate_neighbor_count\x18\x04 \x01(\x05\x12.\n&fraction_leaf_nodes_to_search_override\x18\x05 \x01(\x01\x1a\x19\n\x03RRF\x12\x12\n\x05\x61lpha\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x42\t\n\x07ranking\"\xdb\x02\n\x15\x46indNeighborsResponse\x12]\n\x11nearest_neighbors\x18\x01 \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors\x1at\n\x08Neighbor\x12=\n\tdatapoint\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.IndexDatapoint\x12\x10\n\x08\x64istance\x18\x02 \x01(\x01\x12\x17\n\x0fsparse_distance\x18\x03 \x01(\x01\x1am\n\x10NearestNeighbors\x12\n\n\x02id\x18\x01 \x01(\t\x12M\n\tneighbors\x18\x02 \x03(\x0b\x32:.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor\"\x8d\x01\n\x1aReadIndexDatapointsRequest\x12G\n\x0eindex_endpoint\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/IndexEndpoint\x12\x19\n\x11\x64\x65ployed_index_id\x18\x02 \x01(\t\x12\x0b\n\x03ids\x18\x03 \x03(\t\"]\n\x1bReadIndexDatapointsResponse\x12>\n\ndatapoints\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.IndexDatapoint2\x91\x04\n\x0cMatchService\x12\xcb\x01\n\rFindNeighbors\x12\x30.google.cloud.aiplatform.v1.FindNeighborsRequest\x1a\x31.google.cloud.aiplatform.v1.FindNeighborsResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors:\x01*\x12\xe3\x01\n\x13ReadIndexDatapoints\x12\x36.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest\x1a\x37.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse\"[\x82\xd3\xe4\x93\x02U\"P/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11MatchServiceProtoP\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.IndexDatapoint", "google/cloud/aiplatform/v1/index.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 + FindNeighborsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsRequest").msgclass + FindNeighborsRequest::Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsRequest.Query").msgclass + FindNeighborsRequest::Query::RRF = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF").msgclass + FindNeighborsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsResponse").msgclass + FindNeighborsResponse::Neighbor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor").msgclass + FindNeighborsResponse::NearestNeighbors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors").msgclass + ReadIndexDatapointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadIndexDatapointsRequest").msgclass + ReadIndexDatapointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadIndexDatapointsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb new file mode 100644 index 000000000000..0ad4f60200e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/match_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/match_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module MatchService + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.MatchService' + + # Finds the nearest neighbors of each vector within the request. + rpc :FindNeighbors, ::Google::Cloud::AIPlatform::V1::FindNeighborsRequest, ::Google::Cloud::AIPlatform::V1::FindNeighborsResponse + # Reads the datapoints/vectors of the given IDs. + # A maximum of 1000 datapoints can be retrieved in a batch. + rpc :ReadIndexDatapoints, ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest, ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb new file mode 100644 index 000000000000..74b706cd53fe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/metadata_schema.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/metadata_schema.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x04\n\x0eMetadataSchema\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x0eschema_version\x18\x02 \x01(\t\x12\x13\n\x06schema\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12R\n\x0bschema_type\x18\x04 \x01(\x0e\x32=.google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\"s\n\x12MetadataSchemaType\x12$\n METADATA_SCHEMA_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rARTIFACT_TYPE\x10\x01\x12\x12\n\x0e\x45XECUTION_TYPE\x10\x02\x12\x10\n\x0c\x43ONTEXT_TYPE\x10\x03:\x99\x01\xea\x41\x95\x01\n(aiplatform.googleapis.com/MetadataSchema\x12iprojects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13MetadataSchemaProtoP\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"], + ] + 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 + MetadataSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetadataSchema").msgclass + MetadataSchema::MetadataSchemaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb new file mode 100644 index 000000000000..11d750b1bce3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/metadata_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/artifact_pb' +require 'google/cloud/aiplatform/v1/context_pb' +require 'google/cloud/aiplatform/v1/event_pb' +require 'google/cloud/aiplatform/v1/execution_pb' +require 'google/cloud/aiplatform/v1/lineage_subgraph_pb' +require 'google/cloud/aiplatform/v1/metadata_schema_pb' +require 'google/cloud/aiplatform/v1/metadata_store_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/metadata_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/artifact.proto\x1a(google/cloud/aiplatform/v1/context.proto\x1a&google/cloud/aiplatform/v1/event.proto\x1a*google/cloud/aiplatform/v1/execution.proto\x1a\x31google/cloud/aiplatform/v1/lineage_subgraph.proto\x1a\x30google/cloud/aiplatform/v1/metadata_schema.proto\x1a/google/cloud/aiplatform/v1/metadata_store.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xba\x01\n\x1a\x43reateMetadataStoreRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x46\n\x0emetadata_store\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.MetadataStoreB\x03\xe0\x41\x02\x12\x19\n\x11metadata_store_id\x18\x03 \x01(\t\"v\n$CreateMetadataStoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"X\n\x17GetMetadataStoreRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\"}\n\x19ListMetadataStoresRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x1aListMetadataStoresResponse\x12\x42\n\x0fmetadata_stores\x18\x01 \x03(\x0b\x32).google.cloud.aiplatform.v1.MetadataStore\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"n\n\x1a\x44\x65leteMetadataStoreRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\x12\x11\n\x05\x66orce\x18\x02 \x01(\x08\x42\x02\x18\x01\"v\n$DeleteMetadataStoreOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xaa\x01\n\x15\x43reateArtifactRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\x12;\n\x08\x61rtifact\x18\x02 \x01(\x0b\x32$.google.cloud.aiplatform.v1.ArtifactB\x03\xe0\x41\x02\x12\x13\n\x0b\x61rtifact_id\x18\x03 \x01(\t\"N\n\x12GetArtifactRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\"\x9b\x01\n\x14ListArtifactsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"aiplatform.googleapis.com/Artifact\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"i\n\x15ListArtifactsResponse\x12\x37\n\tartifacts\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.Artifact\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa1\x01\n\x15UpdateArtifactRequest\x12;\n\x08\x61rtifact\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.ArtifactB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"d\n\x15\x44\x65leteArtifactRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"|\n\x15PurgeArtifactsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"aiplatform.googleapis.com/Artifact\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"l\n\x16PurgeArtifactsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12=\n\x0cpurge_sample\x18\x02 \x03(\tB\'\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\"h\n\x16PurgeArtifactsMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xa6\x01\n\x14\x43reateContextRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\x12\x39\n\x07\x63ontext\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContextB\x03\xe0\x41\x02\x12\x12\n\ncontext_id\x18\x03 \x01(\t\"L\n\x11GetContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\"\x99\x01\n\x13ListContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!aiplatform.googleapis.com/Context\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"f\n\x14ListContextsResponse\x12\x35\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Context\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9e\x01\n\x14UpdateContextRequest\x12\x39\n\x07\x63ontext\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContextB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"q\n\x14\x44\x65leteContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"z\n\x14PurgeContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!aiplatform.googleapis.com/Context\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"j\n\x15PurgeContextsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12<\n\x0cpurge_sample\x18\x02 \x03(\tB&\xfa\x41#\n!aiplatform.googleapis.com/Context\"g\n\x15PurgeContextsMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xdf\x01\n\'AddContextArtifactsAndExecutionsRequest\x12:\n\x07\x63ontext\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\x12:\n\tartifacts\x18\x02 \x03(\tB\'\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\x12<\n\nexecutions\x18\x03 \x03(\tB(\xfa\x41%\n#aiplatform.googleapis.com/Execution\"*\n(AddContextArtifactsAndExecutionsResponse\"\x97\x01\n\x19\x41\x64\x64\x43ontextChildrenRequest\x12:\n\x07\x63ontext\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\x12>\n\x0e\x63hild_contexts\x18\x02 \x03(\tB&\xfa\x41#\n!aiplatform.googleapis.com/Context\"\x1c\n\x1a\x41\x64\x64\x43ontextChildrenResponse\"\x9a\x01\n\x1cRemoveContextChildrenRequest\x12:\n\x07\x63ontext\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\x12>\n\x0e\x63hild_contexts\x18\x02 \x03(\tB&\xfa\x41#\n!aiplatform.googleapis.com/Context\"\x1f\n\x1dRemoveContextChildrenResponse\"`\n\"QueryContextLineageSubgraphRequest\x12:\n\x07\x63ontext\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Context\"\xae\x01\n\x16\x43reateExecutionRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\x12=\n\texecution\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.ExecutionB\x03\xe0\x41\x02\x12\x14\n\x0c\x65xecution_id\x18\x03 \x01(\t\"P\n\x13GetExecutionRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/Execution\"\x9d\x01\n\x15ListExecutionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#aiplatform.googleapis.com/Execution\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"l\n\x16ListExecutionsResponse\x12\x39\n\nexecutions\x18\x01 \x03(\x0b\x32%.google.cloud.aiplatform.v1.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa4\x01\n\x16UpdateExecutionRequest\x12=\n\texecution\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.ExecutionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"f\n\x16\x44\x65leteExecutionRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/Execution\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"~\n\x16PurgeExecutionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#aiplatform.googleapis.com/Execution\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"n\n\x17PurgeExecutionsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12>\n\x0cpurge_sample\x18\x02 \x03(\tB(\xfa\x41%\n#aiplatform.googleapis.com/Execution\"i\n\x17PurgeExecutionsMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x8e\x01\n\x19\x41\x64\x64\x45xecutionEventsRequest\x12>\n\texecution\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/Execution\x12\x31\n\x06\x65vents\x18\x02 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Event\"\x1c\n\x1a\x41\x64\x64\x45xecutionEventsResponse\"g\n%QueryExecutionInputsAndOutputsRequest\x12>\n\texecution\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/Execution\"\xc4\x01\n\x1b\x43reateMetadataSchemaRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'aiplatform.googleapis.com/MetadataStore\x12H\n\x0fmetadata_schema\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.MetadataSchemaB\x03\xe0\x41\x02\x12\x1a\n\x12metadata_schema_id\x18\x03 \x01(\t\"Z\n\x18GetMetadataSchemaRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/MetadataSchema\"\x95\x01\n\x1aListMetadataSchemasRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(aiplatform.googleapis.com/MetadataSchema\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"|\n\x1bListMetadataSchemasResponse\x12\x44\n\x10metadata_schemas\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.MetadataSchema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x85\x01\n#QueryArtifactLineageSubgraphRequest\x12<\n\x08\x61rtifact\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Artifact\x12\x10\n\x08max_hops\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t2\xb1:\n\x0fMetadataService\x12\x9b\x02\n\x13\x43reateMetadataStore\x12\x36.google.cloud.aiplatform.v1.CreateMetadataStoreRequest\x1a\x1d.google.longrunning.Operation\"\xac\x01\xca\x41\x35\n\rMetadataStore\x12$CreateMetadataStoreOperationMetadata\xda\x41\'parent,metadata_store,metadata_store_id\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/metadataStores:\x0emetadata_store\x12\xb5\x01\n\x10GetMetadataStore\x12\x33.google.cloud.aiplatform.v1.GetMetadataStoreRequest\x1a).google.cloud.aiplatform.v1.MetadataStore\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/metadataStores/*}\x12\xc8\x01\n\x12ListMetadataStores\x12\x35.google.cloud.aiplatform.v1.ListMetadataStoresRequest\x1a\x36.google.cloud.aiplatform.v1.ListMetadataStoresResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/metadataStores\x12\xf0\x01\n\x13\x44\x65leteMetadataStore\x12\x36.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41=\n\x15google.protobuf.Empty\x12$DeleteMetadataStoreOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/metadataStores/*}\x12\xd9\x01\n\x0e\x43reateArtifact\x12\x31.google.cloud.aiplatform.v1.CreateArtifactRequest\x1a$.google.cloud.aiplatform.v1.Artifact\"n\xda\x41\x1bparent,artifact,artifact_id\x82\xd3\xe4\x93\x02J\">/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:\x08\x61rtifact\x12\xb2\x01\n\x0bGetArtifact\x12..google.cloud.aiplatform.v1.GetArtifactRequest\x1a$.google.cloud.aiplatform.v1.Artifact\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}\x12\xc5\x01\n\rListArtifacts\x12\x30.google.cloud.aiplatform.v1.ListArtifactsRequest\x1a\x31.google.cloud.aiplatform.v1.ListArtifactsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts\x12\xdb\x01\n\x0eUpdateArtifact\x12\x31.google.cloud.aiplatform.v1.UpdateArtifactRequest\x1a$.google.cloud.aiplatform.v1.Artifact\"p\xda\x41\x14\x61rtifact,update_mask\x82\xd3\xe4\x93\x02S2G/v1/{artifact.name=projects/*/locations/*/metadataStores/*/artifacts/*}:\x08\x61rtifact\x12\xe5\x01\n\x0e\x44\x65leteArtifact\x12\x31.google.cloud.aiplatform.v1.DeleteArtifactRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}\x12\xf0\x01\n\x0ePurgeArtifacts\x12\x31.google.cloud.aiplatform.v1.PurgeArtifactsRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41\x30\n\x16PurgeArtifactsResponse\x12\x16PurgeArtifactsMetadata\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\"D/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:purge:\x01*\x12\xd2\x01\n\rCreateContext\x12\x30.google.cloud.aiplatform.v1.CreateContextRequest\x1a#.google.cloud.aiplatform.v1.Context\"j\xda\x41\x19parent,context,context_id\x82\xd3\xe4\x93\x02H\"=/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts:\x07\x63ontext\x12\xae\x01\n\nGetContext\x12-.google.cloud.aiplatform.v1.GetContextRequest\x1a#.google.cloud.aiplatform.v1.Context\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}\x12\xc1\x01\n\x0cListContexts\x12/.google.cloud.aiplatform.v1.ListContextsRequest\x1a\x30.google.cloud.aiplatform.v1.ListContextsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts\x12\xd4\x01\n\rUpdateContext\x12\x30.google.cloud.aiplatform.v1.UpdateContextRequest\x1a#.google.cloud.aiplatform.v1.Context\"l\xda\x41\x13\x63ontext,update_mask\x82\xd3\xe4\x93\x02P2E/v1/{context.name=projects/*/locations/*/metadataStores/*/contexts/*}:\x07\x63ontext\x12\xe1\x01\n\rDeleteContext\x12\x30.google.cloud.aiplatform.v1.DeleteContextRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}\x12\xeb\x01\n\rPurgeContexts\x12\x30.google.cloud.aiplatform.v1.PurgeContextsRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41.\n\x15PurgeContextsResponse\x12\x15PurgeContextsMetadata\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\"C/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts:purge:\x01*\x12\xbb\x02\n AddContextArtifactsAndExecutions\x12\x43.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest\x1a\x44.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse\"\x8b\x01\xda\x41\x1c\x63ontext,artifacts,executions\x82\xd3\xe4\x93\x02\x66\"a/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextArtifactsAndExecutions:\x01*\x12\xfc\x01\n\x12\x41\x64\x64\x43ontextChildren\x12\x35.google.cloud.aiplatform.v1.AddContextChildrenRequest\x1a\x36.google.cloud.aiplatform.v1.AddContextChildrenResponse\"w\xda\x41\x16\x63ontext,child_contexts\x82\xd3\xe4\x93\x02X\"S/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextChildren:\x01*\x12\x88\x02\n\x15RemoveContextChildren\x12\x38.google.cloud.aiplatform.v1.RemoveContextChildrenRequest\x1a\x39.google.cloud.aiplatform.v1.RemoveContextChildrenResponse\"z\xda\x41\x16\x63ontext,child_contexts\x82\xd3\xe4\x93\x02[\"V/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:removeContextChildren:\x01*\x12\xfa\x01\n\x1bQueryContextLineageSubgraph\x12>.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest\x1a+.google.cloud.aiplatform.v1.LineageSubgraph\"n\xda\x41\x07\x63ontext\x82\xd3\xe4\x93\x02^\x12\\/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:queryContextLineageSubgraph\x12\xe0\x01\n\x0f\x43reateExecution\x12\x32.google.cloud.aiplatform.v1.CreateExecutionRequest\x1a%.google.cloud.aiplatform.v1.Execution\"r\xda\x41\x1dparent,execution,execution_id\x82\xd3\xe4\x93\x02L\"?/v1/{parent=projects/*/locations/*/metadataStores/*}/executions:\texecution\x12\xb6\x01\n\x0cGetExecution\x12/.google.cloud.aiplatform.v1.GetExecutionRequest\x1a%.google.cloud.aiplatform.v1.Execution\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}\x12\xc9\x01\n\x0eListExecutions\x12\x31.google.cloud.aiplatform.v1.ListExecutionsRequest\x1a\x32.google.cloud.aiplatform.v1.ListExecutionsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/metadataStores/*}/executions\x12\xe2\x01\n\x0fUpdateExecution\x12\x32.google.cloud.aiplatform.v1.UpdateExecutionRequest\x1a%.google.cloud.aiplatform.v1.Execution\"t\xda\x41\x15\x65xecution,update_mask\x82\xd3\xe4\x93\x02V2I/v1/{execution.name=projects/*/locations/*/metadataStores/*/executions/*}:\texecution\x12\xe8\x01\n\x0f\x44\x65leteExecution\x12\x32.google.cloud.aiplatform.v1.DeleteExecutionRequest\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/*/metadataStores/*/executions/*}\x12\xf5\x01\n\x0fPurgeExecutions\x12\x32.google.cloud.aiplatform.v1.PurgeExecutionsRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41\x32\n\x17PurgeExecutionsResponse\x12\x17PurgeExecutionsMetadata\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\"E/v1/{parent=projects/*/locations/*/metadataStores/*}/executions:purge:\x01*\x12\xfa\x01\n\x12\x41\x64\x64\x45xecutionEvents\x12\x35.google.cloud.aiplatform.v1.AddExecutionEventsRequest\x1a\x36.google.cloud.aiplatform.v1.AddExecutionEventsResponse\"u\xda\x41\x10\x65xecution,events\x82\xd3\xe4\x93\x02\\\"W/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:addExecutionEvents:\x01*\x12\x89\x02\n\x1eQueryExecutionInputsAndOutputs\x12\x41.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest\x1a+.google.cloud.aiplatform.v1.LineageSubgraph\"w\xda\x41\texecution\x82\xd3\xe4\x93\x02\x65\x12\x63/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:queryExecutionInputsAndOutputs\x12\x87\x02\n\x14\x43reateMetadataSchema\x12\x37.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest\x1a*.google.cloud.aiplatform.v1.MetadataSchema\"\x89\x01\xda\x41)parent,metadata_schema,metadata_schema_id\x82\xd3\xe4\x93\x02W\"D/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas:\x0fmetadata_schema\x12\xca\x01\n\x11GetMetadataSchema\x12\x34.google.cloud.aiplatform.v1.GetMetadataSchemaRequest\x1a*.google.cloud.aiplatform.v1.MetadataSchema\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{name=projects/*/locations/*/metadataStores/*/metadataSchemas/*}\x12\xdd\x01\n\x13ListMetadataSchemas\x12\x36.google.cloud.aiplatform.v1.ListMetadataSchemasRequest\x1a\x37.google.cloud.aiplatform.v1.ListMetadataSchemasResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas\x12\x80\x02\n\x1cQueryArtifactLineageSubgraph\x12?.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest\x1a+.google.cloud.aiplatform.v1.LineageSubgraph\"r\xda\x41\x08\x61rtifact\x82\xd3\xe4\x93\x02\x61\x12_/v1/{artifact=projects/*/locations/*/metadataStores/*/artifacts/*}:queryArtifactLineageSubgraph\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14MetadataServiceProtoP\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.MetadataStore", "google/cloud/aiplatform/v1/metadata_store.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.cloud.aiplatform.v1.Artifact", "google/cloud/aiplatform/v1/artifact.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.Context", "google/cloud/aiplatform/v1/context.proto"], + ["google.cloud.aiplatform.v1.Execution", "google/cloud/aiplatform/v1/execution.proto"], + ["google.cloud.aiplatform.v1.Event", "google/cloud/aiplatform/v1/event.proto"], + ["google.cloud.aiplatform.v1.MetadataSchema", "google/cloud/aiplatform/v1/metadata_schema.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 + CreateMetadataStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateMetadataStoreRequest").msgclass + CreateMetadataStoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateMetadataStoreOperationMetadata").msgclass + GetMetadataStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetMetadataStoreRequest").msgclass + ListMetadataStoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListMetadataStoresRequest").msgclass + ListMetadataStoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListMetadataStoresResponse").msgclass + DeleteMetadataStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteMetadataStoreRequest").msgclass + DeleteMetadataStoreOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteMetadataStoreOperationMetadata").msgclass + CreateArtifactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateArtifactRequest").msgclass + GetArtifactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetArtifactRequest").msgclass + ListArtifactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListArtifactsRequest").msgclass + ListArtifactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListArtifactsResponse").msgclass + UpdateArtifactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateArtifactRequest").msgclass + DeleteArtifactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteArtifactRequest").msgclass + PurgeArtifactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeArtifactsRequest").msgclass + PurgeArtifactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeArtifactsResponse").msgclass + PurgeArtifactsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeArtifactsMetadata").msgclass + CreateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateContextRequest").msgclass + GetContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetContextRequest").msgclass + ListContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListContextsRequest").msgclass + ListContextsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListContextsResponse").msgclass + UpdateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateContextRequest").msgclass + DeleteContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteContextRequest").msgclass + PurgeContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeContextsRequest").msgclass + PurgeContextsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeContextsResponse").msgclass + PurgeContextsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeContextsMetadata").msgclass + AddContextArtifactsAndExecutionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest").msgclass + AddContextArtifactsAndExecutionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse").msgclass + AddContextChildrenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddContextChildrenRequest").msgclass + AddContextChildrenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddContextChildrenResponse").msgclass + RemoveContextChildrenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RemoveContextChildrenRequest").msgclass + RemoveContextChildrenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RemoveContextChildrenResponse").msgclass + QueryContextLineageSubgraphRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest").msgclass + CreateExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateExecutionRequest").msgclass + GetExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetExecutionRequest").msgclass + ListExecutionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListExecutionsRequest").msgclass + ListExecutionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListExecutionsResponse").msgclass + UpdateExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateExecutionRequest").msgclass + DeleteExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteExecutionRequest").msgclass + PurgeExecutionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeExecutionsRequest").msgclass + PurgeExecutionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeExecutionsResponse").msgclass + PurgeExecutionsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PurgeExecutionsMetadata").msgclass + AddExecutionEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddExecutionEventsRequest").msgclass + AddExecutionEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddExecutionEventsResponse").msgclass + QueryExecutionInputsAndOutputsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest").msgclass + CreateMetadataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateMetadataSchemaRequest").msgclass + GetMetadataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetMetadataSchemaRequest").msgclass + ListMetadataSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListMetadataSchemasRequest").msgclass + ListMetadataSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListMetadataSchemasResponse").msgclass + QueryArtifactLineageSubgraphRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_services_pb.rb new file mode 100644 index 000000000000..ebb46c6a09fc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_service_services_pb.rb @@ -0,0 +1,123 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/metadata_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/metadata_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module MetadataService + # Service for reading and writing metadata entries. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.MetadataService' + + # Initializes a MetadataStore, including allocation of resources. + rpc :CreateMetadataStore, ::Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest, ::Google::Longrunning::Operation + # Retrieves a specific MetadataStore. + rpc :GetMetadataStore, ::Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest, ::Google::Cloud::AIPlatform::V1::MetadataStore + # Lists MetadataStores for a Location. + rpc :ListMetadataStores, ::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest, ::Google::Cloud::AIPlatform::V1::ListMetadataStoresResponse + # Deletes a single MetadataStore and all its child resources (Artifacts, + # Executions, and Contexts). + rpc :DeleteMetadataStore, ::Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest, ::Google::Longrunning::Operation + # Creates an Artifact associated with a MetadataStore. + rpc :CreateArtifact, ::Google::Cloud::AIPlatform::V1::CreateArtifactRequest, ::Google::Cloud::AIPlatform::V1::Artifact + # Retrieves a specific Artifact. + rpc :GetArtifact, ::Google::Cloud::AIPlatform::V1::GetArtifactRequest, ::Google::Cloud::AIPlatform::V1::Artifact + # Lists Artifacts in the MetadataStore. + rpc :ListArtifacts, ::Google::Cloud::AIPlatform::V1::ListArtifactsRequest, ::Google::Cloud::AIPlatform::V1::ListArtifactsResponse + # Updates a stored Artifact. + rpc :UpdateArtifact, ::Google::Cloud::AIPlatform::V1::UpdateArtifactRequest, ::Google::Cloud::AIPlatform::V1::Artifact + # Deletes an Artifact. + rpc :DeleteArtifact, ::Google::Cloud::AIPlatform::V1::DeleteArtifactRequest, ::Google::Longrunning::Operation + # Purges Artifacts. + rpc :PurgeArtifacts, ::Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest, ::Google::Longrunning::Operation + # Creates a Context associated with a MetadataStore. + rpc :CreateContext, ::Google::Cloud::AIPlatform::V1::CreateContextRequest, ::Google::Cloud::AIPlatform::V1::Context + # Retrieves a specific Context. + rpc :GetContext, ::Google::Cloud::AIPlatform::V1::GetContextRequest, ::Google::Cloud::AIPlatform::V1::Context + # Lists Contexts on the MetadataStore. + rpc :ListContexts, ::Google::Cloud::AIPlatform::V1::ListContextsRequest, ::Google::Cloud::AIPlatform::V1::ListContextsResponse + # Updates a stored Context. + rpc :UpdateContext, ::Google::Cloud::AIPlatform::V1::UpdateContextRequest, ::Google::Cloud::AIPlatform::V1::Context + # Deletes a stored Context. + rpc :DeleteContext, ::Google::Cloud::AIPlatform::V1::DeleteContextRequest, ::Google::Longrunning::Operation + # Purges Contexts. + rpc :PurgeContexts, ::Google::Cloud::AIPlatform::V1::PurgeContextsRequest, ::Google::Longrunning::Operation + # Adds a set of Artifacts and Executions to a Context. If any of the + # Artifacts or Executions have already been added to a Context, they are + # simply skipped. + rpc :AddContextArtifactsAndExecutions, ::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest, ::Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse + # Adds a set of Contexts as children to a parent Context. If any of the + # child Contexts have already been added to the parent Context, they are + # simply skipped. If this call would create a cycle or cause any Context to + # have more than 10 parents, the request will fail with an INVALID_ARGUMENT + # error. + rpc :AddContextChildren, ::Google::Cloud::AIPlatform::V1::AddContextChildrenRequest, ::Google::Cloud::AIPlatform::V1::AddContextChildrenResponse + # Remove a set of children contexts from a parent Context. If any of the + # child Contexts were NOT added to the parent Context, they are + # simply skipped. + rpc :RemoveContextChildren, ::Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest, ::Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse + # Retrieves Artifacts and Executions within the specified Context, connected + # by Event edges and returned as a LineageSubgraph. + rpc :QueryContextLineageSubgraph, ::Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest, ::Google::Cloud::AIPlatform::V1::LineageSubgraph + # Creates an Execution associated with a MetadataStore. + rpc :CreateExecution, ::Google::Cloud::AIPlatform::V1::CreateExecutionRequest, ::Google::Cloud::AIPlatform::V1::Execution + # Retrieves a specific Execution. + rpc :GetExecution, ::Google::Cloud::AIPlatform::V1::GetExecutionRequest, ::Google::Cloud::AIPlatform::V1::Execution + # Lists Executions in the MetadataStore. + rpc :ListExecutions, ::Google::Cloud::AIPlatform::V1::ListExecutionsRequest, ::Google::Cloud::AIPlatform::V1::ListExecutionsResponse + # Updates a stored Execution. + rpc :UpdateExecution, ::Google::Cloud::AIPlatform::V1::UpdateExecutionRequest, ::Google::Cloud::AIPlatform::V1::Execution + # Deletes an Execution. + rpc :DeleteExecution, ::Google::Cloud::AIPlatform::V1::DeleteExecutionRequest, ::Google::Longrunning::Operation + # Purges Executions. + rpc :PurgeExecutions, ::Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest, ::Google::Longrunning::Operation + # Adds Events to the specified Execution. An Event indicates whether an + # Artifact was used as an input or output for an Execution. If an Event + # already exists between the Execution and the Artifact, the Event is + # skipped. + rpc :AddExecutionEvents, ::Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest, ::Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse + # Obtains the set of input and output Artifacts for this Execution, in the + # form of LineageSubgraph that also contains the Execution and connecting + # Events. + rpc :QueryExecutionInputsAndOutputs, ::Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest, ::Google::Cloud::AIPlatform::V1::LineageSubgraph + # Creates a MetadataSchema. + rpc :CreateMetadataSchema, ::Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest, ::Google::Cloud::AIPlatform::V1::MetadataSchema + # Retrieves a specific MetadataSchema. + rpc :GetMetadataSchema, ::Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest, ::Google::Cloud::AIPlatform::V1::MetadataSchema + # Lists MetadataSchemas. + rpc :ListMetadataSchemas, ::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest, ::Google::Cloud::AIPlatform::V1::ListMetadataSchemasResponse + # Retrieves lineage of an Artifact represented through Artifacts and + # Executions connected by Event edges and returned as a LineageSubgraph. + rpc :QueryArtifactLineageSubgraph, ::Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest, ::Google::Cloud::AIPlatform::V1::LineageSubgraph + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb new file mode 100644 index 000000000000..fbb75585e071 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/metadata_store.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/aiplatform/v1/metadata_store.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\x1fgoogle/protobuf/timestamp.proto\"\xf9\x04\n\rMetadataStore\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\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\x43\n\x0f\x65ncryption_spec\x18\x05 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12P\n\x05state\x18\x07 \x01(\x0b\x32<.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreStateB\x03\xe0\x41\x03\x12V\n\x0f\x64\x61taplex_config\x18\x08 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.MetadataStore.DataplexConfigB\x03\xe0\x41\x01\x1a\x34\n\x12MetadataStoreState\x12\x1e\n\x16\x64isk_utilization_bytes\x18\x01 \x01(\x03\x1a\x38\n\x0e\x44\x61taplexConfig\x12&\n\x19\x65nabled_pipelines_lineage\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01:u\xea\x41r\n\'aiplatform.googleapis.com/MetadataStore\x12Gprojects/{project}/locations/{location}/metadataStores/{metadata_store}B\xcb\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\rMetadataProtoP\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.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + MetadataStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetadataStore").msgclass + MetadataStore::MetadataStoreState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState").msgclass + MetadataStore::DataplexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MetadataStore.DataplexConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb new file mode 100644 index 000000000000..563988e65374 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/migratable_resource.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/aiplatform/v1/migratable_resource.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd3\t\n\x12MigratableResource\x12k\n\x17ml_engine_model_version\x18\x01 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersionB\x03\xe0\x41\x03H\x00\x12W\n\x0c\x61utoml_model\x18\x02 \x01(\x0b\x32:.google.cloud.aiplatform.v1.MigratableResource.AutomlModelB\x03\xe0\x41\x03H\x00\x12[\n\x0e\x61utoml_dataset\x18\x03 \x01(\x0b\x32<.google.cloud.aiplatform.v1.MigratableResource.AutomlDatasetB\x03\xe0\x41\x03H\x00\x12h\n\x15\x64\x61ta_labeling_dataset\x18\x04 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDatasetB\x03\xe0\x41\x03H\x00\x12:\n\x11last_migrate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aY\n\x14MlEngineModelVersion\x12\x10\n\x08\x65ndpoint\x18\x01 \x01(\t\x12/\n\x07version\x18\x02 \x01(\tB\x1e\xfa\x41\x1b\n\x19ml.googleapis.com/Version\x1aZ\n\x0b\x41utomlModel\x12/\n\x05model\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\x1a\n\x12model_display_name\x18\x03 \x01(\t\x1a\x62\n\rAutomlDataset\x12\x33\n\x07\x64\x61taset\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\x12\x1c\n\x14\x64\x61taset_display_name\x18\x04 \x01(\t\x1a\x91\x03\n\x13\x44\x61taLabelingDataset\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB(\xfa\x41%\n#datalabeling.googleapis.com/Dataset\x12\x1c\n\x14\x64\x61taset_display_name\x18\x04 \x01(\t\x12\x89\x01\n data_labeling_annotated_datasets\x18\x03 \x03(\x0b\x32_.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset\x1a\x94\x01\n\x1c\x44\x61taLabelingAnnotatedDataset\x12L\n\x11\x61nnotated_dataset\x18\x01 \x01(\tB1\xfa\x41.\n,datalabeling.googleapis.com/AnnotatedDataset\x12&\n\x1e\x61nnotated_dataset_display_name\x18\x03 \x01(\tB\n\n\x08resourceB\xac\x05\n\x1e\x63om.google.cloud.aiplatform.v1B\x17MigratableResourceProtoP\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\x41Q\n\x19ml.googleapis.com/Version\x12\x34projects/{project}/models/{model}/versions/{version}\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\xea\x41[\n\x1d\x61utoml.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}\xea\x41L\n#datalabeling.googleapis.com/Dataset\x12%projects/{project}/datasets/{dataset}\xea\x41{\n,datalabeling.googleapis.com/AnnotatedDataset\x12Kprojects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}b\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"], + ] + 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 + MigratableResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource").msgclass + MigratableResource::MlEngineModelVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion").msgclass + MigratableResource::AutomlModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource.AutomlModel").msgclass + MigratableResource::AutomlDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource.AutomlDataset").msgclass + MigratableResource::DataLabelingDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset").msgclass + MigratableResource::DataLabelingDataset::DataLabelingAnnotatedDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_pb.rb new file mode 100644 index 000000000000..9df416453e0c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/migration_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/migratable_resource_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/cloud/aiplatform/v1/migration_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\x34google/cloud/aiplatform/v1/migratable_resource.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x17google/rpc/status.proto\"\x94\x01\n SearchMigratableResourcesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"\x8a\x01\n!SearchMigratableResourcesResponse\x12L\n\x14migratable_resources\x18\x01 \x03(\x0b\x32..google.cloud.aiplatform.v1.MigratableResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb5\x01\n\x1c\x42\x61tchMigrateResourcesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12Z\n\x19migrate_resource_requests\x18\x02 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.MigrateResourceRequestB\x03\xe0\x41\x02\"\xe2\n\n\x16MigrateResourceRequest\x12\x86\x01\n&migrate_ml_engine_model_version_config\x18\x01 \x01(\x0b\x32T.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfigH\x00\x12r\n\x1bmigrate_automl_model_config\x18\x02 \x01(\x0b\x32K.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfigH\x00\x12v\n\x1dmigrate_automl_dataset_config\x18\x03 \x01(\x0b\x32M.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfigH\x00\x12\x83\x01\n$migrate_data_labeling_dataset_config\x18\x04 \x01(\x0b\x32S.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfigH\x00\x1a\x95\x01\n!MigrateMlEngineModelVersionConfig\x12\x15\n\x08\x65ndpoint\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\rmodel_version\x18\x02 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19ml.googleapis.com/Version\x12\x1f\n\x12model_display_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1ao\n\x18MigrateAutomlModelConfig\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\x1f\n\x12model_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aw\n\x1aMigrateAutomlDatasetConfig\x12\x36\n\x07\x64\x61taset\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61utoml.googleapis.com/Dataset\x12!\n\x14\x64\x61taset_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xbf\x03\n MigrateDataLabelingDatasetConfig\x12<\n\x07\x64\x61taset\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datalabeling.googleapis.com/Dataset\x12!\n\x14\x64\x61taset_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\xbb\x01\n/migrate_data_labeling_annotated_dataset_configs\x18\x03 \x03(\x0b\x32}.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfigB\x03\xe0\x41\x01\x1a|\n)MigrateDataLabelingAnnotatedDatasetConfig\x12O\n\x11\x61nnotated_dataset\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,datalabeling.googleapis.com/AnnotatedDatasetB\t\n\x07request\"x\n\x1d\x42\x61tchMigrateResourcesResponse\x12W\n\x1amigrate_resource_responses\x18\x01 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.MigrateResourceResponse\"\xed\x01\n\x17MigrateResourceResponse\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB&\xfa\x41#\n!aiplatform.googleapis.com/DatasetH\x00\x12\x35\n\x05model\x18\x02 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/ModelH\x00\x12K\n\x13migratable_resource\x18\x03 \x01(\x0b\x32..google.cloud.aiplatform.v1.MigratableResourceB\x13\n\x11migrated_resource\"\xdb\x03\n&BatchMigrateResourcesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12i\n\x0fpartial_results\x18\x02 \x03(\x0b\x32P.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult\x1a\xf5\x01\n\rPartialResult\x12#\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12\x35\n\x05model\x18\x03 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/ModelH\x00\x12\x39\n\x07\x64\x61taset\x18\x04 \x01(\tB&\xfa\x41#\n!aiplatform.googleapis.com/DatasetH\x00\x12\x43\n\x07request\x18\x01 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.MigrateResourceRequestB\x08\n\x06result2\x82\x05\n\x10MigrationService\x12\xec\x01\n\x19SearchMigratableResources\x12<.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest\x1a=.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\">/v1/{parent=projects/*/locations/*}/migratableResources:search:\x01*\x12\xaf\x02\n\x15\x42\x61tchMigrateResources\x12\x38.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41G\n\x1d\x42\x61tchMigrateResourcesResponse\x12&BatchMigrateResourcesOperationMetadata\xda\x41 parent,migrate_resource_requests\x82\xd3\xe4\x93\x02I\"D/v1/{parent=projects/*/locations/*}/migratableResources:batchMigrate:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x15MigrationServiceProtoP\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.MigratableResource", "google/cloud/aiplatform/v1/migratable_resource.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.rpc.Status", "google/rpc/status.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 + SearchMigratableResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchMigratableResourcesRequest").msgclass + SearchMigratableResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SearchMigratableResourcesResponse").msgclass + BatchMigrateResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchMigrateResourcesRequest").msgclass + MigrateResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest").msgclass + MigrateResourceRequest::MigrateMlEngineModelVersionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig").msgclass + MigrateResourceRequest::MigrateAutomlModelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig").msgclass + MigrateResourceRequest::MigrateAutomlDatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig").msgclass + MigrateResourceRequest::MigrateDataLabelingDatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig").msgclass + MigrateResourceRequest::MigrateDataLabelingDatasetConfig::MigrateDataLabelingAnnotatedDatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig").msgclass + BatchMigrateResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchMigrateResourcesResponse").msgclass + MigrateResourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MigrateResourceResponse").msgclass + BatchMigrateResourcesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata").msgclass + BatchMigrateResourcesOperationMetadata::PartialResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_services_pb.rb new file mode 100644 index 000000000000..b84baa50ae1d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/migration_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/migration_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/migration_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module MigrationService + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.MigrationService' + + # Searches all of the resources in automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + # Vertex AI's given location. + rpc :SearchMigratableResources, ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest, ::Google::Cloud::AIPlatform::V1::SearchMigratableResourcesResponse + # Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + # and datalabeling.googleapis.com to Vertex AI. + rpc :BatchMigrateResources, ::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb new file mode 100644 index 000000000000..0f00fe4b799c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/feature_monitoring_stats_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/model_monitoring_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n@google/cloud/aiplatform/v1/model_deployment_monitoring_job.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\x39google/cloud/aiplatform/v1/feature_monitoring_stats.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x31google/cloud/aiplatform/v1/model_monitoring.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe5\x10\n\x1cModelDeploymentMonitoringJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08\x65ndpoint\x18\x03 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x38\n\x05state\x18\x04 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12m\n\x0eschedule_state\x18\x05 \x01(\x0e\x32P.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.MonitoringScheduleStateB\x03\xe0\x41\x03\x12\x8b\x01\n#latest_monitoring_pipeline_metadata\x18\x19 \x01(\x0b\x32Y.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.LatestMonitoringPipelineMetadataB\x03\xe0\x41\x03\x12\x80\x01\n-model_deployment_monitoring_objective_configs\x18\x06 \x03(\x0b\x32\x44.google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveConfigB\x03\xe0\x41\x02\x12}\n+model_deployment_monitoring_schedule_config\x18\x07 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.ModelDeploymentMonitoringScheduleConfigB\x03\xe0\x41\x02\x12T\n\x19logging_sampling_strategy\x18\x08 \x01(\x0b\x32,.google.cloud.aiplatform.v1.SamplingStrategyB\x03\xe0\x41\x02\x12]\n\x1dmodel_monitoring_alert_config\x18\x0f \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.ModelMonitoringAlertConfig\x12#\n\x1bpredict_instance_schema_uri\x18\t \x01(\t\x12\x37\n\x17sample_predict_instance\x18\x13 \x01(\x0b\x32\x16.google.protobuf.Value\x12$\n\x1c\x61nalysis_instance_schema_uri\x18\x10 \x01(\t\x12`\n\x0f\x62igquery_tables\x18\n \x03(\x0b\x32\x42.google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTableB\x03\xe0\x41\x03\x12*\n\x07log_ttl\x18\x11 \x01(\x0b\x32\x19.google.protobuf.Duration\x12T\n\x06labels\x18\x0b \x03(\x0b\x32\x44.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12next_schedule_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x1estats_anomalies_base_directory\x18\x14 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestination\x12\x43\n\x0f\x65ncryption_spec\x18\x15 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\'\n\x1f\x65nable_monitoring_pipeline_logs\x18\x16 \x01(\x08\x12&\n\x05\x65rror\x18\x17 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1a \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x1b \x01(\x08\x42\x03\xe0\x41\x03\x1at\n LatestMonitoringPipelineMetadata\x12,\n\x08run_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"k\n\x17MonitoringScheduleState\x12)\n%MONITORING_SCHEDULE_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\x12\x0b\n\x07RUNNING\x10\x03:\xa5\x01\xea\x41\xa1\x01\n6aiplatform.googleapis.com/ModelDeploymentMonitoringJob\x12gprojects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}\"\xbe\x03\n&ModelDeploymentMonitoringBigQueryTable\x12`\n\nlog_source\x18\x01 \x01(\x0e\x32L.google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogSource\x12\\\n\x08log_type\x18\x02 \x01(\x0e\x32J.google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogType\x12\x1b\n\x13\x62igquery_table_path\x18\x03 \x01(\t\x12\x34\n\'request_response_logging_schema_version\x18\x04 \x01(\tB\x03\xe0\x41\x03\"B\n\tLogSource\x12\x1a\n\x16LOG_SOURCE_UNSPECIFIED\x10\x00\x12\x0c\n\x08TRAINING\x10\x01\x12\x0b\n\x07SERVING\x10\x02\"=\n\x07LogType\x12\x18\n\x14LOG_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PREDICT\x10\x01\x12\x0b\n\x07\x45XPLAIN\x10\x02\"\x9b\x01\n(ModelDeploymentMonitoringObjectiveConfig\x12\x19\n\x11\x64\x65ployed_model_id\x18\x01 \x01(\t\x12T\n\x10objective_config\x18\x02 \x01(\x0b\x32:.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig\"\x96\x01\n\'ModelDeploymentMonitoringScheduleConfig\x12\x38\n\x10monitor_interval\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x31\n\x0emonitor_window\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xac\x04\n\x1dModelMonitoringStatsAnomalies\x12U\n\tobjective\x18\x01 \x01(\x0e\x32\x42.google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12\x15\n\ranomaly_count\x18\x03 \x01(\x05\x12n\n\rfeature_stats\x18\x04 \x03(\x0b\x32W.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies\x1a\x91\x02\n\x1d\x46\x65\x61tureHistoricStatsAnomalies\x12\x1c\n\x14\x66\x65\x61ture_display_name\x18\x01 \x01(\t\x12>\n\tthreshold\x18\x03 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig\x12G\n\x0etraining_stats\x18\x04 \x01(\x0b\x32/.google.cloud.aiplatform.v1.FeatureStatsAnomaly\x12I\n\x10prediction_stats\x18\x05 \x03(\x0b\x32/.google.cloud.aiplatform.v1.FeatureStatsAnomaly*\xce\x01\n&ModelDeploymentMonitoringObjectiveType\x12:\n6MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10RAW_FEATURE_SKEW\x10\x01\x12\x15\n\x11RAW_FEATURE_DRIFT\x10\x02\x12\x1c\n\x18\x46\x45\x41TURE_ATTRIBUTION_SKEW\x10\x03\x12\x1d\n\x19\x46\x45\x41TURE_ATTRIBUTION_DRIFT\x10\x04\x42\xdf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B!ModelDeploymentMonitoringJobProtoP\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.SamplingStrategy", "google/cloud/aiplatform/v1/model_monitoring.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.GcsDestination", "google/cloud/aiplatform/v1/io.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.FeatureStatsAnomaly", "google/cloud/aiplatform/v1/feature_monitoring_stats.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 + ModelDeploymentMonitoringJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob").msgclass + ModelDeploymentMonitoringJob::LatestMonitoringPipelineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.LatestMonitoringPipelineMetadata").msgclass + ModelDeploymentMonitoringJob::MonitoringScheduleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.MonitoringScheduleState").enummodule + ModelDeploymentMonitoringBigQueryTable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable").msgclass + ModelDeploymentMonitoringBigQueryTable::LogSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogSource").enummodule + ModelDeploymentMonitoringBigQueryTable::LogType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringBigQueryTable.LogType").enummodule + ModelDeploymentMonitoringObjectiveConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveConfig").msgclass + ModelDeploymentMonitoringScheduleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringScheduleConfig").msgclass + ModelMonitoringStatsAnomalies = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies").msgclass + ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies").msgclass + ModelDeploymentMonitoringObjectiveType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb new file mode 100644 index 000000000000..d2bca680c4d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_evaluation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/model_evaluation.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xeb\x05\n\x0fModelEvaluation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\n \x01(\t\x12\x1a\n\x12metrics_schema_uri\x18\x02 \x01(\t\x12\'\n\x07metrics\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x10slice_dimensions\x18\x05 \x03(\t\x12\x1c\n\x14\x64\x61ta_item_schema_uri\x18\x06 \x01(\t\x12\x1d\n\x15\x61nnotation_schema_uri\x18\x07 \x01(\t\x12G\n\x11model_explanation\x18\x08 \x01(\x0b\x32,.google.cloud.aiplatform.v1.ModelExplanation\x12\x65\n\x11\x65xplanation_specs\x18\t \x03(\x0b\x32J.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec\x12(\n\x08metadata\x18\x0b \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x81\x01\n\x1eModelEvaluationExplanationSpec\x12\x18\n\x10\x65xplanation_type\x18\x01 \x01(\t\x12\x45\n\x10\x65xplanation_spec\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ExplanationSpec:\x7f\xea\x41|\n)aiplatform.googleapis.com/ModelEvaluation\x12Oprojects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}B\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14ModelEvaluationProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.ModelExplanation", "google/cloud/aiplatform/v1/explanation.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 + ModelEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluation").msgclass + ModelEvaluation::ModelEvaluationExplanationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb new file mode 100644 index 000000000000..188c7e9fb7c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_evaluation_slice.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n7google/cloud/aiplatform/v1/model_evaluation_slice.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xbc\t\n\x14ModelEvaluationSlice\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05slice\x18\x02 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.ModelEvaluationSlice.SliceB\x03\xe0\x41\x03\x12\x1f\n\x12metrics_schema_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12,\n\x07metrics\x18\x04 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12L\n\x11model_explanation\x18\x06 \x01(\x0b\x32,.google.cloud.aiplatform.v1.ModelExplanationB\x03\xe0\x41\x03\x1a\xda\x05\n\x05Slice\x12\x16\n\tdimension\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Y\n\nslice_spec\x18\x03 \x01(\x0b\x32@.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpecB\x03\xe0\x41\x03\x1a\xc9\x04\n\tSliceSpec\x12^\n\x07\x63onfigs\x18\x01 \x03(\x0b\x32M.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ConfigsEntry\x1a\xf9\x01\n\x0bSliceConfig\x12W\n\x05value\x18\x01 \x01(\x0b\x32\x46.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ValueH\x00\x12W\n\x05range\x18\x02 \x01(\x0b\x32\x46.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.RangeH\x00\x12\x30\n\nall_values\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.BoolValueH\x00\x42\x06\n\x04kind\x1a\"\n\x05Range\x12\x0b\n\x03low\x18\x01 \x01(\x02\x12\x0c\n\x04high\x18\x02 \x01(\x02\x1a>\n\x05Value\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x42\x06\n\x04kind\x1a|\n\x0c\x43onfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12[\n\x05value\x18\x02 \x01(\x0b\x32L.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig:\x02\x38\x01:\x94\x01\xea\x41\x90\x01\n.aiplatform.googleapis.com/ModelEvaluationSlice\x12^projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}B\xd7\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x19ModelEvaluationSliceProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.ModelExplanation", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.protobuf.BoolValue", "google/protobuf/wrappers.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 + ModelEvaluationSlice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice").msgclass + ModelEvaluationSlice::Slice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice").msgclass + ModelEvaluationSlice::Slice::SliceSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec").msgclass + ModelEvaluationSlice::Slice::SliceSpec::SliceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig").msgclass + ModelEvaluationSlice::Slice::SliceSpec::Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range").msgclass + ModelEvaluationSlice::Slice::SliceSpec::Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb new file mode 100644 index 000000000000..91832996216e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_garden_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/publisher_model_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/model_garden_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\x30google/cloud/aiplatform/v1/publisher_model.proto\"\xfe\x01\n\x18GetPublisherModelRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/PublisherModel\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x04view\x18\x03 \x01(\x0e\x32..google.cloud.aiplatform.v1.PublisherModelViewB\x03\xe0\x41\x01\x12\"\n\x15is_hugging_face_model\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12hugging_face_token\x18\x06 \x01(\tB\x03\xe0\x41\x01*\xa1\x01\n\x12PublisherModelView\x12$\n PUBLISHER_MODEL_VIEW_UNSPECIFIED\x10\x00\x12\x1e\n\x1aPUBLISHER_MODEL_VIEW_BASIC\x10\x01\x12\x1d\n\x19PUBLISHER_MODEL_VIEW_FULL\x10\x02\x12&\n\"PUBLISHER_MODEL_VERSION_VIEW_BASIC\x10\x03\x32\x8c\x02\n\x12ModelGardenService\x12\xa6\x01\n\x11GetPublisherModel\x12\x34.google.cloud.aiplatform.v1.GetPublisherModelRequest\x1a*.google.cloud.aiplatform.v1.PublisherModel\"/\xda\x41\x04name\x82\xd3\xe4\x93\x02\"\x12 /v1/{name=publishers/*/models/*}\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17ModelGardenServiceProtoP\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 = [ + ] + 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 + GetPublisherModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetPublisherModelRequest").msgclass + PublisherModelView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModelView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb new file mode 100644 index 000000000000..fd254f4d4484 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/model_garden_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/model_garden_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ModelGardenService + # The interface of Model Garden Service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ModelGardenService' + + # Gets a Model Garden publisher model. + rpc :GetPublisherModel, ::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest, ::Google::Cloud::AIPlatform::V1::PublisherModel + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb new file mode 100644 index 000000000000..bd1fd5780a20 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_monitoring.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/io_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/model_monitoring.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x19google/api/resource.proto\x1a#google/cloud/aiplatform/v1/io.proto\"\xbf\x15\n\x1eModelMonitoringObjectiveConfig\x12\x64\n\x10training_dataset\x18\x01 \x01(\x0b\x32J.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingDataset\x12\x93\x01\n)training_prediction_skew_detection_config\x18\x02 \x01(\x0b\x32`.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingPredictionSkewDetectionConfig\x12\x84\x01\n!prediction_drift_detection_config\x18\x03 \x01(\x0b\x32Y.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.PredictionDriftDetectionConfig\x12h\n\x12\x65xplanation_config\x18\x05 \x01(\x0b\x32L.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig\x1a\xdb\x02\n\x0fTrainingDataset\x12\x39\n\x07\x64\x61taset\x18\x03 \x01(\tB&\xfa\x41#\n!aiplatform.googleapis.com/DatasetH\x00\x12;\n\ngcs_source\x18\x04 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceH\x00\x12\x45\n\x0f\x62igquery_source\x18\x05 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceH\x00\x12\x13\n\x0b\x64\x61ta_format\x18\x02 \x01(\t\x12\x14\n\x0ctarget_field\x18\x06 \x01(\t\x12O\n\x19logging_sampling_strategy\x18\x07 \x01(\x0b\x32,.google.cloud.aiplatform.v1.SamplingStrategyB\r\n\x0b\x64\x61ta_source\x1a\x8f\x05\n%TrainingPredictionSkewDetectionConfig\x12\x8d\x01\n\x0fskew_thresholds\x18\x01 \x03(\x0b\x32t.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingPredictionSkewDetectionConfig.SkewThresholdsEntry\x12\xb0\x01\n!attribution_score_skew_thresholds\x18\x02 \x03(\x0b\x32\x84\x01.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingPredictionSkewDetectionConfig.AttributionScoreSkewThresholdsEntry\x12K\n\x16\x64\x65\x66\x61ult_skew_threshold\x18\x06 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig\x1a\x62\n\x13SkewThresholdsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig:\x02\x38\x01\x1ar\n#AttributionScoreSkewThresholdsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig:\x02\x38\x01\x1a\x80\x05\n\x1ePredictionDriftDetectionConfig\x12\x88\x01\n\x10\x64rift_thresholds\x18\x01 \x03(\x0b\x32n.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.PredictionDriftDetectionConfig.DriftThresholdsEntry\x12\xaa\x01\n\"attribution_score_drift_thresholds\x18\x02 \x03(\x0b\x32~.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.PredictionDriftDetectionConfig.AttributionScoreDriftThresholdsEntry\x12L\n\x17\x64\x65\x66\x61ult_drift_threshold\x18\x05 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig\x1a\x63\n\x14\x44riftThresholdsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig:\x02\x38\x01\x1as\n$AttributionScoreDriftThresholdsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ThresholdConfig:\x02\x38\x01\x1a\xbc\x04\n\x11\x45xplanationConfig\x12!\n\x19\x65nable_feature_attributes\x18\x01 \x01(\x08\x12~\n\x14\x65xplanation_baseline\x18\x02 \x01(\x0b\x32`.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline\x1a\x83\x03\n\x13\x45xplanationBaseline\x12\x39\n\x03gcs\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationH\x00\x12\x43\n\x08\x62igquery\x18\x03 \x01(\x0b\x32/.google.cloud.aiplatform.v1.BigQueryDestinationH\x00\x12\x8c\x01\n\x11prediction_format\x18\x01 \x01(\x0e\x32q.google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline.PredictionFormat\"N\n\x10PredictionFormat\x12!\n\x1dPREDICTION_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05JSONL\x10\x02\x12\x0c\n\x08\x42IGQUERY\x10\x03\x42\r\n\x0b\x64\x65stination\"\xa0\x02\n\x1aModelMonitoringAlertConfig\x12\x65\n\x12\x65mail_alert_config\x18\x01 \x01(\x0b\x32G.google.cloud.aiplatform.v1.ModelMonitoringAlertConfig.EmailAlertConfigH\x00\x12\x16\n\x0e\x65nable_logging\x18\x02 \x01(\x08\x12Q\n\x15notification_channels\x18\x03 \x03(\tB2\xfa\x41/\n-monitoring.googleapis.com/NotificationChannel\x1a\'\n\x10\x45mailAlertConfig\x12\x13\n\x0buser_emails\x18\x01 \x03(\tB\x07\n\x05\x61lert\"/\n\x0fThresholdConfig\x12\x0f\n\x05value\x18\x01 \x01(\x01H\x00\x42\x0b\n\tthreshold\"\x9c\x01\n\x10SamplingStrategy\x12]\n\x14random_sample_config\x18\x01 \x01(\x0b\x32?.google.cloud.aiplatform.v1.SamplingStrategy.RandomSampleConfig\x1a)\n\x12RandomSampleConfig\x12\x13\n\x0bsample_rate\x18\x01 \x01(\x01\x42\xc4\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x14ModelMonitoringProtoP\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\x41o\n-monitoring.googleapis.com/NotificationChannel\x12>projects/{project}/notificationChannels/{notification_channel}b\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.GcsSource", "google/cloud/aiplatform/v1/io.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 + ModelMonitoringObjectiveConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig").msgclass + ModelMonitoringObjectiveConfig::TrainingDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingDataset").msgclass + ModelMonitoringObjectiveConfig::TrainingPredictionSkewDetectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.TrainingPredictionSkewDetectionConfig").msgclass + ModelMonitoringObjectiveConfig::PredictionDriftDetectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.PredictionDriftDetectionConfig").msgclass + ModelMonitoringObjectiveConfig::ExplanationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig").msgclass + ModelMonitoringObjectiveConfig::ExplanationConfig::ExplanationBaseline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline").msgclass + ModelMonitoringObjectiveConfig::ExplanationConfig::ExplanationBaseline::PredictionFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringObjectiveConfig.ExplanationConfig.ExplanationBaseline.PredictionFormat").enummodule + ModelMonitoringAlertConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringAlertConfig").msgclass + ModelMonitoringAlertConfig::EmailAlertConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelMonitoringAlertConfig.EmailAlertConfig").msgclass + ThresholdConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ThresholdConfig").msgclass + SamplingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SamplingStrategy").msgclass + SamplingStrategy::RandomSampleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SamplingStrategy.RandomSampleConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb new file mode 100644 index 000000000000..945387234e93 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/deployed_model_ref_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/env_var_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/model.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/aiplatform/v1/deployed_model_ref.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a(google/cloud/aiplatform/v1/env_var.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x15\n\x05Model\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\nversion_id\x18\x1c \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12\x17\n\x0fversion_aliases\x18\x1d \x03(\t\x12<\n\x13version_create_time\x18\x1f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13version_update_time\x18 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1b\n\x13version_description\x18\x1e \x01(\t\x12\x45\n\x10predict_schemata\x18\x04 \x01(\x0b\x32+.google.cloud.aiplatform.v1.PredictSchemata\x12 \n\x13metadata_schema_uri\x18\x05 \x01(\tB\x03\xe0\x41\x05\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x05\x12U\n\x18supported_export_formats\x18\x14 \x03(\x0b\x32..google.cloud.aiplatform.v1.Model.ExportFormatB\x03\xe0\x41\x03\x12M\n\x11training_pipeline\x18\x07 \x01(\tB2\xe0\x41\x03\xfa\x41,\n*aiplatform.googleapis.com/TrainingPipeline\x12\x43\n\x0cpipeline_job\x18/ \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\x12K\n\x0e\x63ontainer_spec\x18\t \x01(\x0b\x32..google.cloud.aiplatform.v1.ModelContainerSpecB\x03\xe0\x41\x04\x12\x19\n\x0c\x61rtifact_uri\x18\x1a \x01(\tB\x03\xe0\x41\x05\x12l\n$supported_deployment_resources_types\x18\n \x03(\x0e\x32\x39.google.cloud.aiplatform.v1.Model.DeploymentResourcesTypeB\x03\xe0\x41\x03\x12,\n\x1fsupported_input_storage_formats\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12-\n supported_output_storage_formats\x18\x0c \x03(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\x0f\x64\x65ployed_models\x18\x0f \x03(\x0b\x32,.google.cloud.aiplatform.v1.DeployedModelRefB\x03\xe0\x41\x03\x12\x45\n\x10\x65xplanation_spec\x18\x17 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ExplanationSpec\x12\x0c\n\x04\x65tag\x18\x10 \x01(\t\x12=\n\x06labels\x18\x11 \x03(\x0b\x32-.google.cloud.aiplatform.v1.Model.LabelsEntry\x12?\n\ndata_stats\x18\x15 \x01(\x0b\x32+.google.cloud.aiplatform.v1.Model.DataStats\x12\x43\n\x0f\x65ncryption_spec\x18\x18 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12K\n\x11model_source_info\x18& \x01(\x0b\x32+.google.cloud.aiplatform.v1.ModelSourceInfoB\x03\xe0\x41\x03\x12U\n\x13original_model_info\x18\" \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.Model.OriginalModelInfoB\x03\xe0\x41\x03\x12\x1e\n\x11metadata_artifact\x18, \x01(\tB\x03\xe0\x41\x03\x12Q\n\x11\x62\x61se_model_source\x18\x32 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.Model.BaseModelSourceB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x33 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x34 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xd5\x01\n\x0c\x45xportFormat\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x62\n\x13\x65xportable_contents\x18\x02 \x03(\x0e\x32@.google.cloud.aiplatform.v1.Model.ExportFormat.ExportableContentB\x03\xe0\x41\x03\"P\n\x11\x45xportableContent\x12\"\n\x1e\x45XPORTABLE_CONTENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41RTIFACT\x10\x01\x12\t\n\x05IMAGE\x10\x02\x1a\xdc\x01\n\tDataStats\x12!\n\x19training_data_items_count\x18\x01 \x01(\x03\x12#\n\x1bvalidation_data_items_count\x18\x02 \x01(\x03\x12\x1d\n\x15test_data_items_count\x18\x03 \x01(\x03\x12\"\n\x1atraining_annotations_count\x18\x04 \x01(\x03\x12$\n\x1cvalidation_annotations_count\x18\x05 \x01(\x03\x12\x1e\n\x16test_annotations_count\x18\x06 \x01(\x03\x1aK\n\x11OriginalModelInfo\x12\x36\n\x05model\x18\x01 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x1a\xaa\x01\n\x0f\x42\x61seModelSource\x12L\n\x13model_garden_source\x18\x01 \x01(\x0b\x32-.google.cloud.aiplatform.v1.ModelGardenSourceH\x00\x12?\n\x0cgenie_source\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.GenieSourceH\x00\x42\x08\n\x06source\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8c\x01\n\x17\x44\x65ploymentResourcesType\x12)\n%DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x45\x44ICATED_RESOURCES\x10\x01\x12\x17\n\x13\x41UTOMATIC_RESOURCES\x10\x02\x12\x14\n\x10SHARED_RESOURCES\x10\x03:\\\xea\x41Y\n\x1f\x61iplatform.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\"(\n\x13LargeModelReference\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x11ModelGardenSource\x12\x1e\n\x11public_model_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"*\n\x0bGenieSource\x12\x1b\n\x0e\x62\x61se_model_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"{\n\x0fPredictSchemata\x12 \n\x13instance_schema_uri\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\"\n\x15parameters_schema_uri\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\"\n\x15prediction_schema_uri\x18\x03 \x01(\tB\x03\xe0\x41\x05\"\x93\x04\n\x12ModelContainerSpec\x12\x19\n\timage_uri\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x14\n\x07\x63ommand\x18\x02 \x03(\tB\x03\xe0\x41\x05\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x05\x12\x34\n\x03\x65nv\x18\x04 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVarB\x03\xe0\x41\x05\x12\x34\n\x05ports\x18\x05 \x03(\x0b\x32 .google.cloud.aiplatform.v1.PortB\x03\xe0\x41\x05\x12\x1a\n\rpredict_route\x18\x06 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0chealth_route\x18\x07 \x01(\tB\x03\xe0\x41\x05\x12\x39\n\ngrpc_ports\x18\t \x03(\x0b\x32 .google.cloud.aiplatform.v1.PortB\x03\xe0\x41\x05\x12:\n\x12\x64\x65ployment_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x05\x12\"\n\x15shared_memory_size_mb\x18\x0b \x01(\x03\x42\x03\xe0\x41\x05\x12=\n\rstartup_probe\x18\x0c \x01(\x0b\x32!.google.cloud.aiplatform.v1.ProbeB\x03\xe0\x41\x05\x12<\n\x0chealth_probe\x18\r \x01(\x0b\x32!.google.cloud.aiplatform.v1.ProbeB\x03\xe0\x41\x05\"\x1e\n\x04Port\x12\x16\n\x0e\x63ontainer_port\x18\x03 \x01(\x05\"\x93\x02\n\x0fModelSourceInfo\x12P\n\x0bsource_type\x18\x01 \x01(\x0e\x32;.google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType\x12\x0c\n\x04\x63opy\x18\x02 \x01(\x08\"\x9f\x01\n\x0fModelSourceType\x12!\n\x1dMODEL_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41UTOML\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\x08\n\x04\x42QML\x10\x03\x12\x10\n\x0cMODEL_GARDEN\x10\x04\x12\t\n\x05GENIE\x10\x05\x12\x19\n\x15\x43USTOM_TEXT_EMBEDDING\x10\x06\x12\x0f\n\x0bMARKETPLACE\x10\x07\"\xa3\x01\n\x05Probe\x12<\n\x04\x65xec\x18\x01 \x01(\x0b\x32,.google.cloud.aiplatform.v1.Probe.ExecActionH\x00\x12\x16\n\x0eperiod_seconds\x18\x02 \x01(\x05\x12\x17\n\x0ftimeout_seconds\x18\x03 \x01(\x05\x1a\x1d\n\nExecAction\x12\x0f\n\x07\x63ommand\x18\x01 \x03(\tB\x0c\n\nprobe_typeB\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nModelProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.DeployedModelRef", "google/cloud/aiplatform/v1/deployed_model_ref.proto"], + ["google.cloud.aiplatform.v1.ExplanationSpec", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.EnvVar", "google/cloud/aiplatform/v1/env_var.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 + Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model").msgclass + Model::ExportFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.ExportFormat").msgclass + Model::ExportFormat::ExportableContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.ExportFormat.ExportableContent").enummodule + Model::DataStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.DataStats").msgclass + Model::OriginalModelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.OriginalModelInfo").msgclass + Model::BaseModelSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.BaseModelSource").msgclass + Model::DeploymentResourcesType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Model.DeploymentResourcesType").enummodule + LargeModelReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LargeModelReference").msgclass + ModelGardenSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelGardenSource").msgclass + GenieSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenieSource").msgclass + PredictSchemata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PredictSchemata").msgclass + ModelContainerSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelContainerSpec").msgclass + Port = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Port").msgclass + ModelSourceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelSourceInfo").msgclass + ModelSourceInfo::ModelSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType").enummodule + Probe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Probe").msgclass + Probe::ExecAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Probe.ExecAction").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_pb.rb new file mode 100644 index 000000000000..6d27d51d384c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_pb.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/model_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/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/evaluated_annotation_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/model_pb' +require 'google/cloud/aiplatform/v1/model_evaluation_pb' +require 'google/cloud/aiplatform/v1/model_evaluation_slice_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google/cloud/aiplatform/v1/model_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\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a\x35google/cloud/aiplatform/v1/evaluated_annotation.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a&google/cloud/aiplatform/v1/model.proto\x1a\x31google/cloud/aiplatform/v1/model_evaluation.proto\x1a\x37google/cloud/aiplatform/v1/model_evaluation_slice.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xd6\x01\n\x12UploadModelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0cparent_model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08model_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x05model\x18\x02 \x01(\x0b\x32!.google.cloud.aiplatform.v1.ModelB\x03\xe0\x41\x02\x12\x1c\n\x0fservice_account\x18\x06 \x01(\tB\x03\xe0\x41\x01\"n\n\x1cUploadModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"i\n\x13UploadModelResponse\x12\x33\n\x05model\x18\x01 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\"H\n\x0fGetModelRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\"\xc6\x01\n\x11ListModelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"`\n\x12ListModelsResponse\x12\x31\n\x06models\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc9\x01\n\x18ListModelVersionsRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x10\n\x08order_by\x18\x06 \x01(\t\"g\n\x19ListModelVersionsResponse\x12\x31\n\x06models\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x81\x01\n\x12UpdateModelRequest\x12\x35\n\x05model\x18\x01 \x01(\x0b\x32!.google.cloud.aiplatform.v1.ModelB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x91\x01\n\x1fUpdateExplanationDatasetRequest\x12\x36\n\x05model\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x36\n\x08\x65xamples\x18\x02 \x01(\x0b\x32$.google.cloud.aiplatform.v1.Examples\"{\n)UpdateExplanationDatasetOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"K\n\x12\x44\x65leteModelRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\"R\n\x19\x44\x65leteModelVersionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\"q\n\x1aMergeVersionAliasesRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1c\n\x0fversion_aliases\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xee\x02\n\x12\x45xportModelRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12W\n\routput_config\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.ExportModelRequest.OutputConfigB\x03\xe0\x41\x02\x1a\xc7\x01\n\x0cOutputConfig\x12\x18\n\x10\x65xport_format_id\x18\x01 \x01(\t\x12H\n\x14\x61rtifact_destination\x18\x03 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestination\x12S\n\x11image_destination\x18\x04 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.ContainerRegistryDestination\"\x9c\x02\n\x1c\x45xportModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12]\n\x0boutput_info\x18\x02 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.ExportModelOperationMetadata.OutputInfoB\x03\xe0\x41\x03\x1aM\n\nOutputInfo\x12 \n\x13\x61rtifact_output_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10image_output_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\"\n UpdateExplanationDatasetResponse\"\x15\n\x13\x45xportModelResponse\"\xc0\x02\n\x10\x43opyModelRequest\x12\x17\n\x08model_id\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x00\x12?\n\x0cparent_model\x18\x05 \x01(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x61iplatform.googleapis.com/ModelH\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12=\n\x0csource_model\x18\x02 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x43\n\x0f\x65ncryption_spec\x18\x03 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x13\n\x11\x64\x65stination_model\"l\n\x1a\x43opyModelOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"g\n\x11\x43opyModelResponse\x12\x33\n\x05model\x18\x01 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xa3\x01\n\x1cImportModelEvaluationRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12J\n\x10model_evaluation\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ModelEvaluationB\x03\xe0\x41\x02\"\xc4\x01\n\'BatchImportModelEvaluationSlicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ModelEvaluation\x12V\n\x17model_evaluation_slices\x18\x02 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.ModelEvaluationSliceB\x03\xe0\x41\x02\"Y\n(BatchImportModelEvaluationSlicesResponse\x12-\n imported_model_evaluation_slices\x18\x01 \x03(\tB\x03\xe0\x41\x03\"\xc5\x01\n&BatchImportEvaluatedAnnotationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.aiplatform.googleapis.com/ModelEvaluationSlice\x12S\n\x15\x65valuated_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.aiplatform.v1.EvaluatedAnnotationB\x03\xe0\x41\x02\"\\\n\'BatchImportEvaluatedAnnotationsResponse\x12\x31\n$imported_evaluated_annotations_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\"\\\n\x19GetModelEvaluationRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ModelEvaluation\"\xbc\x01\n\x1bListModelEvaluationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x7f\n\x1cListModelEvaluationsResponse\x12\x46\n\x11model_evaluations\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.ModelEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"f\n\x1eGetModelEvaluationSliceRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.aiplatform.googleapis.com/ModelEvaluationSlice\"\xcb\x01\n ListModelEvaluationSlicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ModelEvaluation\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8f\x01\n!ListModelEvaluationSlicesResponse\x12Q\n\x17model_evaluation_slices\x18\x01 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.ModelEvaluationSlice\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x9d \n\x0cModelService\x12\xe0\x01\n\x0bUploadModel\x12..google.cloud.aiplatform.v1.UploadModelRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x33\n\x13UploadModelResponse\x12\x1cUploadModelOperationMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02\x36\"1/v1/{parent=projects/*/locations/*}/models:upload:\x01*\x12\x95\x01\n\x08GetModel\x12+.google.cloud.aiplatform.v1.GetModelRequest\x1a!.google.cloud.aiplatform.v1.Model\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/models/*}\x12\xa8\x01\n\nListModels\x12-.google.cloud.aiplatform.v1.ListModelsRequest\x1a..google.cloud.aiplatform.v1.ListModelsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/models\x12\xc8\x01\n\x11ListModelVersions\x12\x34.google.cloud.aiplatform.v1.ListModelVersionsRequest\x1a\x35.google.cloud.aiplatform.v1.ListModelVersionsResponse\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/models/*}:listVersions\x12\xb5\x01\n\x0bUpdateModel\x12..google.cloud.aiplatform.v1.UpdateModelRequest\x1a!.google.cloud.aiplatform.v1.Model\"S\xda\x41\x11model,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{model.name=projects/*/locations/*/models/*}:\x05model\x12\xa0\x02\n\x18UpdateExplanationDataset\x12;.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest\x1a\x1d.google.longrunning.Operation\"\xa7\x01\xca\x41M\n UpdateExplanationDatasetResponse\x12)UpdateExplanationDatasetOperationMetadata\xda\x41\x05model\x82\xd3\xe4\x93\x02I\"D/v1/{model=projects/*/locations/*/models/*}:updateExplanationDataset:\x01*\x12\xca\x01\n\x0b\x44\x65leteModel\x12..google.cloud.aiplatform.v1.DeleteModelRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/models/*}\x12\xe6\x01\n\x12\x44\x65leteModelVersion\x12\x35.google.cloud.aiplatform.v1.DeleteModelVersionRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/models/*}:deleteVersion\x12\xd2\x01\n\x13MergeVersionAliases\x12\x36.google.cloud.aiplatform.v1.MergeVersionAliasesRequest\x1a!.google.cloud.aiplatform.v1.Model\"`\xda\x41\x14name,version_aliases\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/models/*}:mergeVersionAliases:\x01*\x12\xe6\x01\n\x0b\x45xportModel\x12..google.cloud.aiplatform.v1.ExportModelRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x33\n\x13\x45xportModelResponse\x12\x1c\x45xportModelOperationMetadata\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/models/*}:export:\x01*\x12\xdd\x01\n\tCopyModel\x12,.google.cloud.aiplatform.v1.CopyModelRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41/\n\x11\x43opyModelResponse\x12\x1a\x43opyModelOperationMetadata\xda\x41\x13parent,source_model\x82\xd3\xe4\x93\x02\x34\"//v1/{parent=projects/*/locations/*}/models:copy:\x01*\x12\xe4\x01\n\x15ImportModelEvaluation\x12\x38.google.cloud.aiplatform.v1.ImportModelEvaluationRequest\x1a+.google.cloud.aiplatform.v1.ModelEvaluation\"d\xda\x41\x17parent,model_evaluation\x82\xd3\xe4\x93\x02\x44\"?/v1/{parent=projects/*/locations/*/models/*}/evaluations:import:\x01*\x12\xa8\x02\n BatchImportModelEvaluationSlices\x12\x43.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest\x1a\x44.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse\"y\xda\x41\x1eparent,model_evaluation_slices\x82\xd3\xe4\x93\x02R\"M/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices:batchImport:\x01*\x12\xa5\x02\n\x1f\x42\x61tchImportEvaluatedAnnotations\x12\x42.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest\x1a\x43.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse\"y\xda\x41\x1cparent,evaluated_annotations\x82\xd3\xe4\x93\x02T\"O/v1/{parent=projects/*/locations/*/models/*/evaluations/*/slices/*}:batchImport:\x01*\x12\xc1\x01\n\x12GetModelEvaluation\x12\x35.google.cloud.aiplatform.v1.GetModelEvaluationRequest\x1a+.google.cloud.aiplatform.v1.ModelEvaluation\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/models/*/evaluations/*}\x12\xd4\x01\n\x14ListModelEvaluations\x12\x37.google.cloud.aiplatform.v1.ListModelEvaluationsRequest\x1a\x38.google.cloud.aiplatform.v1.ListModelEvaluationsResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/models/*}/evaluations\x12\xd9\x01\n\x17GetModelEvaluationSlice\x12:.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest\x1a\x30.google.cloud.aiplatform.v1.ModelEvaluationSlice\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}\x12\xec\x01\n\x19ListModelEvaluationSlices\x12<.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest\x1a=.google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11ModelServiceProtoP\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.Model", "google/cloud/aiplatform/v1/model.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.Examples", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.cloud.aiplatform.v1.GcsDestination", "google/cloud/aiplatform/v1/io.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.ModelEvaluation", "google/cloud/aiplatform/v1/model_evaluation.proto"], + ["google.cloud.aiplatform.v1.ModelEvaluationSlice", "google/cloud/aiplatform/v1/model_evaluation_slice.proto"], + ["google.cloud.aiplatform.v1.EvaluatedAnnotation", "google/cloud/aiplatform/v1/evaluated_annotation.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 + UploadModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadModelRequest").msgclass + UploadModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadModelOperationMetadata").msgclass + UploadModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadModelResponse").msgclass + GetModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetModelRequest").msgclass + ListModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelsRequest").msgclass + ListModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelsResponse").msgclass + ListModelVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelVersionsRequest").msgclass + ListModelVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelVersionsResponse").msgclass + UpdateModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateModelRequest").msgclass + UpdateExplanationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest").msgclass + UpdateExplanationDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata").msgclass + DeleteModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteModelRequest").msgclass + DeleteModelVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteModelVersionRequest").msgclass + MergeVersionAliasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.MergeVersionAliasesRequest").msgclass + ExportModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportModelRequest").msgclass + ExportModelRequest::OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig").msgclass + ExportModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportModelOperationMetadata").msgclass + ExportModelOperationMetadata::OutputInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportModelOperationMetadata.OutputInfo").msgclass + UpdateExplanationDatasetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse").msgclass + ExportModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportModelResponse").msgclass + CopyModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CopyModelRequest").msgclass + CopyModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CopyModelOperationMetadata").msgclass + CopyModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CopyModelResponse").msgclass + ImportModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportModelEvaluationRequest").msgclass + BatchImportModelEvaluationSlicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest").msgclass + BatchImportModelEvaluationSlicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse").msgclass + BatchImportEvaluatedAnnotationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest").msgclass + BatchImportEvaluatedAnnotationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse").msgclass + GetModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetModelEvaluationRequest").msgclass + ListModelEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelEvaluationsRequest").msgclass + ListModelEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelEvaluationsResponse").msgclass + GetModelEvaluationSliceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest").msgclass + ListModelEvaluationSlicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest").msgclass + ListModelEvaluationSlicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb new file mode 100644 index 000000000000..e665a02b2522 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb @@ -0,0 +1,100 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/model_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/model_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ModelService + # A service for managing Vertex AI's machine learning Models. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ModelService' + + # Uploads a Model artifact into Vertex AI. + rpc :UploadModel, ::Google::Cloud::AIPlatform::V1::UploadModelRequest, ::Google::Longrunning::Operation + # Gets a Model. + rpc :GetModel, ::Google::Cloud::AIPlatform::V1::GetModelRequest, ::Google::Cloud::AIPlatform::V1::Model + # Lists Models in a Location. + rpc :ListModels, ::Google::Cloud::AIPlatform::V1::ListModelsRequest, ::Google::Cloud::AIPlatform::V1::ListModelsResponse + # Lists versions of the specified model. + rpc :ListModelVersions, ::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest, ::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse + # Updates a Model. + rpc :UpdateModel, ::Google::Cloud::AIPlatform::V1::UpdateModelRequest, ::Google::Cloud::AIPlatform::V1::Model + # Incrementally update the dataset used for an examples model. + rpc :UpdateExplanationDataset, ::Google::Cloud::AIPlatform::V1::UpdateExplanationDatasetRequest, ::Google::Longrunning::Operation + # Deletes a Model. + # + # A model cannot be deleted if any + # [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a + # [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the + # model in its + # [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] + # field. + rpc :DeleteModel, ::Google::Cloud::AIPlatform::V1::DeleteModelRequest, ::Google::Longrunning::Operation + # Deletes a Model version. + # + # Model version can only be deleted if there are no + # [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it. + # Deleting the only version in the Model is not allowed. Use + # [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for + # deleting the Model instead. + rpc :DeleteModelVersion, ::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest, ::Google::Longrunning::Operation + # Merges a set of aliases for a Model version. + rpc :MergeVersionAliases, ::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest, ::Google::Cloud::AIPlatform::V1::Model + # Exports a trained, exportable Model to a location specified by the + # user. A Model is considered to be exportable if it has at least one + # [supported export + # format][google.cloud.aiplatform.v1.Model.supported_export_formats]. + rpc :ExportModel, ::Google::Cloud::AIPlatform::V1::ExportModelRequest, ::Google::Longrunning::Operation + # Copies an already existing Vertex AI Model into the specified Location. + # The source Model must exist in the same Project. + # When copying custom Models, the users themselves are responsible for + # [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be + # region-agnostic, as well as making sure that any resources (e.g. files) it + # depends on remain accessible. + rpc :CopyModel, ::Google::Cloud::AIPlatform::V1::CopyModelRequest, ::Google::Longrunning::Operation + # Imports an externally generated ModelEvaluation. + rpc :ImportModelEvaluation, ::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest, ::Google::Cloud::AIPlatform::V1::ModelEvaluation + # Imports a list of externally generated ModelEvaluationSlice. + rpc :BatchImportModelEvaluationSlices, ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest, ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse + # Imports a list of externally generated EvaluatedAnnotations. + rpc :BatchImportEvaluatedAnnotations, ::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsRequest, ::Google::Cloud::AIPlatform::V1::BatchImportEvaluatedAnnotationsResponse + # Gets a ModelEvaluation. + rpc :GetModelEvaluation, ::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest, ::Google::Cloud::AIPlatform::V1::ModelEvaluation + # Lists ModelEvaluations in a Model. + rpc :ListModelEvaluations, ::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest, ::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse + # Gets a ModelEvaluationSlice. + rpc :GetModelEvaluationSlice, ::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest, ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice + # Lists ModelEvaluationSlices in a ModelEvaluation. + rpc :ListModelEvaluationSlices, ::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest, ::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/nas_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/nas_job_pb.rb new file mode 100644 index 000000000000..03af7b7d6e74 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/nas_job_pb.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/nas_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/custom_job_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/study_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/nas_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/aiplatform/v1/custom_job.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a&google/cloud/aiplatform/v1/study.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf5\x06\n\x06NasJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0cnas_job_spec\x18\x04 \x01(\x0b\x32&.google.cloud.aiplatform.v1.NasJobSpecB\x03\xe0\x41\x02\x12\x45\n\x0enas_job_output\x18\x05 \x01(\x0b\x32(.google.cloud.aiplatform.v1.NasJobOutputB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\x06 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x0c \x03(\x0b\x32..google.cloud.aiplatform.v1.NasJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\r \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12/\n enable_restricted_image_training\x18\x0e \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:`\xea\x41]\n aiplatform.googleapis.com/NasJob\x12\x39projects/{project}/locations/{location}/nasJobs/{nas_job}\"\xbd\x02\n\x0eNasTrialDetail\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\nparameters\x18\x02 \x01(\t\x12:\n\x0csearch_trial\x18\x03 \x01(\x0b\x32$.google.cloud.aiplatform.v1.NasTrial\x12\x39\n\x0btrain_trial\x18\x04 \x01(\x0b\x32$.google.cloud.aiplatform.v1.NasTrial:\x8c\x01\xea\x41\x88\x01\n(aiplatform.googleapis.com/NasTrialDetail\x12\\projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}\"\xa5\n\n\nNasJobSpec\x12\x64\n\x1amulti_trial_algorithm_spec\x18\x02 \x01(\x0b\x32>.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpecH\x00\x12\x19\n\x11resume_nas_job_id\x18\x03 \x01(\t\x12\x19\n\x11search_space_spec\x18\x01 \x01(\t\x1a\xe4\x08\n\x17MultiTrialAlgorithmSpec\x12q\n\x15multi_trial_algorithm\x18\x01 \x01(\x0e\x32R.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm\x12Y\n\x06metric\x18\x02 \x01(\x0b\x32I.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec\x12n\n\x11search_trial_spec\x18\x03 \x01(\x0b\x32N.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpecB\x03\xe0\x41\x02\x12g\n\x10train_trial_spec\x18\x04 \x01(\x0b\x32M.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec\x1a\xce\x01\n\nMetricSpec\x12\x16\n\tmetric_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x04goal\x18\x02 \x01(\x0e\x32R.google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec.GoalTypeB\x03\xe0\x41\x02\"A\n\x08GoalType\x12\x19\n\x15GOAL_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08MAXIMIZE\x10\x01\x12\x0c\n\x08MINIMIZE\x10\x02\x1a\xc5\x01\n\x0fSearchTrialSpec\x12M\n\x15search_trial_job_spec\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12\x1c\n\x0fmax_trial_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12%\n\x18max_parallel_trial_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x16max_failed_trial_count\x18\x04 \x01(\x05\x1a\x9d\x01\n\x0eTrainTrialSpec\x12L\n\x14train_trial_job_spec\x18\x01 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12%\n\x18max_parallel_trial_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tfrequency\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"i\n\x13MultiTrialAlgorithm\x12%\n!MULTI_TRIAL_ALGORITHM_UNSPECIFIED\x10\x00\x12\x1a\n\x16REINFORCEMENT_LEARNING\x10\x01\x12\x0f\n\x0bGRID_SEARCH\x10\x02\x42\x14\n\x12nas_algorithm_spec\"\x98\x02\n\x0cNasJobOutput\x12\x63\n\x16multi_trial_job_output\x18\x01 \x01(\x0b\x32<.google.cloud.aiplatform.v1.NasJobOutput.MultiTrialJobOutputB\x03\xe0\x41\x03H\x00\x1a\x98\x01\n\x13MultiTrialJobOutput\x12@\n\rsearch_trials\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.NasTrialB\x03\xe0\x41\x03\x12?\n\x0ctrain_trials\x18\x02 \x03(\x0b\x32$.google.cloud.aiplatform.v1.NasTrialB\x03\xe0\x41\x03\x42\x08\n\x06output\"\xf4\x02\n\x08NasTrial\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12>\n\x05state\x18\x02 \x01(\x0e\x32*.google.cloud.aiplatform.v1.NasTrial.StateB\x03\xe0\x41\x03\x12G\n\x11\x66inal_measurement\x18\x03 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MeasurementB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tREQUESTED\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\x0e\n\nINFEASIBLE\x10\x05\x42\xc9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0bNasJobProtoP\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.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.CustomJobSpec", "google/cloud/aiplatform/v1/custom_job.proto"], + ["google.cloud.aiplatform.v1.Measurement", "google/cloud/aiplatform/v1/study.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 + NasJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJob").msgclass + NasTrialDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasTrialDetail").msgclass + NasJobSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec").msgclass + NasJobSpec::MultiTrialAlgorithmSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec").msgclass + NasJobSpec::MultiTrialAlgorithmSpec::MetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec").msgclass + NasJobSpec::MultiTrialAlgorithmSpec::MetricSpec::GoalType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MetricSpec.GoalType").enummodule + NasJobSpec::MultiTrialAlgorithmSpec::SearchTrialSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.SearchTrialSpec").msgclass + NasJobSpec::MultiTrialAlgorithmSpec::TrainTrialSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.TrainTrialSpec").msgclass + NasJobSpec::MultiTrialAlgorithmSpec::MultiTrialAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobSpec.MultiTrialAlgorithmSpec.MultiTrialAlgorithm").enummodule + NasJobOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobOutput").msgclass + NasJobOutput::MultiTrialJobOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasJobOutput.MultiTrialJobOutput").msgclass + NasTrial = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasTrial").msgclass + NasTrial::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NasTrial.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/network_spec_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/network_spec_pb.rb new file mode 100644 index 000000000000..9e1b6463ca07 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/network_spec_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/network_spec.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n-google/cloud/aiplatform/v1/network_spec.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x19google/api/resource.proto\"\x9f\x01\n\x0bNetworkSpec\x12\x1e\n\x16\x65nable_internet_access\x18\x01 \x01(\x08\x12\x34\n\x07network\x18\x02 \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12:\n\nsubnetwork\x18\x03 \x01(\tB&\xfa\x41#\n!compute.googleapis.com/SubnetworkB\xb2\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x10NetworkSpecProtoP\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\x61\n!compute.googleapis.com/Subnetwork\x12cloud.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 = [ + ] + 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 + NotebookEucConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookEucConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb new file mode 100644 index 000000000000..dd867e3d4431 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/notebook_execution_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/network_spec_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n7google/cloud/aiplatform/v1/notebook_execution_job.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/job_state.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a-google/cloud/aiplatform/v1/network_spec.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x83\x10\n\x14NotebookExecutionJob\x12o\n\x1a\x64\x61taform_repository_source\x18\x03 \x01(\x0b\x32I.google.cloud.aiplatform.v1.NotebookExecutionJob.DataformRepositorySourceH\x00\x12\x61\n\x13gcs_notebook_source\x18\x04 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.NotebookExecutionJob.GcsNotebookSourceH\x00\x12g\n\x16\x64irect_notebook_source\x18\x11 \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.NotebookExecutionJob.DirectNotebookSourceH\x00\x12i\n\'notebook_runtime_template_resource_name\x18\x0e \x01(\tB6\xfa\x41\x33\n1aiplatform.googleapis.com/NotebookRuntimeTemplateH\x01\x12i\n\x17\x63ustom_environment_spec\x18\x10 \x01(\x0b\x32\x46.google.cloud.aiplatform.v1.NotebookExecutionJob.CustomEnvironmentSpecH\x01\x12\x18\n\x0egcs_output_uri\x18\x08 \x01(\tH\x02\x12\x18\n\x0e\x65xecution_user\x18\t \x01(\tH\x03\x12\x19\n\x0fservice_account\x18\x12 \x01(\tH\x03\x12^\n\x11workbench_runtime\x18\x17 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntimeH\x04\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x34\n\x11\x65xecution_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12J\n\x16schedule_resource_name\x18\x06 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"aiplatform.googleapis.com/Schedule\x12<\n\tjob_state\x18\n \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12L\n\x06labels\x18\x13 \x03(\x0b\x32<.google.cloud.aiplatform.v1.NotebookExecutionJob.LabelsEntry\x12\x13\n\x0bkernel_name\x18\x14 \x01(\t\x12\x43\n\x0f\x65ncryption_spec\x18\x16 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x1aY\n\x18\x44\x61taformRepositorySource\x12)\n!dataform_repository_resource_name\x18\x01 \x01(\t\x12\x12\n\ncommit_sha\x18\x02 \x01(\t\x1a\x34\n\x11GcsNotebookSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x12\n\ngeneration\x18\x02 \x01(\t\x1a\'\n\x14\x44irectNotebookSource\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x1a\xe3\x01\n\x15\x43ustomEnvironmentSpec\x12=\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpec\x12L\n\x14persistent_disk_spec\x18\x02 \x01(\x0b\x32..google.cloud.aiplatform.v1.PersistentDiskSpec\x12=\n\x0cnetwork_spec\x18\x03 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.NetworkSpec\x1a\x12\n\x10WorkbenchRuntime\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb9\x01\xea\x41\xb5\x01\n.aiplatform.googleapis.com/NotebookExecutionJob\x12Vprojects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}*\x15notebookExecutionJobs2\x14notebookExecutionJobB\x11\n\x0fnotebook_sourceB\x12\n\x10\x65nvironment_specB\x10\n\x0e\x65xecution_sinkB\x14\n\x12\x65xecution_identityB\x15\n\x13runtime_environmentB\xd7\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x19NotebookExecutionJobProtoP\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.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.MachineSpec", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.NetworkSpec", "google/cloud/aiplatform/v1/network_spec.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 + NotebookExecutionJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob").msgclass + NotebookExecutionJob::DataformRepositorySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob.DataformRepositorySource").msgclass + NotebookExecutionJob::GcsNotebookSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob.GcsNotebookSource").msgclass + NotebookExecutionJob::DirectNotebookSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob.DirectNotebookSource").msgclass + NotebookExecutionJob::CustomEnvironmentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob.CustomEnvironmentSpec").msgclass + NotebookExecutionJob::WorkbenchRuntime = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb new file mode 100644 index 000000000000..4b0491812623 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n>google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\"r\n\x1aNotebookIdleShutdownConfig\x12\x34\n\x0cidle_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x1e\n\x16idle_shutdown_disabled\x18\x02 \x01(\x08\x42\xdd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1fNotebookIdleShutdownConfigProtoP\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.Duration", "google/protobuf/duration.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 + NotebookIdleShutdownConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookIdleShutdownConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb new file mode 100644 index 000000000000..38e2358f6c30 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/notebook_runtime.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/network_spec_pb' +require 'google/cloud/aiplatform/v1/notebook_euc_config_pb' +require 'google/cloud/aiplatform/v1/notebook_idle_shutdown_config_pb' +require 'google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/notebook_runtime.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\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a-google/cloud/aiplatform/v1/network_spec.proto\x1a\x34google/cloud/aiplatform/v1/notebook_euc_config.proto\x1a>google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto\x1a>google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa1\t\n\x17NotebookRuntimeTemplate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x17\n\nis_default\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x45\n\x0cmachine_spec\x18\x05 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x01\xe0\x41\x05\x12V\n\x19\x64\x61ta_persistent_disk_spec\x18\x08 \x01(\x0b\x32..google.cloud.aiplatform.v1.PersistentDiskSpecB\x03\xe0\x41\x01\x12\x42\n\x0cnetwork_spec\x18\x0c \x01(\x0b\x32\'.google.cloud.aiplatform.v1.NetworkSpecB\x03\xe0\x41\x01\x12\x17\n\x0fservice_account\x18\r \x01(\t\x12\x0c\n\x04\x65tag\x18\x0e \x01(\t\x12O\n\x06labels\x18\x0f \x03(\x0b\x32?.google.cloud.aiplatform.v1.NotebookRuntimeTemplate.LabelsEntry\x12T\n\x14idle_shutdown_config\x18\x11 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig\x12\x41\n\neuc_config\x18\x12 \x01(\x0b\x32-.google.cloud.aiplatform.v1.NotebookEucConfig\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x15notebook_runtime_type\x18\x13 \x01(\x0e\x32/.google.cloud.aiplatform.v1.NotebookRuntimeTypeB\x06\xe0\x41\x01\xe0\x41\x05\x12P\n\x12shielded_vm_config\x18\x14 \x01(\x0b\x32,.google.cloud.aiplatform.v1.ShieldedVmConfigB\x06\xe0\x41\x01\xe0\x41\x05\x12\x19\n\x0cnetwork_tags\x18\x15 \x03(\tB\x03\xe0\x41\x01\x12\x43\n\x0f\x65ncryption_spec\x18\x17 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x95\x01\xea\x41\x91\x01\n1aiplatform.googleapis.com/NotebookRuntimeTemplate\x12\\projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}\"\xb2\x0b\n\x0fNotebookRuntime\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cruntime_user\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x62\n\x1dnotebook_runtime_template_ref\x18\x03 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.NotebookRuntimeTemplateRefB\x03\xe0\x41\x03\x12\x16\n\tproxy_uri\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x0chealth_state\x18\x08 \x01(\x0e\x32\x37.google.cloud.aiplatform.v1.NotebookRuntime.HealthStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\x12\x1c\n\x0fservice_account\x18\r \x01(\tB\x03\xe0\x41\x03\x12T\n\rruntime_state\x18\x0e \x01(\x0e\x32\x38.google.cloud.aiplatform.v1.NotebookRuntime.RuntimeStateB\x03\xe0\x41\x03\x12\x1a\n\ris_upgradable\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12G\n\x06labels\x18\x10 \x03(\x0b\x32\x37.google.cloud.aiplatform.v1.NotebookRuntime.LabelsEntry\x12\x38\n\x0f\x65xpiration_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x12 \x01(\tB\x03\xe0\x41\x03\x12S\n\x15notebook_runtime_type\x18\x13 \x01(\x0e\x32/.google.cloud.aiplatform.v1.NotebookRuntimeTypeB\x03\xe0\x41\x03\x12Y\n\x14idle_shutdown_config\x18\x17 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.NotebookIdleShutdownConfigB\x03\xe0\x41\x03\x12\x19\n\x0cnetwork_tags\x18\x19 \x03(\tB\x03\xe0\x41\x01\x12H\n\x0f\x65ncryption_spec\x18\x1c \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1d \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"G\n\x0bHealthState\x12\x1c\n\x18HEALTH_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07HEALTHY\x10\x01\x12\r\n\tUNHEALTHY\x10\x02\"\x99\x01\n\x0cRuntimeState\x12\x1d\n\x19RUNTIME_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x11\n\rBEING_STARTED\x10\x02\x12\x11\n\rBEING_STOPPED\x10\x03\x12\x0b\n\x07STOPPED\x10\x04\x12\x12\n\x0e\x42\x45ING_UPGRADED\x10\x05\x12\t\n\x05\x45RROR\x10\x64\x12\x0b\n\x07INVALID\x10\x65:{\xea\x41x\n)aiplatform.googleapis.com/NotebookRuntime\x12Kprojects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}*]\n\x13NotebookRuntimeType\x12%\n!NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cUSER_DEFINED\x10\x01\x12\r\n\tONE_CLICK\x10\x02\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14NotebookRuntimeProtoP\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.MachineSpec", "google/cloud/aiplatform/v1/machine_resources.proto"], + ["google.cloud.aiplatform.v1.NetworkSpec", "google/cloud/aiplatform/v1/network_spec.proto"], + ["google.cloud.aiplatform.v1.NotebookIdleShutdownConfig", "google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto"], + ["google.cloud.aiplatform.v1.NotebookEucConfig", "google/cloud/aiplatform/v1/notebook_euc_config.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.NotebookRuntimeTemplateRef", "google/cloud/aiplatform/v1/notebook_runtime_template_ref.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 + NotebookRuntimeTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntimeTemplate").msgclass + NotebookRuntime = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntime").msgclass + NotebookRuntime::HealthState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntime.HealthState").enummodule + NotebookRuntime::RuntimeState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntime.RuntimeState").enummodule + NotebookRuntimeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntimeType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb new file mode 100644 index 000000000000..aaae27b530fd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_runtime_template_ref_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n>google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"z\n\x1aNotebookRuntimeTemplateRef\x12\\\n\x19notebook_runtime_template\x18\x01 \x01(\tB9\xe0\x41\x05\xfa\x41\x33\n1aiplatform.googleapis.com/NotebookRuntimeTemplateB\xdd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1fNotebookRuntimeTemplateRefProtoP\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 = [ + ] + 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 + NotebookRuntimeTemplateRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookRuntimeTemplateRef").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb new file mode 100644 index 000000000000..9738e40ced63 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_pb.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/notebook_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/notebook_execution_job_pb' +require 'google/cloud/aiplatform/v1/notebook_runtime_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/notebook_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\x37google/cloud/aiplatform/v1/notebook_execution_job.proto\x1a\x31google/cloud/aiplatform/v1/notebook_runtime.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xe9\x01\n$CreateNotebookRuntimeTemplateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12[\n\x19notebook_runtime_template\x18\x02 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.NotebookRuntimeTemplateB\x03\xe0\x41\x02\x12)\n\x1cnotebook_runtime_template_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n.CreateNotebookRuntimeTemplateOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"l\n!GetNotebookRuntimeTemplateRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/NotebookRuntimeTemplate\"\xf1\x01\n#ListNotebookRuntimeTemplatesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x98\x01\n$ListNotebookRuntimeTemplatesResponse\x12W\n\x1anotebook_runtime_templates\x18\x01 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.NotebookRuntimeTemplate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n$DeleteNotebookRuntimeTemplateRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/NotebookRuntimeTemplate\"\xb9\x01\n$UpdateNotebookRuntimeTemplateRequest\x12[\n\x19notebook_runtime_template\x18\x01 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.NotebookRuntimeTemplateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xa5\x02\n\x1c\x41ssignNotebookRuntimeRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\\\n\x19notebook_runtime_template\x18\x02 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1aiplatform.googleapis.com/NotebookRuntimeTemplate\x12J\n\x10notebook_runtime\x18\x03 \x01(\x0b\x32+.google.cloud.aiplatform.v1.NotebookRuntimeB\x03\xe0\x41\x02\x12 \n\x13notebook_runtime_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x92\x01\n&AssignNotebookRuntimeOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x18\n\x10progress_message\x18\x02 \x01(\t\"\\\n\x19GetNotebookRuntimeRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/NotebookRuntime\"\xe9\x01\n\x1bListNotebookRuntimesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x1cListNotebookRuntimesResponse\x12\x46\n\x11notebook_runtimes\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.NotebookRuntime\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1c\x44\x65leteNotebookRuntimeRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/NotebookRuntime\"`\n\x1dUpgradeNotebookRuntimeRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/NotebookRuntime\"\x93\x01\n\'UpgradeNotebookRuntimeOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x18\n\x10progress_message\x18\x02 \x01(\t\" \n\x1eUpgradeNotebookRuntimeResponse\"^\n\x1bStartNotebookRuntimeRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/NotebookRuntime\"\x91\x01\n%StartNotebookRuntimeOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x18\n\x10progress_message\x18\x02 \x01(\t\"\x1e\n\x1cStartNotebookRuntimeResponse\"]\n\x1aStopNotebookRuntimeRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/NotebookRuntime\"v\n$StopNotebookRuntimeOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x1d\n\x1bStopNotebookRuntimeResponse\"\xdd\x01\n!CreateNotebookExecutionJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12U\n\x16notebook_execution_job\x18\x02 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.NotebookExecutionJobB\x03\xe0\x41\x02\x12&\n\x19notebook_execution_job_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x97\x01\n+CreateNotebookExecutionJobOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x18\n\x10progress_message\x18\x02 \x01(\t\"\xaf\x01\n\x1eGetNotebookExecutionJobRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.aiplatform.googleapis.com/NotebookExecutionJob\x12G\n\x04view\x18\x06 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.NotebookExecutionJobViewB\x03\xe0\x41\x01\"\x83\x02\n ListNotebookExecutionJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12G\n\x04view\x18\x06 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.NotebookExecutionJobViewB\x03\xe0\x41\x01\"\x8f\x01\n!ListNotebookExecutionJobsResponse\x12Q\n\x17notebook_execution_jobs\x18\x01 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.NotebookExecutionJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n!DeleteNotebookExecutionJobRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.aiplatform.googleapis.com/NotebookExecutionJob*\x94\x01\n\x18NotebookExecutionJobView\x12+\n\'NOTEBOOK_EXECUTION_JOB_VIEW_UNSPECIFIED\x10\x00\x12%\n!NOTEBOOK_EXECUTION_JOB_VIEW_BASIC\x10\x01\x12$\n NOTEBOOK_EXECUTION_JOB_VIEW_FULL\x10\x02\x32\xcd!\n\x0fNotebookService\x12\xee\x02\n\x1d\x43reateNotebookRuntimeTemplate\x12@.google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41I\n\x17NotebookRuntimeTemplate\x12.CreateNotebookRuntimeTemplateOperationMetadata\xda\x41=parent,notebook_runtime_template,notebook_runtime_template_id\x82\xd3\xe4\x93\x02Y\"\x12\x12*\"9/v1/{name=projects/*/locations/*/notebookRuntimes/*}:stop:\x01*\x12\xd6\x02\n\x1a\x43reateNotebookExecutionJob\x12=.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x01\xca\x41\x43\n\x14NotebookExecutionJob\x12+CreateNotebookExecutionJobOperationMetadata\xda\x41\x37parent,notebook_execution_job,notebook_execution_job_id\x82\xd3\xe4\x93\x02S\"9/v1/{parent=projects/*/locations/*}/notebookExecutionJobs:\x16notebook_execution_job\x12\xd1\x01\n\x17GetNotebookExecutionJob\x12:.google.cloud.aiplatform.v1.GetNotebookExecutionJobRequest\x1a\x30.google.cloud.aiplatform.v1.NotebookExecutionJob\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}\x12\xe4\x01\n\x19ListNotebookExecutionJobs\x12<.google.cloud.aiplatform.v1.ListNotebookExecutionJobsRequest\x1a=.google.cloud.aiplatform.v1.ListNotebookExecutionJobsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/notebookExecutionJobs\x12\xf7\x01\n\x1a\x44\x65leteNotebookExecutionJob\x12=.google.cloud.aiplatform.v1.DeleteNotebookExecutionJobRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14NotebookServiceProtoP\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.NotebookRuntimeTemplate", "google/cloud/aiplatform/v1/notebook_runtime.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.NotebookExecutionJob", "google/cloud/aiplatform/v1/notebook_execution_job.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 + CreateNotebookRuntimeTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateRequest").msgclass + CreateNotebookRuntimeTemplateOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateOperationMetadata").msgclass + GetNotebookRuntimeTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetNotebookRuntimeTemplateRequest").msgclass + ListNotebookRuntimeTemplatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesRequest").msgclass + ListNotebookRuntimeTemplatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesResponse").msgclass + DeleteNotebookRuntimeTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteNotebookRuntimeTemplateRequest").msgclass + UpdateNotebookRuntimeTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateNotebookRuntimeTemplateRequest").msgclass + AssignNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AssignNotebookRuntimeRequest").msgclass + AssignNotebookRuntimeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AssignNotebookRuntimeOperationMetadata").msgclass + GetNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetNotebookRuntimeRequest").msgclass + ListNotebookRuntimesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookRuntimesRequest").msgclass + ListNotebookRuntimesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookRuntimesResponse").msgclass + DeleteNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteNotebookRuntimeRequest").msgclass + UpgradeNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpgradeNotebookRuntimeRequest").msgclass + UpgradeNotebookRuntimeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpgradeNotebookRuntimeOperationMetadata").msgclass + UpgradeNotebookRuntimeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpgradeNotebookRuntimeResponse").msgclass + StartNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StartNotebookRuntimeRequest").msgclass + StartNotebookRuntimeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StartNotebookRuntimeOperationMetadata").msgclass + StartNotebookRuntimeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StartNotebookRuntimeResponse").msgclass + StopNotebookRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StopNotebookRuntimeRequest").msgclass + StopNotebookRuntimeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StopNotebookRuntimeOperationMetadata").msgclass + StopNotebookRuntimeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StopNotebookRuntimeResponse").msgclass + CreateNotebookExecutionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest").msgclass + CreateNotebookExecutionJobOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateNotebookExecutionJobOperationMetadata").msgclass + GetNotebookExecutionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetNotebookExecutionJobRequest").msgclass + ListNotebookExecutionJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookExecutionJobsRequest").msgclass + ListNotebookExecutionJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListNotebookExecutionJobsResponse").msgclass + DeleteNotebookExecutionJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteNotebookExecutionJobRequest").msgclass + NotebookExecutionJobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.NotebookExecutionJobView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb new file mode 100644 index 000000000000..f38908eee7e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/notebook_service_services_pb.rb @@ -0,0 +1,76 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/notebook_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/notebook_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module NotebookService + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.NotebookService' + + # Creates a NotebookRuntimeTemplate. + rpc :CreateNotebookRuntimeTemplate, ::Google::Cloud::AIPlatform::V1::CreateNotebookRuntimeTemplateRequest, ::Google::Longrunning::Operation + # Gets a NotebookRuntimeTemplate. + rpc :GetNotebookRuntimeTemplate, ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeTemplateRequest, ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate + # Lists NotebookRuntimeTemplates in a Location. + rpc :ListNotebookRuntimeTemplates, ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest, ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse + # Deletes a NotebookRuntimeTemplate. + rpc :DeleteNotebookRuntimeTemplate, ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeTemplateRequest, ::Google::Longrunning::Operation + # Updates a NotebookRuntimeTemplate. + rpc :UpdateNotebookRuntimeTemplate, ::Google::Cloud::AIPlatform::V1::UpdateNotebookRuntimeTemplateRequest, ::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate + # Assigns a NotebookRuntime to a user for a particular Notebook file. This + # method will either returns an existing assignment or generates a new one. + rpc :AssignNotebookRuntime, ::Google::Cloud::AIPlatform::V1::AssignNotebookRuntimeRequest, ::Google::Longrunning::Operation + # Gets a NotebookRuntime. + rpc :GetNotebookRuntime, ::Google::Cloud::AIPlatform::V1::GetNotebookRuntimeRequest, ::Google::Cloud::AIPlatform::V1::NotebookRuntime + # Lists NotebookRuntimes in a Location. + rpc :ListNotebookRuntimes, ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest, ::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse + # Deletes a NotebookRuntime. + rpc :DeleteNotebookRuntime, ::Google::Cloud::AIPlatform::V1::DeleteNotebookRuntimeRequest, ::Google::Longrunning::Operation + # Upgrades a NotebookRuntime. + rpc :UpgradeNotebookRuntime, ::Google::Cloud::AIPlatform::V1::UpgradeNotebookRuntimeRequest, ::Google::Longrunning::Operation + # Starts a NotebookRuntime. + rpc :StartNotebookRuntime, ::Google::Cloud::AIPlatform::V1::StartNotebookRuntimeRequest, ::Google::Longrunning::Operation + # Stops a NotebookRuntime. + rpc :StopNotebookRuntime, ::Google::Cloud::AIPlatform::V1::StopNotebookRuntimeRequest, ::Google::Longrunning::Operation + # Creates a NotebookExecutionJob. + rpc :CreateNotebookExecutionJob, ::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest, ::Google::Longrunning::Operation + # Gets a NotebookExecutionJob. + rpc :GetNotebookExecutionJob, ::Google::Cloud::AIPlatform::V1::GetNotebookExecutionJobRequest, ::Google::Cloud::AIPlatform::V1::NotebookExecutionJob + # Lists NotebookExecutionJobs in a Location. + rpc :ListNotebookExecutionJobs, ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest, ::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse + # Deletes a NotebookExecutionJob. + rpc :DeleteNotebookExecutionJob, ::Google::Cloud::AIPlatform::V1::DeleteNotebookExecutionJobRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/openapi_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/openapi_pb.rb new file mode 100644 index 000000000000..ff52f22644f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/openapi_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/openapi.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/openapi.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb0\x06\n\x06Schema\x12\x33\n\x04type\x18\x01 \x01(\x0e\x32 .google.cloud.aiplatform.v1.TypeB\x03\xe0\x41\x01\x12\x13\n\x06\x66ormat\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05title\x18\x18 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08nullable\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x07\x64\x65\x66\x61ult\x18\x17 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12\x36\n\x05items\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.SchemaB\x03\xe0\x41\x01\x12\x16\n\tmin_items\x18\x15 \x01(\x03\x42\x03\xe0\x41\x01\x12\x16\n\tmax_items\x18\x16 \x01(\x03\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65num\x18\t \x03(\tB\x03\xe0\x41\x01\x12K\n\nproperties\x18\x03 \x03(\x0b\x32\x32.google.cloud.aiplatform.v1.Schema.PropertiesEntryB\x03\xe0\x41\x01\x12\x1e\n\x11property_ordering\x18\x19 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08required\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x1b\n\x0emin_properties\x18\x0e \x01(\x03\x42\x03\xe0\x41\x01\x12\x1b\n\x0emax_properties\x18\x0f \x01(\x03\x42\x03\xe0\x41\x01\x12\x14\n\x07minimum\x18\x10 \x01(\x01\x42\x03\xe0\x41\x01\x12\x14\n\x07maximum\x18\x11 \x01(\x01\x42\x03\xe0\x41\x01\x12\x17\n\nmin_length\x18\x12 \x01(\x03\x42\x03\xe0\x41\x01\x12\x17\n\nmax_length\x18\x13 \x01(\x03\x42\x03\xe0\x41\x01\x12\x14\n\x07pattern\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12,\n\x07\x65xample\x18\x04 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12\x37\n\x06\x61ny_of\x18\x0b \x03(\x0b\x32\".google.cloud.aiplatform.v1.SchemaB\x03\xe0\x41\x01\x1aU\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Schema:\x02\x38\x01*e\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06NUMBER\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x0b\n\x07\x42OOLEAN\x10\x04\x12\t\n\x05\x41RRAY\x10\x05\x12\n\n\x06OBJECT\x10\x06\x42\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0cOpenApiProtoP\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.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Schema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Schema").msgclass + Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/operation_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/operation_pb.rb new file mode 100644 index 000000000000..e3f8a084e863 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/operation_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/operation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n*google/cloud/aiplatform/v1/operation.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb9\x01\n\x18GenericOperationMetadata\x12\x31\n\x10partial_failures\x18\x01 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"i\n\x17\x44\x65leteOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadataB\xcc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0eOperationProtoP\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.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + GenericOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenericOperationMetadata").msgclass + DeleteOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb new file mode 100644 index 000000000000..74c95693bf24 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/persistent_resource.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n4google/cloud/aiplatform/v1/persistent_resource.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\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xde\x08\n\x12PersistentResource\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0eresource_pools\x18\x04 \x03(\x0b\x32(.google.cloud.aiplatform.v1.ResourcePoolB\x03\xe0\x41\x02\x12H\n\x05state\x18\x05 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.PersistentResource.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12O\n\x06labels\x18\n \x03(\x0b\x32:.google.cloud.aiplatform.v1.PersistentResource.LabelsEntryB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x0b \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12H\n\x0f\x65ncryption_spec\x18\x0c \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpecB\x03\xe0\x41\x01\x12S\n\x15resource_runtime_spec\x18\r \x01(\x0b\x32/.google.cloud.aiplatform.v1.ResourceRuntimeSpecB\x03\xe0\x41\x01\x12J\n\x10resource_runtime\x18\x0e \x01(\x0b\x32+.google.cloud.aiplatform.v1.ResourceRuntimeB\x03\xe0\x41\x03\x12\x1f\n\x12reserved_ip_ranges\x18\x0f \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"s\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cPROVISIONING\x10\x01\x12\x0b\n\x07RUNNING\x10\x03\x12\x0c\n\x08STOPPING\x10\x04\x12\t\n\x05\x45RROR\x10\x05\x12\r\n\tREBOOTING\x10\x06\x12\x0c\n\x08UPDATING\x10\x07:\x85\x01\xea\x41\x81\x01\n,aiplatform.googleapis.com/PersistentResource\x12Qprojects/{project}/locations/{location}/persistentResources/{persistent_resource}\"\xdb\x03\n\x0cResourcePool\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x45\n\x0cmachine_spec\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1f\n\rreplica_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12<\n\tdisk_spec\x18\x04 \x01(\x0b\x32$.google.cloud.aiplatform.v1.DiskSpecB\x03\xe0\x41\x01\x12\x1f\n\x12used_replica_count\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03\x12W\n\x10\x61utoscaling_spec\x18\x07 \x01(\x0b\x32\x38.google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpecB\x03\xe0\x41\x01\x1a\x87\x01\n\x0f\x41utoscalingSpec\x12#\n\x11min_replica_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12#\n\x11max_replica_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x14\n\x12_min_replica_countB\x14\n\x12_max_replica_countB\x10\n\x0e_replica_count\"\xa4\x01\n\x13ResourceRuntimeSpec\x12Q\n\x14service_account_spec\x18\x02 \x01(\x0b\x32..google.cloud.aiplatform.v1.ServiceAccountSpecB\x03\xe0\x41\x01\x12:\n\x08ray_spec\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.RaySpecB\x03\xe0\x41\x01\"\xf3\x02\n\x07RaySpec\x12\x16\n\timage_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12^\n\x14resource_pool_images\x18\x06 \x03(\x0b\x32;.google.cloud.aiplatform.v1.RaySpec.ResourcePoolImagesEntryB\x03\xe0\x41\x01\x12\'\n\x1ahead_node_resource_pool_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12G\n\x0fray_metric_spec\x18\x08 \x01(\x0b\x32).google.cloud.aiplatform.v1.RayMetricSpecB\x03\xe0\x41\x01\x12\x43\n\rray_logs_spec\x18\n \x01(\x0b\x32\'.google.cloud.aiplatform.v1.RayLogsSpecB\x03\xe0\x41\x01\x1a\x39\n\x17ResourcePoolImagesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9b\x01\n\x0fResourceRuntime\x12U\n\x0b\x61\x63\x63\x65ss_uris\x18\x01 \x03(\x0b\x32;.google.cloud.aiplatform.v1.ResourceRuntime.AccessUrisEntryB\x03\xe0\x41\x03\x1a\x31\n\x0f\x41\x63\x63\x65ssUrisEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"^\n\x12ServiceAccountSpec\x12*\n\x1d\x65nable_custom_service_account\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\"&\n\rRayMetricSpec\x12\x15\n\x08\x64isabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"$\n\x0bRayLogsSpec\x12\x15\n\x08\x64isabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x42\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17PersistentResourceProtoP\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.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.MachineSpec", "google/cloud/aiplatform/v1/machine_resources.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 + PersistentResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PersistentResource").msgclass + PersistentResource::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PersistentResource.State").enummodule + ResourcePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResourcePool").msgclass + ResourcePool::AutoscalingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpec").msgclass + ResourceRuntimeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResourceRuntimeSpec").msgclass + RaySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RaySpec").msgclass + ResourceRuntime = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResourceRuntime").msgclass + ServiceAccountSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ServiceAccountSpec").msgclass + RayMetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RayMetricSpec").msgclass + RayLogsSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RayLogsSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb new file mode 100644 index 000000000000..66d74d4bdaaf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/persistent_resource_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/persistent_resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n/v1/{name=projects/*/locations/*/persistentResources/*}:reboot:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xdc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1ePersistentResourceServiceProtoP\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.PersistentResource", "google/cloud/aiplatform/v1/persistent_resource.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 + CreatePersistentResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreatePersistentResourceRequest").msgclass + CreatePersistentResourceOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreatePersistentResourceOperationMetadata").msgclass + UpdatePersistentResourceOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdatePersistentResourceOperationMetadata").msgclass + RebootPersistentResourceOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RebootPersistentResourceOperationMetadata").msgclass + GetPersistentResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetPersistentResourceRequest").msgclass + ListPersistentResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListPersistentResourcesRequest").msgclass + ListPersistentResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListPersistentResourcesResponse").msgclass + DeletePersistentResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeletePersistentResourceRequest").msgclass + UpdatePersistentResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdatePersistentResourceRequest").msgclass + RebootPersistentResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RebootPersistentResourceRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb new file mode 100644 index 000000000000..611bfc4ff2b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/persistent_resource_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/persistent_resource_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/persistent_resource_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module PersistentResourceService + # A service for managing Vertex AI's machine learning PersistentResource. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.PersistentResourceService' + + # Creates a PersistentResource. + rpc :CreatePersistentResource, ::Google::Cloud::AIPlatform::V1::CreatePersistentResourceRequest, ::Google::Longrunning::Operation + # Gets a PersistentResource. + rpc :GetPersistentResource, ::Google::Cloud::AIPlatform::V1::GetPersistentResourceRequest, ::Google::Cloud::AIPlatform::V1::PersistentResource + # Lists PersistentResources in a Location. + rpc :ListPersistentResources, ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest, ::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse + # Deletes a PersistentResource. + rpc :DeletePersistentResource, ::Google::Cloud::AIPlatform::V1::DeletePersistentResourceRequest, ::Google::Longrunning::Operation + # Updates a PersistentResource. + rpc :UpdatePersistentResource, ::Google::Cloud::AIPlatform::V1::UpdatePersistentResourceRequest, ::Google::Longrunning::Operation + # Reboots a PersistentResource. + rpc :RebootPersistentResource, ::Google::Cloud::AIPlatform::V1::RebootPersistentResourceRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb new file mode 100644 index 000000000000..5e29551c33e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/pipeline_failure_policy.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/cloud/aiplatform/v1/pipeline_failure_policy.proto\x12\x1agoogle.cloud.aiplatform.v1*\x8e\x01\n\x15PipelineFailurePolicy\x12\'\n#PIPELINE_FAILURE_POLICY_UNSPECIFIED\x10\x00\x12%\n!PIPELINE_FAILURE_POLICY_FAIL_SLOW\x10\x01\x12%\n!PIPELINE_FAILURE_POLICY_FAIL_FAST\x10\x02\x42\xd8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1aPipelineFailurePolicyProtoP\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 = [ + ] + 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 + PipelineFailurePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineFailurePolicy").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb new file mode 100644 index 000000000000..1b51d480f18e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/pipeline_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/artifact_pb' +require 'google/cloud/aiplatform/v1/context_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/execution_pb' +require 'google/cloud/aiplatform/v1/pipeline_failure_policy_pb' +require 'google/cloud/aiplatform/v1/pipeline_state_pb' +require 'google/cloud/aiplatform/v1/value_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/cloud/aiplatform/v1/pipeline_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/aiplatform/v1/artifact.proto\x1a(google/cloud/aiplatform/v1/context.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a*google/cloud/aiplatform/v1/execution.proto\x1a\x38google/cloud/aiplatform/v1/pipeline_failure_policy.proto\x1a/google/cloud/aiplatform/v1/pipeline_state.proto\x1a&google/cloud/aiplatform/v1/value.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf4\x0e\n\x0bPipelineJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12.\n\rpipeline_spec\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12=\n\x05state\x18\x08 \x01(\x0e\x32).google.cloud.aiplatform.v1.PipelineStateB\x03\xe0\x41\x03\x12\x46\n\njob_detail\x18\t \x01(\x0b\x32-.google.cloud.aiplatform.v1.PipelineJobDetailB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x0b \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.PipelineJob.LabelsEntry\x12M\n\x0eruntime_config\x18\x0c \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig\x12\x43\n\x0f\x65ncryption_spec\x18\x10 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x17\n\x0fservice_account\x18\x11 \x01(\t\x12\x34\n\x07network\x18\x12 \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1a\n\x12reserved_ip_ranges\x18\x19 \x03(\t\x12\x14\n\x0ctemplate_uri\x18\x13 \x01(\t\x12T\n\x11template_metadata\x18\x14 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.PipelineTemplateMetadataB\x03\xe0\x41\x03\x12\x1a\n\rschedule_name\x18\x16 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15preflight_validations\x18\x1a \x01(\x08\x42\x03\xe0\x41\x01\x1a\xf8\x05\n\rRuntimeConfig\x12]\n\nparameters\x18\x01 \x03(\x0b\x32\x45.google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.ParametersEntryB\x02\x18\x01\x12!\n\x14gcs_output_directory\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x64\n\x10parameter_values\x18\x03 \x03(\x0b\x32J.google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.ParameterValuesEntry\x12I\n\x0e\x66\x61ilure_policy\x18\x04 \x01(\x0e\x32\x31.google.cloud.aiplatform.v1.PipelineFailurePolicy\x12\x62\n\x0finput_artifacts\x18\x05 \x03(\x0b\x32I.google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.InputArtifactsEntry\x1a.\n\rInputArtifact\x12\x15\n\x0b\x61rtifact_id\x18\x01 \x01(\tH\x00\x42\x06\n\x04kind\x1aT\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.google.cloud.aiplatform.v1.Value:\x02\x38\x01\x1aN\n\x14ParameterValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1az\n\x13InputArtifactsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12R\n\x05value\x18\x02 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.InputArtifact:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:o\xea\x41l\n%aiplatform.googleapis.com/PipelineJob\x12\x43projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}\"+\n\x18PipelineTemplateMetadata\x12\x0f\n\x07version\x18\x03 \x01(\t\"\xea\x01\n\x11PipelineJobDetail\x12\x42\n\x10pipeline_context\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContextB\x03\xe0\x41\x03\x12\x46\n\x14pipeline_run_context\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContextB\x03\xe0\x41\x03\x12I\n\x0ctask_details\x18\x03 \x03(\x0b\x32..google.cloud.aiplatform.v1.PipelineTaskDetailB\x03\xe0\x41\x03\"\x9d\x0b\n\x12PipelineTaskDetail\x12\x14\n\x07task_id\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1b\n\x0eparent_task_id\x18\x0c \x01(\x03\x42\x03\xe0\x41\x03\x12\x16\n\ttask_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12T\n\x0f\x65xecutor_detail\x18\x06 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.PipelineTaskExecutorDetailB\x03\xe0\x41\x03\x12H\n\x05state\x18\x07 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.PipelineTaskDetail.StateB\x03\xe0\x41\x03\x12=\n\texecution\x18\x08 \x01(\x0b\x32%.google.cloud.aiplatform.v1.ExecutionB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x64\n\x14pipeline_task_status\x18\r \x03(\x0b\x32\x41.google.cloud.aiplatform.v1.PipelineTaskDetail.PipelineTaskStatusB\x03\xe0\x41\x03\x12O\n\x06inputs\x18\n \x03(\x0b\x32:.google.cloud.aiplatform.v1.PipelineTaskDetail.InputsEntryB\x03\xe0\x41\x03\x12Q\n\x07outputs\x18\x0b \x03(\x0b\x32;.google.cloud.aiplatform.v1.PipelineTaskDetail.OutputsEntryB\x03\xe0\x41\x03\x1a\xbc\x01\n\x12PipelineTaskStatus\x12\x34\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.PipelineTaskDetail.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1aL\n\x0c\x41rtifactList\x12<\n\tartifacts\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.ArtifactB\x03\xe0\x41\x03\x1aj\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.PipelineTaskDetail.ArtifactList:\x02\x38\x01\x1ak\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.PipelineTaskDetail.ArtifactList:\x02\x38\x01\"\xa6\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x12\n\x0e\x43\x41NCEL_PENDING\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\x0b\n\x07SKIPPED\x10\x08\x12\x11\n\rNOT_TRIGGERED\x10\t\"\xcb\x04\n\x1aPipelineTaskExecutorDetail\x12g\n\x10\x63ontainer_detail\x18\x01 \x01(\x0b\x32\x46.google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.ContainerDetailB\x03\xe0\x41\x03H\x00\x12h\n\x11\x63ustom_job_detail\x18\x02 \x01(\x0b\x32\x46.google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.CustomJobDetailB\x03\xe0\x41\x03H\x00\x1a\xe7\x01\n\x0f\x43ontainerDetail\x12=\n\x08main_job\x18\x01 \x01(\tB+\xe0\x41\x03\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\x12J\n\x15pre_caching_check_job\x18\x02 \x01(\tB+\xe0\x41\x03\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\x12\x1d\n\x10\x66\x61iled_main_jobs\x18\x03 \x03(\tB\x03\xe0\x41\x03\x12*\n\x1d\x66\x61iled_pre_caching_check_jobs\x18\x04 \x03(\tB\x03\xe0\x41\x03\x1a\x65\n\x0f\x43ustomJobDetail\x12\x38\n\x03job\x18\x01 \x01(\tB+\xe0\x41\x03\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\x12\x18\n\x0b\x66\x61iled_jobs\x18\x03 \x03(\tB\x03\xe0\x41\x03\x42\t\n\x07\x64\x65tailsB\x97\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x08PipelineP\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\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}b\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.Struct", "google/protobuf/struct.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.Value", "google/cloud/aiplatform/v1/value.proto"], + ["google.cloud.aiplatform.v1.Context", "google/cloud/aiplatform/v1/context.proto"], + ["google.cloud.aiplatform.v1.Execution", "google/cloud/aiplatform/v1/execution.proto"], + ["google.cloud.aiplatform.v1.Artifact", "google/cloud/aiplatform/v1/artifact.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 + PipelineJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineJob").msgclass + PipelineJob::RuntimeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig").msgclass + PipelineJob::RuntimeConfig::InputArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.InputArtifact").msgclass + PipelineTemplateMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTemplateMetadata").msgclass + PipelineJobDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineJobDetail").msgclass + PipelineTaskDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskDetail").msgclass + PipelineTaskDetail::PipelineTaskStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskDetail.PipelineTaskStatus").msgclass + PipelineTaskDetail::ArtifactList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskDetail.ArtifactList").msgclass + PipelineTaskDetail::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskDetail.State").enummodule + PipelineTaskExecutorDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskExecutorDetail").msgclass + PipelineTaskExecutorDetail::ContainerDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.ContainerDetail").msgclass + PipelineTaskExecutorDetail::CustomJobDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.CustomJobDetail").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb new file mode 100644 index 000000000000..70c40556d549 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/pipeline_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/pipeline_job_pb' +require 'google/cloud/aiplatform/v1/training_pipeline_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/pipeline_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/pipeline_job.proto\x1a\x32google/cloud/aiplatform/v1/training_pipeline.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"z\n(BatchCancelPipelineJobsOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xa8\x01\n\x1d\x43reateTrainingPipelineRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12L\n\x11training_pipeline\x18\x02 \x01(\x0b\x32,.google.cloud.aiplatform.v1.TrainingPipelineB\x03\xe0\x41\x02\"^\n\x1aGetTrainingPipelineRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*aiplatform.googleapis.com/TrainingPipeline\"\xbf\x01\n\x1cListTrainingPipelinesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x82\x01\n\x1dListTrainingPipelinesResponse\x12H\n\x12training_pipelines\x18\x01 \x03(\x0b\x32,.google.cloud.aiplatform.v1.TrainingPipeline\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1d\x44\x65leteTrainingPipelineRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*aiplatform.googleapis.com/TrainingPipeline\"a\n\x1d\x43\x61ncelTrainingPipelineRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*aiplatform.googleapis.com/TrainingPipeline\"\xb2\x01\n\x18\x43reatePipelineJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x42\n\x0cpipeline_job\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.PipelineJobB\x03\xe0\x41\x02\x12\x17\n\x0fpipeline_job_id\x18\x03 \x01(\t\"T\n\x15GetPipelineJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\"\xcc\x01\n\x17ListPipelineJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12-\n\tread_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"s\n\x18ListPipelineJobsResponse\x12>\n\rpipeline_jobs\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.PipelineJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18\x44\x65letePipelineJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\"\x9d\x01\n\x1e\x42\x61tchDeletePipelineJobsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%aiplatform.googleapis.com/PipelineJob\x12<\n\x05names\x18\x02 \x03(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\"a\n\x1f\x42\x61tchDeletePipelineJobsResponse\x12>\n\rpipeline_jobs\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.PipelineJob\"W\n\x18\x43\x61ncelPipelineJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\"\x9d\x01\n\x1e\x42\x61tchCancelPipelineJobsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%aiplatform.googleapis.com/PipelineJob\x12<\n\x05names\x18\x02 \x03(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJob\"a\n\x1f\x42\x61tchCancelPipelineJobsResponse\x12>\n\rpipeline_jobs\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.PipelineJob2\xa7\x15\n\x0fPipelineService\x12\xee\x01\n\x16\x43reateTrainingPipeline\x12\x39.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest\x1a,.google.cloud.aiplatform.v1.TrainingPipeline\"k\xda\x41\x18parent,training_pipeline\x82\xd3\xe4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/trainingPipelines:\x11training_pipeline\x12\xc1\x01\n\x13GetTrainingPipeline\x12\x36.google.cloud.aiplatform.v1.GetTrainingPipelineRequest\x1a,.google.cloud.aiplatform.v1.TrainingPipeline\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/trainingPipelines/*}\x12\xd4\x01\n\x15ListTrainingPipelines\x12\x38.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest\x1a\x39.google.cloud.aiplatform.v1.ListTrainingPipelinesResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/trainingPipelines\x12\xeb\x01\n\x16\x44\x65leteTrainingPipeline\x12\x39.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/trainingPipelines/*}\x12\xbb\x01\n\x16\x43\x61ncelTrainingPipeline\x12\x39.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest\x1a\x16.google.protobuf.Empty\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\"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.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.cloud.aiplatform.v1.TrainingPipeline", "google/cloud/aiplatform/v1/training_pipeline.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.PipelineJob", "google/cloud/aiplatform/v1/pipeline_job.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 + BatchCancelPipelineJobsOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCancelPipelineJobsOperationMetadata").msgclass + CreateTrainingPipelineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTrainingPipelineRequest").msgclass + GetTrainingPipelineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTrainingPipelineRequest").msgclass + ListTrainingPipelinesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTrainingPipelinesRequest").msgclass + ListTrainingPipelinesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTrainingPipelinesResponse").msgclass + DeleteTrainingPipelineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest").msgclass + CancelTrainingPipelineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelTrainingPipelineRequest").msgclass + CreatePipelineJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreatePipelineJobRequest").msgclass + GetPipelineJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetPipelineJobRequest").msgclass + ListPipelineJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListPipelineJobsRequest").msgclass + ListPipelineJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListPipelineJobsResponse").msgclass + DeletePipelineJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeletePipelineJobRequest").msgclass + BatchDeletePipelineJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchDeletePipelineJobsRequest").msgclass + BatchDeletePipelineJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchDeletePipelineJobsResponse").msgclass + CancelPipelineJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CancelPipelineJobRequest").msgclass + BatchCancelPipelineJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCancelPipelineJobsRequest").msgclass + BatchCancelPipelineJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCancelPipelineJobsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_services_pb.rb new file mode 100644 index 000000000000..13c279f33cd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_service_services_pb.rb @@ -0,0 +1,103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/pipeline_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/pipeline_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module PipelineService + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.PipelineService' + + # Creates a TrainingPipeline. A created TrainingPipeline right away will be + # attempted to be run. + rpc :CreateTrainingPipeline, ::Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest, ::Google::Cloud::AIPlatform::V1::TrainingPipeline + # Gets a TrainingPipeline. + rpc :GetTrainingPipeline, ::Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest, ::Google::Cloud::AIPlatform::V1::TrainingPipeline + # Lists TrainingPipelines in a Location. + rpc :ListTrainingPipelines, ::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest, ::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse + # Deletes a TrainingPipeline. + rpc :DeleteTrainingPipeline, ::Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest, ::Google::Longrunning::Operation + # Cancels a TrainingPipeline. + # Starts asynchronous cancellation on the TrainingPipeline. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline] + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the TrainingPipeline is not deleted; instead it becomes a pipeline with + # a + # [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] + # value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + # corresponding to `Code.CANCELLED`, and + # [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] + # is set to `CANCELLED`. + rpc :CancelTrainingPipeline, ::Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest, ::Google::Protobuf::Empty + # Creates a PipelineJob. A PipelineJob will run immediately when created. + rpc :CreatePipelineJob, ::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest, ::Google::Cloud::AIPlatform::V1::PipelineJob + # Gets a PipelineJob. + rpc :GetPipelineJob, ::Google::Cloud::AIPlatform::V1::GetPipelineJobRequest, ::Google::Cloud::AIPlatform::V1::PipelineJob + # Lists PipelineJobs in a Location. + rpc :ListPipelineJobs, ::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest, ::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse + # Deletes a PipelineJob. + rpc :DeletePipelineJob, ::Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest, ::Google::Longrunning::Operation + # Batch deletes PipelineJobs + # The Operation is atomic. If it fails, none of the PipelineJobs are deleted. + # If it succeeds, all of the PipelineJobs are deleted. + rpc :BatchDeletePipelineJobs, ::Google::Cloud::AIPlatform::V1::BatchDeletePipelineJobsRequest, ::Google::Longrunning::Operation + # Cancels a PipelineJob. + # Starts asynchronous cancellation on the PipelineJob. The server + # makes a best effort to cancel the pipeline, but success is not + # guaranteed. Clients can use + # [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] + # or other methods to check whether the cancellation succeeded or whether the + # pipeline completed despite cancellation. On successful cancellation, + # the PipelineJob is not deleted; instead it becomes a pipeline with + # a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value + # with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding + # to `Code.CANCELLED`, and + # [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to + # `CANCELLED`. + rpc :CancelPipelineJob, ::Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest, ::Google::Protobuf::Empty + # Batch cancel PipelineJobs. + # Firstly the server will check if all the jobs are in non-terminal states, + # and skip the jobs that are already terminated. + # If the operation failed, none of the pipeline jobs are cancelled. + # The server will poll the states of all the pipeline jobs periodically + # to check the cancellation status. + # This operation will return an LRO. + rpc :BatchCancelPipelineJobs, ::Google::Cloud::AIPlatform::V1::BatchCancelPipelineJobsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb new file mode 100644 index 000000000000..6728ac3503aa --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/pipeline_state.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/aiplatform/v1/pipeline_state.proto\x12\x1agoogle.cloud.aiplatform.v1*\x93\x02\n\rPipelineState\x12\x1e\n\x1aPIPELINE_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15PIPELINE_STATE_QUEUED\x10\x01\x12\x1a\n\x16PIPELINE_STATE_PENDING\x10\x02\x12\x1a\n\x16PIPELINE_STATE_RUNNING\x10\x03\x12\x1c\n\x18PIPELINE_STATE_SUCCEEDED\x10\x04\x12\x19\n\x15PIPELINE_STATE_FAILED\x10\x05\x12\x1d\n\x19PIPELINE_STATE_CANCELLING\x10\x06\x12\x1c\n\x18PIPELINE_STATE_CANCELLED\x10\x07\x12\x19\n\x15PIPELINE_STATE_PAUSED\x10\x08\x42\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12PipelineStateProtoP\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 = [ + ] + 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 + PipelineState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PipelineState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb new file mode 100644 index 000000000000..2d3559634a70 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/prediction_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/content_pb' +require 'google/cloud/aiplatform/v1/explanation_pb' +require 'google/cloud/aiplatform/v1/tool_pb' +require 'google/cloud/aiplatform/v1/types_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/prediction_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/aiplatform/v1/content.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a%google/cloud/aiplatform/v1/tool.proto\x1a&google/cloud/aiplatform/v1/types.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xaa\x01\n\x0ePredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\"\x80\x02\n\x0fPredictResponse\x12+\n\x0bpredictions\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12\x36\n\x05model\x18\x03 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12model_display_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\"z\n\x11RawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\x80\x01\n\x17StreamRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\xc0\x01\n\x14\x44irectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x84\x01\n\x15\x44irectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"{\n\x17\x44irectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"*\n\x18\x44irectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xd0\x01\n\x1aStreamDirectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x37\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\x12;\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\"\x8a\x01\n\x1bStreamDirectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x8b\x01\n\x1dStreamDirectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x18\n\x0bmethod_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05input\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\"0\n\x1eStreamDirectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xc3\x01\n\x17StreamingPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x87\x01\n\x18StreamingPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"~\n\x1aStreamingRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"-\n\x1bStreamingRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\x9d\x02\n\x0e\x45xplainRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12V\n\x19\x65xplanation_spec_override\x18\x05 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.ExplanationSpecOverride\x12\x19\n\x11\x64\x65ployed_model_id\x18\x03 \x01(\t\"\x98\x01\n\x0f\x45xplainResponse\x12=\n\x0c\x65xplanations\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.Explanation\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12+\n\x0bpredictions\x18\x03 \x03(\x0b\x32\x16.google.protobuf.Value\"\xd3\x03\n\x12\x43ountTokensRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x12\n\x05model\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12:\n\x08\x63ontents\x18\x04 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\x12I\n\x12system_instruction\x18\x05 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12Q\n\x11generation_config\x18\x07 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x15\n\x13_system_instructionB\x14\n\x12_generation_config\"N\n\x13\x43ountTokensResponse\x12\x14\n\x0ctotal_tokens\x18\x01 \x01(\x05\x12!\n\x19total_billable_characters\x18\x02 \x01(\x05\"\xa6\x05\n\x16GenerateContentRequest\x12\x12\n\x05model\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12:\n\x08\x63ontents\x18\x02 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x02\x12I\n\x12system_instruction\x18\x08 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12G\n\x0e\x63\x61\x63hed_content\x18\t \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'aiplatform.googleapis.com/CachedContent\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12@\n\x0btool_config\x18\x07 \x01(\x0b\x32&.google.cloud.aiplatform.v1.ToolConfigB\x03\xe0\x41\x01\x12S\n\x06labels\x18\n \x03(\x0b\x32>.google.cloud.aiplatform.v1.GenerateContentRequest.LabelsEntryB\x03\xe0\x41\x01\x12G\n\x0fsafety_settings\x18\x03 \x03(\x0b\x32).google.cloud.aiplatform.v1.SafetySettingB\x03\xe0\x41\x01\x12L\n\x11generation_config\x18\x04 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x15\n\x13_system_instruction\"\x9d\x06\n\x17GenerateContentResponse\x12>\n\ncandidates\x18\x02 \x03(\x0b\x32%.google.cloud.aiplatform.v1.CandidateB\x03\xe0\x41\x03\x12\x1a\n\rmodel_version\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12`\n\x0fprompt_feedback\x18\x03 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedbackB\x03\xe0\x41\x03\x12Y\n\x0eusage_metadata\x18\x04 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata\x1a\xd6\x02\n\x0ePromptFeedback\x12k\n\x0c\x62lock_reason\x18\x01 \x01(\x0e\x32P.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReasonB\x03\xe0\x41\x03\x12\x45\n\x0esafety_ratings\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SafetyRatingB\x03\xe0\x41\x03\x12!\n\x14\x62lock_reason_message\x18\x03 \x01(\tB\x03\xe0\x41\x03\"m\n\rBlockedReason\x12\x1e\n\x1a\x42LOCKED_REASON_UNSPECIFIED\x10\x00\x12\n\n\x06SAFETY\x10\x01\x12\t\n\x05OTHER\x10\x02\x12\r\n\tBLOCKLIST\x10\x03\x12\x16\n\x12PROHIBITED_CONTENT\x10\x04\x1a\x8f\x01\n\rUsageMetadata\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\x12\'\n\x1a\x63\x61\x63hed_content_token_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x32\xf2\x19\n\x11PredictionService\x12\x94\x02\n\x07Predict\x12*.google.cloud.aiplatform.v1.PredictRequest\x1a+.google.cloud.aiplatform.v1.PredictResponse\"\xaf\x01\xda\x41\x1d\x65ndpoint,instances,parameters\x82\xd3\xe4\x93\x02\x88\x01\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict:\x01*ZH\"C/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict:\x01*\x12\xfe\x01\n\nRawPredict\x12-.google.cloud.aiplatform.v1.RawPredictRequest\x1a\x14.google.api.HttpBody\"\xaa\x01\xda\x41\x12\x65ndpoint,http_body\x82\xd3\xe4\x93\x02\x8e\x01\"\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain:\x01*\x12\x8d\x03\n\x0fGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\x90\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\xf8\x01\">/v1/{model=projects/*/locations/*/endpoints/*}:generateContent:\x01*ZM\"H/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent:\x01*Z,\"\'/v1/{model=endpoints/*}:generateContent:\x01*Z6\"1/v1/{model=publishers/*/models/*}:generateContent:\x01*\x12\xad\x03\n\x15StreamGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\xa8\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\x90\x02\"D/v1/{model=projects/*/locations/*/endpoints/*}:streamGenerateContent:\x01*ZS\"N/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent:\x01*Z2\"-/v1/{model=endpoints/*}:streamGenerateContent:\x01*Z<\"7/v1/{model=publishers/*/models/*}:streamGenerateContent:\x01*0\x01\x1a\x86\x01\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16PredictionServiceProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.api.HttpBody", "google/api/httpbody.proto"], + ["google.cloud.aiplatform.v1.Tensor", "google/cloud/aiplatform/v1/types.proto"], + ["google.cloud.aiplatform.v1.ExplanationSpecOverride", "google/cloud/aiplatform/v1/explanation.proto"], + ["google.cloud.aiplatform.v1.Content", "google/cloud/aiplatform/v1/content.proto"], + ["google.cloud.aiplatform.v1.Tool", "google/cloud/aiplatform/v1/tool.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 + PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PredictRequest").msgclass + PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PredictResponse").msgclass + RawPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RawPredictRequest").msgclass + StreamRawPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamRawPredictRequest").msgclass + DirectPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DirectPredictRequest").msgclass + DirectPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DirectPredictResponse").msgclass + DirectRawPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DirectRawPredictRequest").msgclass + DirectRawPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DirectRawPredictResponse").msgclass + StreamDirectPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamDirectPredictRequest").msgclass + StreamDirectPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamDirectPredictResponse").msgclass + StreamDirectRawPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamDirectRawPredictRequest").msgclass + StreamDirectRawPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamDirectRawPredictResponse").msgclass + StreamingPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamingPredictRequest").msgclass + StreamingPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamingPredictResponse").msgclass + StreamingRawPredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamingRawPredictRequest").msgclass + StreamingRawPredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamingRawPredictResponse").msgclass + ExplainRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplainRequest").msgclass + ExplainResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExplainResponse").msgclass + CountTokensRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CountTokensRequest").msgclass + CountTokensResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CountTokensResponse").msgclass + GenerateContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentRequest").msgclass + GenerateContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse").msgclass + GenerateContentResponse::PromptFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback").msgclass + GenerateContentResponse::PromptFeedback::BlockedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason").enummodule + GenerateContentResponse::UsageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb new file mode 100644 index 000000000000..3c5feed59940 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb @@ -0,0 +1,95 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/prediction_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/prediction_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module PredictionService + # A service for online predictions and explanations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.PredictionService' + + # Perform an online prediction. + rpc :Predict, ::Google::Cloud::AIPlatform::V1::PredictRequest, ::Google::Cloud::AIPlatform::V1::PredictResponse + # Perform an online prediction with an arbitrary HTTP payload. + # + # The response includes the following HTTP headers: + # + # * `X-Vertex-AI-Endpoint-Id`: ID of the + # [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this + # prediction. + # + # * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + # [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this + # prediction. + rpc :RawPredict, ::Google::Cloud::AIPlatform::V1::RawPredictRequest, ::Google::Api::HttpBody + # Perform a streaming online prediction with an arbitrary HTTP payload. + rpc :StreamRawPredict, ::Google::Cloud::AIPlatform::V1::StreamRawPredictRequest, stream(::Google::Api::HttpBody) + # Perform an unary online prediction request to a gRPC model server for + # Vertex first-party products and frameworks. + rpc :DirectPredict, ::Google::Cloud::AIPlatform::V1::DirectPredictRequest, ::Google::Cloud::AIPlatform::V1::DirectPredictResponse + # Perform an unary online prediction request to a gRPC model server for + # custom containers. + rpc :DirectRawPredict, ::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest, ::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse + # Perform a streaming online prediction request to a gRPC model server for + # Vertex first-party products and frameworks. + rpc :StreamDirectPredict, stream(::Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest), stream(::Google::Cloud::AIPlatform::V1::StreamDirectPredictResponse) + # Perform a streaming online prediction request to a gRPC model server for + # custom containers. + rpc :StreamDirectRawPredict, stream(::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest), stream(::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictResponse) + # Perform a streaming online prediction request for Vertex first-party + # products and frameworks. + rpc :StreamingPredict, stream(::Google::Cloud::AIPlatform::V1::StreamingPredictRequest), stream(::Google::Cloud::AIPlatform::V1::StreamingPredictResponse) + # Perform a server-side streaming online prediction request for Vertex + # LLM streaming. + rpc :ServerStreamingPredict, ::Google::Cloud::AIPlatform::V1::StreamingPredictRequest, stream(::Google::Cloud::AIPlatform::V1::StreamingPredictResponse) + # Perform a streaming online prediction request through gRPC. + rpc :StreamingRawPredict, stream(::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest), stream(::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse) + # Perform an online explanation. + # + # If + # [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] + # is specified, the corresponding DeployModel must have + # [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] + # populated. If + # [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] + # is not specified, all DeployedModels must have + # [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] + # populated. + rpc :Explain, ::Google::Cloud::AIPlatform::V1::ExplainRequest, ::Google::Cloud::AIPlatform::V1::ExplainResponse + # Generate content with multimodal inputs. + rpc :GenerateContent, ::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::Google::Cloud::AIPlatform::V1::GenerateContentResponse + # Generate content with multimodal inputs with streaming support. + rpc :StreamGenerateContent, ::Google::Cloud::AIPlatform::V1::GenerateContentRequest, stream(::Google::Cloud::AIPlatform::V1::GenerateContentResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb new file mode 100644 index 000000000000..ed5c07ce5dab --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/publisher_model.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/machine_resources_pb' +require 'google/cloud/aiplatform/v1/model_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/publisher_model.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a&google/cloud/aiplatform/v1/model.proto\"\xeb#\n\x0ePublisherModel\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\nversion_id\x18\x02 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12`\n\x14open_source_category\x18\x07 \x01(\x0e\x32=.google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategoryB\x03\xe0\x41\x02\x12W\n\x11supported_actions\x18\x13 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.PublisherModel.CallToActionB\x03\xe0\x41\x01\x12\x17\n\nframeworks\x18\x17 \x03(\tB\x03\xe0\x41\x01\x12Q\n\x0claunch_stage\x18\x1d \x01(\x0e\x32\x36.google.cloud.aiplatform.v1.PublisherModel.LaunchStageB\x03\xe0\x41\x01\x12S\n\rversion_state\x18% \x01(\x0e\x32\x37.google.cloud.aiplatform.v1.PublisherModel.VersionStateB\x03\xe0\x41\x01\x12(\n\x18publisher_model_template\x18\x1e \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12J\n\x10predict_schemata\x18\x1f \x01(\x0b\x32+.google.cloud.aiplatform.v1.PredictSchemataB\x03\xe0\x41\x01\x1a{\n\x11ResourceReference\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x17\n\rresource_name\x18\x02 \x01(\tH\x00\x12\x16\n\x08use_case\x18\x03 \x01(\tB\x02\x18\x01H\x00\x12\x19\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x02\x18\x01H\x00\x42\x0b\n\treference\x1a\x39\n\rDocumentation\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xf6\x19\n\x0c\x43\x61llToAction\x12_\n\rview_rest_api\x18\x01 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApiB\x03\xe0\x41\x01\x12n\n\ropen_notebook\x18\x02 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12g\n\x0eopen_notebooks\x18\x0c \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenNotebooksB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12s\n\x12\x63reate_application\x18\x03 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12z\n\x19open_fine_tuning_pipeline\x18\x04 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12}\n\x1aopen_fine_tuning_pipelines\x18\r \x01(\x0b\x32O.google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenFineTuningPipelinesB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12|\n\x1bopen_prompt_tuning_pipeline\x18\x05 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12k\n\nopen_genie\x18\x06 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12S\n\x06\x64\x65ploy\x18\x07 \x01(\x0b\x32>.google.cloud.aiplatform.v1.PublisherModel.CallToAction.DeployB\x03\xe0\x41\x01\x12Z\n\ndeploy_gke\x18\x0e \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.PublisherModel.CallToAction.DeployGkeB\x03\xe0\x41\x01\x12z\n\x19open_generation_ai_studio\x18\x08 \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12o\n\x0erequest_access\x18\t \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x12y\n\x18open_evaluation_pipeline\x18\x0b \x01(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x01\x1a\xcf\x03\n\x1aRegionalResourceReferences\x12{\n\nreferences\x18\x01 \x03(\x0b\x32\x62.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.ReferencesEntryB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12 \n\x0eresource_title\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12#\n\x11resource_use_case\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12&\n\x14resource_description\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x1ao\n\x0fReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0b\x32<.google.cloud.aiplatform.v1.PublisherModel.ResourceReference:\x02\x38\x01\x42\x11\n\x0f_resource_titleB\x14\n\x12_resource_use_caseB\x17\n\x15_resource_description\x1ax\n\x0bViewRestApi\x12U\n\x0e\x64ocumentations\x18\x01 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.PublisherModel.DocumentationB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a{\n\rOpenNotebooks\x12j\n\tnotebooks\x18\x01 \x03(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x02\x1a\x91\x01\n\x17OpenFineTuningPipelines\x12v\n\x15\x66ine_tuning_pipelines\x18\x01 \x03(\x0b\x32R.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferencesB\x03\xe0\x41\x02\x1a\xfc\x06\n\x06\x44\x65ploy\x12M\n\x13\x64\x65\x64icated_resources\x18\x05 \x01(\x0b\x32..google.cloud.aiplatform.v1.DedicatedResourcesH\x00\x12M\n\x13\x61utomatic_resources\x18\x06 \x01(\x0b\x32..google.cloud.aiplatform.v1.AutomaticResourcesH\x00\x12\x1a\n\x10shared_resources\x18\x07 \x01(\tH\x00\x12\x1f\n\x12model_display_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12S\n\x15large_model_reference\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.LargeModelReferenceB\x03\xe0\x41\x01\x12K\n\x0e\x63ontainer_spec\x18\x03 \x01(\x0b\x32..google.cloud.aiplatform.v1.ModelContainerSpecB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rtifact_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x10\x64\x65ploy_task_name\x18\n \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12p\n\x0f\x64\x65ploy_metadata\x18\x0b \x01(\x0b\x32M.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadataB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x12\n\x05title\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13public_artifact_uri\x18\t \x01(\tB\x03\xe0\x41\x01\x1a\xcc\x01\n\x0e\x44\x65ployMetadata\x12n\n\x06labels\x18\x01 \x03(\x0b\x32Y.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.LabelsEntryB\x03\xe0\x41\x01\x12\x1b\n\x0esample_request\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14prediction_resourcesB\x13\n\x11_deploy_task_nameB\x12\n\x10_deploy_metadata\x1a*\n\tDeployGke\x12\x1d\n\x10gke_yaml_configs\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x11\n\x0f_open_notebooksB\x1d\n\x1b_open_fine_tuning_pipelines\"\xdb\x01\n\x12OpenSourceCategory\x12$\n OPEN_SOURCE_CATEGORY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROPRIETARY\x10\x01\x12+\n\'GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT\x10\x02\x12\x30\n,THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT\x10\x03\x12\x14\n\x10GOOGLE_OWNED_OSS\x10\x04\x12\x19\n\x15THIRD_PARTY_OWNED_OSS\x10\x05\"n\n\x0bLaunchStage\x12\x1c\n\x18LAUNCH_STAGE_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x45XPERIMENTAL\x10\x01\x12\x13\n\x0fPRIVATE_PREVIEW\x10\x02\x12\x12\n\x0ePUBLIC_PREVIEW\x10\x03\x12\x06\n\x02GA\x10\x04\"c\n\x0cVersionState\x12\x1d\n\x19VERSION_STATE_UNSPECIFIED\x10\x00\x12\x18\n\x14VERSION_STATE_STABLE\x10\x01\x12\x1a\n\x16VERSION_STATE_UNSTABLE\x10\x02:T\xea\x41Q\n(aiplatform.googleapis.com/PublisherModel\x12%publishers/{publisher}/models/{model}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13PublisherModelProtoP\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.PredictSchemata", "google/cloud/aiplatform/v1/model.proto"], + ["google.cloud.aiplatform.v1.DedicatedResources", "google/cloud/aiplatform/v1/machine_resources.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 + PublisherModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel").msgclass + PublisherModel::ResourceReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.ResourceReference").msgclass + PublisherModel::Documentation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.Documentation").msgclass + PublisherModel::CallToAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction").msgclass + PublisherModel::CallToAction::RegionalResourceReferences = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences").msgclass + PublisherModel::CallToAction::ViewRestApi = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi").msgclass + PublisherModel::CallToAction::OpenNotebooks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenNotebooks").msgclass + PublisherModel::CallToAction::OpenFineTuningPipelines = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.OpenFineTuningPipelines").msgclass + PublisherModel::CallToAction::Deploy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy").msgclass + PublisherModel::CallToAction::Deploy::DeployMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata").msgclass + PublisherModel::CallToAction::DeployGke = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.CallToAction.DeployGke").msgclass + PublisherModel::OpenSourceCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory").enummodule + PublisherModel::LaunchStage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.LaunchStage").enummodule + PublisherModel::VersionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PublisherModel.VersionState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb new file mode 100644 index 000000000000..ebf635500040 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\nCgoogle/cloud/aiplatform/v1/reasoning_engine_execution_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa6\x01\n\x1bQueryReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x19\n\x0c\x63lass_method\x18\x03 \x01(\tB\x03\xe0\x41\x01\"F\n\x1cQueryReasoningEngineResponse\x12&\n\x06output\x18\x01 \x01(\x0b\x32\x16.google.protobuf.Value\"\xac\x01\n!StreamQueryReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x19\n\x0c\x63lass_method\x18\x03 \x01(\tB\x03\xe0\x41\x01\x32\x86\x04\n\x1fReasoningEngineExecutionService\x12\xd0\x01\n\x14QueryReasoningEngine\x12\x37.google.cloud.aiplatform.v1.QueryReasoningEngineRequest\x1a\x38.google.cloud.aiplatform.v1.QueryReasoningEngineResponse\"E\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/reasoningEngines/*}:query:\x01*\x12\xc0\x01\n\x1aStreamQueryReasoningEngine\x12=.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest\x1a\x14.google.api.HttpBody\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery:\x01*0\x01\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B$ReasoningEngineExecutionServiceProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + QueryReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryReasoningEngineRequest").msgclass + QueryReasoningEngineResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryReasoningEngineResponse").msgclass + StreamQueryReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb new file mode 100644 index 000000000000..ce8325112dfe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # A service for executing queries on Reasoning Engine. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ReasoningEngineExecutionService' + + # Queries using a reasoning engine. + rpc :QueryReasoningEngine, ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse + # Streams queries using a reasoning engine. + rpc :StreamQueryReasoningEngine, ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, stream(::Google::Api::HttpBody) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb new file mode 100644 index 000000000000..8059d41dd6e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/reasoning_engine.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x13ReasoningEngineSpec\x12V\n\x0cpackage_spec\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpecB\x03\xe0\x41\x02\x12\x33\n\rclass_methods\x18\x03 \x03(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\x98\x01\n\x0bPackageSpec\x12\"\n\x15pickle_object_gcs_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x64\x65pendency_files_gcs_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14requirements_gcs_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0epython_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xbe\x03\n\x0fReasoningEngine\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\x04spec\x18\x03 \x01(\x0b\x32/.google.cloud.aiplatform.v1.ReasoningEngineSpecB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x01:\x9f\x01\xea\x41\x9b\x01\n)aiplatform.googleapis.com/ReasoningEngine\x12Kprojects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}*\x10reasoningEngines2\x0freasoningEngineB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14ReasoningEngineProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + ReasoningEngineSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec").msgclass + ReasoningEngineSpec::PackageSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec").msgclass + ReasoningEngine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngine").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb new file mode 100644 index 000000000000..ef03facb120f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/cloud/aiplatform/v1/reasoning_engine_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n9google/cloud/aiplatform/v1/reasoning_engine_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a\x31google/cloud/aiplatform/v1/reasoning_engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa5\x01\n\x1c\x43reateReasoningEngineRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12J\n\x10reasoning_engine\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngineB\x03\xe0\x41\x02\"x\n&CreateReasoningEngineOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\\\n\x19GetReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\"\xa0\x01\n\x1cUpdateReasoningEngineRequest\x12J\n\x10reasoning_engine\x18\x01 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngineB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"x\n&UpdateReasoningEngineOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x9e\x01\n\x1bListReasoningEnginesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x1cListReasoningEnginesResponse\x12\x46\n\x11reasoning_engines\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngine\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1c\x44\x65leteReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine2\xaf\n\n\x16ReasoningEngineService\x12\x97\x02\n\x15\x43reateReasoningEngine\x12\x38.google.cloud.aiplatform.v1.CreateReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41\x39\n\x0fReasoningEngine\x12&CreateReasoningEngineOperationMetadata\xda\x41\x17parent,reasoning_engine\x82\xd3\xe4\x93\x02H\"4/v1/{parent=projects/*/locations/*}/reasoningEngines:\x10reasoning_engine\x12\xbd\x01\n\x12GetReasoningEngine\x12\x35.google.cloud.aiplatform.v1.GetReasoningEngineRequest\x1a+.google.cloud.aiplatform.v1.ReasoningEngine\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/reasoningEngines/*}\x12\xd0\x01\n\x14ListReasoningEngines\x12\x37.google.cloud.aiplatform.v1.ListReasoningEnginesRequest\x1a\x38.google.cloud.aiplatform.v1.ListReasoningEnginesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/reasoningEngines\x12\xad\x02\n\x15UpdateReasoningEngine\x12\x38.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41\x39\n\x0fReasoningEngine\x12&UpdateReasoningEngineOperationMetadata\xda\x41\x1creasoning_engine,update_mask\x82\xd3\xe4\x93\x02Y2E/v1/{reasoning_engine.name=projects/*/locations/*/reasoningEngines/*}:\x10reasoning_engine\x12\xe8\x01\n\x15\x44\x65leteReasoningEngine\x12\x38.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/reasoningEngines/*}\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1bReasoningEngineServiceProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.aiplatform.v1.ReasoningEngine", "google/cloud/aiplatform/v1/reasoning_engine.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + CreateReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateReasoningEngineRequest").msgclass + CreateReasoningEngineOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata").msgclass + GetReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetReasoningEngineRequest").msgclass + UpdateReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateReasoningEngineRequest").msgclass + UpdateReasoningEngineOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata").msgclass + ListReasoningEnginesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListReasoningEnginesRequest").msgclass + ListReasoningEnginesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListReasoningEnginesResponse").msgclass + DeleteReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteReasoningEngineRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb new file mode 100644 index 000000000000..697fdd08ee07 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/reasoning_engine_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/reasoning_engine_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # A service for managing Vertex AI's Reasoning Engines. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ReasoningEngineService' + + # Creates a reasoning engine. + rpc :CreateReasoningEngine, ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Google::Longrunning::Operation + # Gets a reasoning engine. + rpc :GetReasoningEngine, ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Google::Cloud::AIPlatform::V1::ReasoningEngine + # Lists reasoning engines in a location. + rpc :ListReasoningEngines, ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse + # Updates a reasoning engine. + rpc :UpdateReasoningEngine, ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Google::Longrunning::Operation + # Deletes a reasoning engine. + rpc :DeleteReasoningEngine, ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reservation_affinity_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reservation_affinity_pb.rb new file mode 100644 index 000000000000..0a8419970acb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reservation_affinity_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reservation_affinity.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n5google/cloud/aiplatform/v1/reservation_affinity.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa2\x02\n\x13ReservationAffinity\x12\\\n\x19reservation_affinity_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.aiplatform.v1.ReservationAffinity.TypeB\x03\xe0\x41\x02\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12:\n\x06values\x18\x03 \x03(\tB*\xe0\x41\x01\xfa\x41$\n\"compute.googleapis.com/Reservation\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x42\xcb\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x18ReservationAffinityProtoP\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\x41r\n\"compute.googleapis.com/Reservation\x12Lprojects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}b\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 = [ + ] + 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 + ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReservationAffinity").msgclass + ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReservationAffinity.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/saved_query_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/saved_query_pb.rb new file mode 100644 index 000000000000..389264cb654a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/saved_query_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/saved_query.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/aiplatform/v1/saved_query.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x03\n\nSavedQuery\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12(\n\x08metadata\x18\x0c \x01(\x0b\x32\x16.google.protobuf.Value\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\x1e\n\x11\x61nnotation_filter\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cproblem_type\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15\x61nnotation_spec_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x08 \x01(\t\x12$\n\x17support_automl_training\x18\t \x01(\x08\x42\x03\xe0\x41\x03:\x80\x01\xea\x41}\n$aiplatform.googleapis.com/SavedQuery\x12Uprojects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}B\xcd\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0fSavedQueryProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + SavedQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SavedQuery").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_pb.rb new file mode 100644 index 000000000000..05b87a54a6a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/schedule.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/notebook_service_pb' +require 'google/cloud/aiplatform/v1/pipeline_service_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/aiplatform/v1/schedule.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/aiplatform/v1/notebook_service.proto\x1a\x31google/cloud/aiplatform/v1/pipeline_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\t\n\x08Schedule\x12\x0e\n\x04\x63ron\x18\n \x01(\tH\x00\x12[\n\x1b\x63reate_pipeline_job_request\x18\x0e \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.CreatePipelineJobRequestH\x01\x12n\n%create_notebook_execution_job_request\x18\x14 \x01(\x0b\x32=.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequestH\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x31\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x1a\n\rmax_run_count\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11started_run_count\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12>\n\x05state\x18\x05 \x01(\x0e\x32*.google.cloud.aiplatform.v1.Schedule.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rnext_run_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x0flast_pause_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10last_resume_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12%\n\x18max_concurrent_run_count\x18\x0b \x01(\x03\x42\x03\xe0\x41\x02\x12\x1b\n\x0e\x61llow_queueing\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08\x63\x61tch_up\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12Z\n\x1blast_scheduled_run_response\x18\x12 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.Schedule.RunResponseB\x03\xe0\x41\x03\x1a[\n\x0bRunResponse\x12\x36\n\x12scheduled_run_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0crun_response\x18\x02 \x01(\t\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\r\n\tCOMPLETED\x10\x03:e\xea\x41\x62\n\"aiplatform.googleapis.com/Schedule\x12cloud.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.CreatePipelineJobRequest", "google/cloud/aiplatform/v1/pipeline_service.proto"], + ["google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest", "google/cloud/aiplatform/v1/notebook_service.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Schedule").msgclass + Schedule::RunResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Schedule.RunResponse").msgclass + Schedule::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Schedule.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb new file mode 100644 index 000000000000..81523f1a1817 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/schedule_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/schedule_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/schedule_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/schedule.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x15\x43reateScheduleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12;\n\x08schedule\x18\x02 \x01(\x0b\x32$.google.cloud.aiplatform.v1.ScheduleB\x03\xe0\x41\x02\"N\n\x12GetScheduleRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Schedule\"\x9a\x01\n\x14ListSchedulesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"i\n\x15ListSchedulesResponse\x12\x37\n\tschedules\x18\x01 \x03(\x0b\x32$.google.cloud.aiplatform.v1.Schedule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Q\n\x15\x44\x65leteScheduleRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Schedule\"P\n\x14PauseScheduleRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Schedule\"h\n\x15ResumeScheduleRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Schedule\x12\x15\n\x08\x63\x61tch_up\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x01\n\x15UpdateScheduleRequest\x12;\n\x08schedule\x18\x01 \x01(\x0b\x32$.google.cloud.aiplatform.v1.ScheduleB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x32\xf6\n\n\x0fScheduleService\x12\xbc\x01\n\x0e\x43reateSchedule\x12\x31.google.cloud.aiplatform.v1.CreateScheduleRequest\x1a$.google.cloud.aiplatform.v1.Schedule\"Q\xda\x41\x0fparent,schedule\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/schedules:\x08schedule\x12\xd3\x01\n\x0e\x44\x65leteSchedule\x12\x31.google.cloud.aiplatform.v1.DeleteScheduleRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/schedules/*}\x12\xa1\x01\n\x0bGetSchedule\x12..google.cloud.aiplatform.v1.GetScheduleRequest\x1a$.google.cloud.aiplatform.v1.Schedule\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/schedules/*}\x12\xb4\x01\n\rListSchedules\x12\x30.google.cloud.aiplatform.v1.ListSchedulesRequest\x1a\x31.google.cloud.aiplatform.v1.ListSchedulesResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/schedules\x12\xa0\x01\n\rPauseSchedule\x12\x30.google.cloud.aiplatform.v1.PauseScheduleRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/schedules/*}:pause:\x01*\x12\xb3\x01\n\x0eResumeSchedule\x12\x31.google.cloud.aiplatform.v1.ResumeScheduleRequest\x1a\x16.google.protobuf.Empty\"V\xda\x41\x04name\xda\x41\rname,catch_up\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/schedules/*}:resume:\x01*\x12\xca\x01\n\x0eUpdateSchedule\x12\x31.google.cloud.aiplatform.v1.UpdateScheduleRequest\x1a$.google.cloud.aiplatform.v1.Schedule\"_\xda\x41\x14schedule,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{schedule.name=projects/*/locations/*/schedules/*}:\x08schedule\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14ScheduleServiceProtoP\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.Schedule", "google/cloud/aiplatform/v1/schedule.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 + CreateScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateScheduleRequest").msgclass + GetScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetScheduleRequest").msgclass + ListSchedulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSchedulesRequest").msgclass + ListSchedulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSchedulesResponse").msgclass + DeleteScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteScheduleRequest").msgclass + PauseScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PauseScheduleRequest").msgclass + ResumeScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ResumeScheduleRequest").msgclass + UpdateScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateScheduleRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb new file mode 100644 index 000000000000..fd41382268af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/schedule_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/schedule_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ScheduleService + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ScheduleService' + + # Creates a Schedule. + rpc :CreateSchedule, ::Google::Cloud::AIPlatform::V1::CreateScheduleRequest, ::Google::Cloud::AIPlatform::V1::Schedule + # Deletes a Schedule. + rpc :DeleteSchedule, ::Google::Cloud::AIPlatform::V1::DeleteScheduleRequest, ::Google::Longrunning::Operation + # Gets a Schedule. + rpc :GetSchedule, ::Google::Cloud::AIPlatform::V1::GetScheduleRequest, ::Google::Cloud::AIPlatform::V1::Schedule + # Lists Schedules in a Location. + rpc :ListSchedules, ::Google::Cloud::AIPlatform::V1::ListSchedulesRequest, ::Google::Cloud::AIPlatform::V1::ListSchedulesResponse + # Pauses a Schedule. Will mark + # [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If + # the schedule is paused, no new runs will be created. Already created runs + # will NOT be paused or canceled. + rpc :PauseSchedule, ::Google::Cloud::AIPlatform::V1::PauseScheduleRequest, ::Google::Protobuf::Empty + # Resumes a paused Schedule to start scheduling new runs. Will mark + # [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'. + # Only paused Schedule can be resumed. + # + # When the Schedule is resumed, new runs will be scheduled starting from the + # next execution time after the current time based on the time_specification + # in the Schedule. If + # [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] is set up + # true, all missed runs will be scheduled for backfill first. + rpc :ResumeSchedule, ::Google::Cloud::AIPlatform::V1::ResumeScheduleRequest, ::Google::Protobuf::Empty + # Updates an active or paused Schedule. + # + # When the Schedule is updated, new runs will be scheduled starting from the + # updated next execution time after the update time based on the + # time_specification in the updated Schedule. All unstarted runs before the + # update time will be skipped while already created runs will NOT be paused + # or canceled. + rpc :UpdateSchedule, ::Google::Cloud::AIPlatform::V1::UpdateScheduleRequest, ::Google::Cloud::AIPlatform::V1::Schedule + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/service_networking_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/service_networking_pb.rb new file mode 100644 index 000000000000..af6abc50654a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/service_networking_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/service_networking.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/service_networking.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"D\n\x13PSCAutomationConfig\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x86\x01\n\x1bPrivateServiceConnectConfig\x12+\n\x1e\x65nable_private_service_connect\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12\x19\n\x11project_allowlist\x18\x02 \x03(\t\x12\x1f\n\x12service_attachment\x18\x05 \x01(\tB\x03\xe0\x41\x03\"S\n\x15PscAutomatedEndpoints\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rmatch_address\x18\x03 \x01(\tB\xcd\x02\n\x1e\x63om.google.cloud.aiplatform.v1B\x16ServiceNetworkingProtoP\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\x41v\n(compute.googleapis.com/NetworkAttachment\x12Jprojects/{project}/regions/{region}/networkAttachments/{networkattachment}b\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 = [ + ] + 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 + PSCAutomationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PSCAutomationConfig").msgclass + PrivateServiceConnectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PrivateServiceConnectConfig").msgclass + PscAutomatedEndpoints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PscAutomatedEndpoints").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb new file mode 100644 index 000000000000..792b08d705d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/specialist_pool.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/specialist_pool.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xce\x02\n\x0eSpecialistPool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12&\n\x19specialist_managers_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12!\n\x19specialist_manager_emails\x18\x04 \x03(\t\x12\'\n\x1apending_data_labeling_jobs\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12 \n\x18specialist_worker_emails\x18\x07 \x03(\t:x\xea\x41u\n(aiplatform.googleapis.com/SpecialistPool\x12Iprojects/{project}/locations/{location}/specialistPools/{specialist_pool}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13SpecialistPoolProtoP\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 = [ + ] + 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 + SpecialistPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SpecialistPool").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb new file mode 100644 index 000000000000..bd1aaf5a7ad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/specialist_pool_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/specialist_pool_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n8google/cloud/aiplatform/v1/specialist_pool_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\x30google/cloud/aiplatform/v1/specialist_pool.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa2\x01\n\x1b\x43reateSpecialistPoolRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12H\n\x0fspecialist_pool\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.SpecialistPoolB\x03\xe0\x41\x02\"w\n%CreateSpecialistPoolOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"Z\n\x18GetSpecialistPoolRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/SpecialistPool\"\xad\x01\n\x1aListSpecialistPoolsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12-\n\tread_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"|\n\x1bListSpecialistPoolsResponse\x12\x44\n\x10specialist_pools\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.SpecialistPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"l\n\x1b\x44\x65leteSpecialistPoolRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/SpecialistPool\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x9d\x01\n\x1bUpdateSpecialistPoolRequest\x12H\n\x0fspecialist_pool\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.SpecialistPoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xc2\x01\n%UpdateSpecialistPoolOperationMetadata\x12I\n\x0fspecialist_pool\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(aiplatform.googleapis.com/SpecialistPool\x12N\n\x10generic_metadata\x18\x02 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\x94\n\n\x15SpecialistPoolService\x12\x90\x02\n\x14\x43reateSpecialistPool\x12\x37.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x37\n\x0eSpecialistPool\x12%CreateSpecialistPoolOperationMetadata\xda\x41\x16parent,specialist_pool\x82\xd3\xe4\x93\x02\x46\"3/v1/{parent=projects/*/locations/*}/specialistPools:\x0fspecialist_pool\x12\xb9\x01\n\x11GetSpecialistPool\x12\x34.google.cloud.aiplatform.v1.GetSpecialistPoolRequest\x1a*.google.cloud.aiplatform.v1.SpecialistPool\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/specialistPools/*}\x12\xcc\x01\n\x13ListSpecialistPools\x12\x36.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest\x1a\x37.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/locations/*}/specialistPools\x12\xe5\x01\n\x14\x44\x65leteSpecialistPool\x12\x37.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/locations/*/specialistPools/*}\x12\xa5\x02\n\x14UpdateSpecialistPool\x12\x37.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41\x37\n\x0eSpecialistPool\x12%UpdateSpecialistPoolOperationMetadata\xda\x41\x1bspecialist_pool,update_mask\x82\xd3\xe4\x93\x02V2C/v1/{specialist_pool.name=projects/*/locations/*/specialistPools/*}:\x0fspecialist_pool\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1aSpecialistPoolServiceProtoP\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.SpecialistPool", "google/cloud/aiplatform/v1/specialist_pool.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 + CreateSpecialistPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateSpecialistPoolRequest").msgclass + CreateSpecialistPoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata").msgclass + GetSpecialistPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetSpecialistPoolRequest").msgclass + ListSpecialistPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSpecialistPoolsRequest").msgclass + ListSpecialistPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSpecialistPoolsResponse").msgclass + DeleteSpecialistPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest").msgclass + UpdateSpecialistPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest").msgclass + UpdateSpecialistPoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_services_pb.rb new file mode 100644 index 000000000000..9f03f84abb99 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/specialist_pool_service_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/specialist_pool_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/specialist_pool_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module SpecialistPoolService + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.SpecialistPoolService' + + # Creates a SpecialistPool. + rpc :CreateSpecialistPool, ::Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest, ::Google::Longrunning::Operation + # Gets a SpecialistPool. + rpc :GetSpecialistPool, ::Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest, ::Google::Cloud::AIPlatform::V1::SpecialistPool + # Lists SpecialistPools in a Location. + rpc :ListSpecialistPools, ::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest, ::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse + # Deletes a SpecialistPool as well as all Specialists in the pool. + rpc :DeleteSpecialistPool, ::Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest, ::Google::Longrunning::Operation + # Updates a SpecialistPool. + rpc :UpdateSpecialistPool, ::Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/study_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/study_pb.rb new file mode 100644 index 000000000000..ab69ed7bc4af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/study_pb.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/study.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/study.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xae\x03\n\x05Study\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\nstudy_spec\x18\x03 \x01(\x0b\x32%.google.cloud.aiplatform.v1.StudySpecB\x03\xe0\x41\x02\x12;\n\x05state\x18\x04 \x01(\x0e\x32\'.google.cloud.aiplatform.v1.Study.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0finactive_reason\x18\x06 \x01(\tB\x03\xe0\x41\x03\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\x12\r\n\tCOMPLETED\x10\x03:]\xea\x41Z\n\x1f\x61iplatform.googleapis.com/Study\x12\x37projects/{project}/locations/{location}/studies/{study}\"\xd0\x07\n\x05Trial\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12;\n\x05state\x18\x03 \x01(\x0e\x32\'.google.cloud.aiplatform.v1.Trial.StateB\x03\xe0\x41\x03\x12\x44\n\nparameters\x18\x04 \x03(\x0b\x32+.google.cloud.aiplatform.v1.Trial.ParameterB\x03\xe0\x41\x03\x12G\n\x11\x66inal_measurement\x18\x05 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MeasurementB\x03\xe0\x41\x03\x12\x42\n\x0cmeasurements\x18\x06 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.MeasurementB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x16\n\tclient_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11infeasible_reason\x18\n \x01(\tB\x03\xe0\x41\x03\x12?\n\ncustom_job\x18\x0b \x01(\tB+\xe0\x41\x03\xfa\x41%\n#aiplatform.googleapis.com/CustomJob\x12R\n\x0fweb_access_uris\x18\x0c \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.Trial.WebAccessUrisEntryB\x03\xe0\x41\x03\x1aR\n\tParameter\x12\x19\n\x0cparameter_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x1a\x34\n\x12WebAccessUrisEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tREQUESTED\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\x0e\n\nINFEASIBLE\x10\x05:l\xea\x41i\n\x1f\x61iplatform.googleapis.com/Trial\x12\x46projects/{project}/locations/{location}/studies/{study}/trials/{trial}\"d\n\x0cTrialContext\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12?\n\nparameters\x18\x02 \x03(\x0b\x32+.google.cloud.aiplatform.v1.Trial.Parameter\"\x86\x01\n\x13StudyTimeConstraint\x12\x31\n\x0cmax_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12.\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x0c\n\nconstraint\"\xd7!\n\tStudySpec\x12j\n\x19\x64\x65\x63\x61y_curve_stopping_spec\x18\x04 \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.StudySpec.DecayCurveAutomatedStoppingSpecH\x00\x12k\n\x1emedian_automated_stopping_spec\x18\x05 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.StudySpec.MedianAutomatedStoppingSpecH\x00\x12k\n\x1e\x63onvex_automated_stopping_spec\x18\t \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.StudySpec.ConvexAutomatedStoppingSpecH\x00\x12\x46\n\x07metrics\x18\x01 \x03(\x0b\x32\x30.google.cloud.aiplatform.v1.StudySpec.MetricSpecB\x03\xe0\x41\x02\x12L\n\nparameters\x18\x02 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.StudySpec.ParameterSpecB\x03\xe0\x41\x02\x12\x42\n\talgorithm\x18\x03 \x01(\x0e\x32/.google.cloud.aiplatform.v1.StudySpec.Algorithm\x12Q\n\x11observation_noise\x18\x06 \x01(\x0e\x32\x36.google.cloud.aiplatform.v1.StudySpec.ObservationNoise\x12\x62\n\x1ameasurement_selection_type\x18\x07 \x01(\x0e\x32>.google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType\x12]\n\x15study_stopping_config\x18\x0b \x01(\x0b\x32\x39.google.cloud.aiplatform.v1.StudySpec.StudyStoppingConfigH\x01\x88\x01\x01\x1a\xad\x03\n\nMetricSpec\x12\x16\n\tmetric_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x04goal\x18\x02 \x01(\x0e\x32\x39.google.cloud.aiplatform.v1.StudySpec.MetricSpec.GoalTypeB\x03\xe0\x41\x02\x12_\n\rsafety_config\x18\x03 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.StudySpec.MetricSpec.SafetyMetricConfigH\x00\x88\x01\x01\x1a\x82\x01\n\x12SafetyMetricConfig\x12\x18\n\x10safety_threshold\x18\x01 \x01(\x01\x12-\n desired_min_safe_trials_fraction\x18\x02 \x01(\x01H\x00\x88\x01\x01\x42#\n!_desired_min_safe_trials_fraction\"A\n\x08GoalType\x12\x19\n\x15GOAL_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08MAXIMIZE\x10\x01\x12\x0c\n\x08MINIMIZE\x10\x02\x42\x10\n\x0e_safety_config\x1a\xcd\x0e\n\rParameterSpec\x12`\n\x11\x64ouble_value_spec\x18\x02 \x01(\x0b\x32\x43.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DoubleValueSpecH\x00\x12\x62\n\x12integer_value_spec\x18\x03 \x01(\x0b\x32\x44.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.IntegerValueSpecH\x00\x12j\n\x16\x63\x61tegorical_value_spec\x18\x04 \x01(\x0b\x32H.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.CategoricalValueSpecH\x00\x12\x64\n\x13\x64iscrete_value_spec\x18\x05 \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DiscreteValueSpecH\x00\x12\x19\n\x0cparameter_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Q\n\nscale_type\x18\x06 \x01(\x0e\x32=.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType\x12q\n\x1b\x63onditional_parameter_specs\x18\n \x03(\x0b\x32L.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec\x1ao\n\x0f\x44oubleValueSpec\x12\x16\n\tmin_value\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12\x16\n\tmax_value\x18\x02 \x01(\x01\x42\x03\xe0\x41\x02\x12\x1a\n\rdefault_value\x18\x04 \x01(\x01H\x00\x88\x01\x01\x42\x10\n\x0e_default_value\x1ap\n\x10IntegerValueSpec\x12\x16\n\tmin_value\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x16\n\tmax_value\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12\x1a\n\rdefault_value\x18\x04 \x01(\x03H\x00\x88\x01\x01\x42\x10\n\x0e_default_value\x1aY\n\x14\x43\x61tegoricalValueSpec\x12\x13\n\x06values\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\rdefault_value\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x10\n\x0e_default_value\x1aV\n\x11\x44iscreteValueSpec\x12\x13\n\x06values\x18\x01 \x03(\x01\x42\x03\xe0\x41\x02\x12\x1a\n\rdefault_value\x18\x03 \x01(\x01H\x00\x88\x01\x01\x42\x10\n\x0e_default_value\x1a\xa4\x05\n\x18\x43onditionalParameterSpec\x12\x85\x01\n\x16parent_discrete_values\x18\x02 \x01(\x0b\x32\x63.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.DiscreteValueConditionH\x00\x12{\n\x11parent_int_values\x18\x03 \x01(\x0b\x32^.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.IntValueConditionH\x00\x12\x8b\x01\n\x19parent_categorical_values\x18\x04 \x01(\x0b\x32\x66.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.CategoricalValueConditionH\x00\x12P\n\x0eparameter_spec\x18\x01 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.StudySpec.ParameterSpecB\x03\xe0\x41\x02\x1a-\n\x16\x44iscreteValueCondition\x12\x13\n\x06values\x18\x01 \x03(\x01\x42\x03\xe0\x41\x02\x1a(\n\x11IntValueCondition\x12\x13\n\x06values\x18\x01 \x03(\x03\x42\x03\xe0\x41\x02\x1a\x30\n\x19\x43\x61tegoricalValueCondition\x12\x13\n\x06values\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x18\n\x16parent_value_condition\"n\n\tScaleType\x12\x1a\n\x16SCALE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11UNIT_LINEAR_SCALE\x10\x01\x12\x12\n\x0eUNIT_LOG_SCALE\x10\x02\x12\x1a\n\x16UNIT_REVERSE_LOG_SCALE\x10\x03\x42\x16\n\x14parameter_value_spec\x1a?\n\x1f\x44\x65\x63\x61yCurveAutomatedStoppingSpec\x12\x1c\n\x14use_elapsed_duration\x18\x01 \x01(\x08\x1a;\n\x1bMedianAutomatedStoppingSpec\x12\x1c\n\x14use_elapsed_duration\x18\x01 \x01(\x08\x1a\xf6\x01\n\x1b\x43onvexAutomatedStoppingSpec\x12\x16\n\x0emax_step_count\x18\x01 \x01(\x03\x12\x16\n\x0emin_step_count\x18\x02 \x01(\x03\x12\x1d\n\x15min_measurement_count\x18\x03 \x01(\x03\x12$\n\x1clearning_rate_parameter_name\x18\x04 \x01(\t\x12\x1c\n\x14use_elapsed_duration\x18\x05 \x01(\x08\x12&\n\x19update_all_stopped_trials\x18\x06 \x01(\x08H\x00\x88\x01\x01\x42\x1c\n\x1a_update_all_stopped_trials\x1a\xdd\x03\n\x13StudyStoppingConfig\x12\x34\n\x10should_stop_asap\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12S\n\x1aminimum_runtime_constraint\x18\x02 \x01(\x0b\x32/.google.cloud.aiplatform.v1.StudyTimeConstraint\x12S\n\x1amaximum_runtime_constraint\x18\x03 \x01(\x0b\x32/.google.cloud.aiplatform.v1.StudyTimeConstraint\x12\x33\n\x0emin_num_trials\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x33\n\x0emax_num_trials\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12?\n\x1amax_num_trials_no_progress\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12;\n\x18max_duration_no_progress\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\"J\n\tAlgorithm\x12\x19\n\x15\x41LGORITHM_UNSPECIFIED\x10\x00\x12\x0f\n\x0bGRID_SEARCH\x10\x02\x12\x11\n\rRANDOM_SEARCH\x10\x03\"H\n\x10ObservationNoise\x12!\n\x1dOBSERVATION_NOISE_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\x08\n\x04HIGH\x10\x02\"r\n\x18MeasurementSelectionType\x12*\n&MEASUREMENT_SELECTION_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10LAST_MEASUREMENT\x10\x01\x12\x14\n\x10\x42\x45ST_MEASUREMENT\x10\x02\x42\x19\n\x17\x61utomated_stopping_specB\x18\n\x16_study_stopping_config\"\xdc\x01\n\x0bMeasurement\x12\x38\n\x10\x65lapsed_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x17\n\nstep_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x44\n\x07metrics\x18\x03 \x03(\x0b\x32..google.cloud.aiplatform.v1.Measurement.MetricB\x03\xe0\x41\x03\x1a\x34\n\x06Metric\x12\x16\n\tmetric_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05value\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\x42\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nStudyProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.BoolValue", "google/protobuf/wrappers.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 + Study = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Study").msgclass + Study::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Study.State").enummodule + Trial = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Trial").msgclass + Trial::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Trial.Parameter").msgclass + Trial::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Trial.State").enummodule + TrialContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TrialContext").msgclass + StudyTimeConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudyTimeConstraint").msgclass + StudySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec").msgclass + StudySpec::MetricSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.MetricSpec").msgclass + StudySpec::MetricSpec::SafetyMetricConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.MetricSpec.SafetyMetricConfig").msgclass + StudySpec::MetricSpec::GoalType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.MetricSpec.GoalType").enummodule + StudySpec::ParameterSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec").msgclass + StudySpec::ParameterSpec::DoubleValueSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DoubleValueSpec").msgclass + StudySpec::ParameterSpec::IntegerValueSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.IntegerValueSpec").msgclass + StudySpec::ParameterSpec::CategoricalValueSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.CategoricalValueSpec").msgclass + StudySpec::ParameterSpec::DiscreteValueSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DiscreteValueSpec").msgclass + StudySpec::ParameterSpec::ConditionalParameterSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec").msgclass + StudySpec::ParameterSpec::ConditionalParameterSpec::DiscreteValueCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.DiscreteValueCondition").msgclass + StudySpec::ParameterSpec::ConditionalParameterSpec::IntValueCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.IntValueCondition").msgclass + StudySpec::ParameterSpec::ConditionalParameterSpec::CategoricalValueCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.CategoricalValueCondition").msgclass + StudySpec::ParameterSpec::ScaleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType").enummodule + StudySpec::DecayCurveAutomatedStoppingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.DecayCurveAutomatedStoppingSpec").msgclass + StudySpec::MedianAutomatedStoppingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.MedianAutomatedStoppingSpec").msgclass + StudySpec::ConvexAutomatedStoppingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ConvexAutomatedStoppingSpec").msgclass + StudySpec::StudyStoppingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.StudyStoppingConfig").msgclass + StudySpec::Algorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.Algorithm").enummodule + StudySpec::ObservationNoise = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.ObservationNoise").enummodule + StudySpec::MeasurementSelectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType").enummodule + Measurement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Measurement").msgclass + Measurement::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Measurement.Metric").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb new file mode 100644 index 000000000000..2d9cf994854c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard_data.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/tensorboard_time_series_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/tensorboard_data.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x38google/cloud/aiplatform/v1/tensorboard_time_series.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\x01\n\x0eTimeSeriesData\x12\'\n\x1atensorboard_time_series_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12W\n\nvalue_type\x18\x02 \x01(\x0e\x32;.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x44\n\x06values\x18\x03 \x03(\x0b\x32/.google.cloud.aiplatform.v1.TimeSeriesDataPointB\x03\xe0\x41\x02\"\x98\x02\n\x13TimeSeriesDataPoint\x12\x34\n\x06scalar\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.ScalarH\x00\x12?\n\x06tensor\x18\x04 \x01(\x0b\x32-.google.cloud.aiplatform.v1.TensorboardTensorH\x00\x12\x44\n\x05\x62lobs\x18\x05 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.TensorboardBlobSequenceH\x00\x12-\n\twall_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04step\x18\x02 \x01(\x03\x42\x07\n\x05value\"\x17\n\x06Scalar\x12\r\n\x05value\x18\x01 \x01(\x01\"D\n\x11TensorboardTensor\x12\x12\n\x05value\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x1b\n\x0eversion_number\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"V\n\x17TensorboardBlobSequence\x12;\n\x06values\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.TensorboardBlob\"5\n\x0fTensorboardBlob\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x42\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14TensorboardDataProtoP\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"], + ] + 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 + TimeSeriesData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TimeSeriesData").msgclass + TimeSeriesDataPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TimeSeriesDataPoint").msgclass + Scalar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Scalar").msgclass + TensorboardTensor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardTensor").msgclass + TensorboardBlobSequence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardBlobSequence").msgclass + TensorboardBlob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardBlob").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb new file mode 100644 index 000000000000..30e41c1bee0e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard_experiment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n7google/cloud/aiplatform/v1/tensorboard_experiment.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf7\x03\n\x15TensorboardExperiment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\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\x12M\n\x06labels\x18\x06 \x03(\x0b\x32=.google.cloud.aiplatform.v1.TensorboardExperiment.LabelsEntry\x12\x0c\n\x04\x65tag\x18\x07 \x01(\t\x12\x13\n\x06source\x18\x08 \x01(\tB\x03\xe0\x41\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x92\x01\xea\x41\x8e\x01\n/aiplatform.googleapis.com/TensorboardExperiment\x12[projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}B\xd8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1aTensorboardExperimentProtoP\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"], + ] + 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 + TensorboardExperiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardExperiment").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb new file mode 100644 index 000000000000..88184181d008 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/aiplatform/v1/tensorboard.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\x1fgoogle/protobuf/timestamp.proto\"\xfe\x04\n\x0bTensorboard\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x43\n\x0f\x65ncryption_spec\x18\x0b \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12%\n\x18\x62lob_storage_path_prefix\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x16\n\trun_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x08 \x03(\x0b\x32\x33.google.cloud.aiplatform.v1.Tensorboard.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x12\n\nis_default\x18\x0c \x01(\x08\x12\x1a\n\rsatisfies_pzs\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:n\xea\x41k\n%aiplatform.googleapis.com/Tensorboard\x12\x42projects/{project}/locations/{location}/tensorboards/{tensorboard}B\xce\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x10TensorboardProtoP\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.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + Tensorboard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Tensorboard").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb new file mode 100644 index 000000000000..4bc320fe2e46 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard_run.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/tensorboard_run.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdd\x03\n\x0eTensorboardRun\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x08 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.TensorboardRun.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n(aiplatform.googleapis.com/TensorboardRun\x12\x66projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}B\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13TensorboardRunProtoP\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"], + ] + 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 + TensorboardRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardRun").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb new file mode 100644 index 000000000000..9d022474f786 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard_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/tensorboard_pb' +require 'google/cloud/aiplatform/v1/tensorboard_data_pb' +require 'google/cloud/aiplatform/v1/tensorboard_experiment_pb' +require 'google/cloud/aiplatform/v1/tensorboard_run_pb' +require 'google/cloud/aiplatform/v1/tensorboard_time_series_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n4google/cloud/aiplatform/v1/tensorboard_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/tensorboard.proto\x1a\x31google/cloud/aiplatform/v1/tensorboard_data.proto\x1a\x37google/cloud/aiplatform/v1/tensorboard_experiment.proto\x1a\x30google/cloud/aiplatform/v1/tensorboard_run.proto\x1a\x38google/cloud/aiplatform/v1/tensorboard_time_series.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9c\x01\n\x18\x43reateTensorboardRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\x12\x41\n\x0btensorboard\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.TensorboardB\x03\xe0\x41\x02\"T\n\x15GetTensorboardRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\"\xd0\x01\n\x17ListTensorboardsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%aiplatform.googleapis.com/Tensorboard\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"r\n\x18ListTensorboardsResponse\x12=\n\x0ctensorboards\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.Tensorboard\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x18UpdateTensorboardRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x41\n\x0btensorboard\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.TensorboardB\x03\xe0\x41\x02\"W\n\x18\x44\x65leteTensorboardRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\"a\n\x1bReadTensorboardUsageRequest\x12\x42\n\x0btensorboard\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\"\xc3\x03\n\x1cReadTensorboardUsageResponse\x12j\n\x12monthly_usage_data\x18\x01 \x03(\x0b\x32N.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.MonthlyUsageDataEntry\x1a\x38\n\x10PerUserUsageData\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x12\n\nview_count\x18\x02 \x01(\x03\x1aw\n\x11PerMonthUsageData\x12\x62\n\x0fuser_usage_data\x18\x01 \x03(\x0b\x32I.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData\x1a\x83\x01\n\x15MonthlyUsageDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Y\n\x05value\x18\x02 \x01(\x0b\x32J.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData:\x02\x38\x01\"`\n\x1aReadTensorboardSizeRequest\x12\x42\n\x0btensorboard\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\"8\n\x1bReadTensorboardSizeResponse\x12\x19\n\x11storage_size_byte\x18\x01 \x01(\x03\"\xe8\x01\n\"CreateTensorboardExperimentRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\x12Q\n\x16tensorboard_experiment\x18\x02 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardExperiment\x12&\n\x19tensorboard_experiment_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"h\n\x1fGetTensorboardExperimentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\"\xe4\x01\n!ListTensorboardExperimentsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/aiplatform.googleapis.com/TensorboardExperiment\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x91\x01\n\"ListTensorboardExperimentsResponse\x12R\n\x17tensorboard_experiments\x18\x01 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardExperiment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb2\x01\n\"UpdateTensorboardExperimentRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12V\n\x16tensorboard_experiment\x18\x02 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardExperimentB\x03\xe0\x41\x02\"k\n\"DeleteTensorboardExperimentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\"\xbc\x01\n!BatchCreateTensorboardRunsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\x12N\n\x08requests\x18\x02 \x03(\x0b\x32\x37.google.cloud.aiplatform.v1.CreateTensorboardRunRequestB\x03\xe0\x41\x02\"j\n\"BatchCreateTensorboardRunsResponse\x12\x44\n\x10tensorboard_runs\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.TensorboardRun\"\xca\x01\n\x1b\x43reateTensorboardRunRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/TensorboardRun\x12H\n\x0ftensorboard_run\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.TensorboardRunB\x03\xe0\x41\x02\x12\x1f\n\x12tensorboard_run_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"Z\n\x18GetTensorboardRunRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/TensorboardRun\"\x80\x01\n\x1eReadTensorboardBlobDataRequest\x12L\n\x0btime_series\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\x12\x10\n\x08\x62lob_ids\x18\x02 \x03(\t\"]\n\x1fReadTensorboardBlobDataResponse\x12:\n\x05\x62lobs\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.TensorboardBlob\"\xd6\x01\n\x1aListTensorboardRunsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(aiplatform.googleapis.com/TensorboardRun\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"|\n\x1bListTensorboardRunsResponse\x12\x44\n\x10tensorboard_runs\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.TensorboardRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9d\x01\n\x1bUpdateTensorboardRunRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12H\n\x0ftensorboard_run\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.TensorboardRunB\x03\xe0\x41\x02\"]\n\x1b\x44\x65leteTensorboardRunRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/TensorboardRun\"\xc9\x01\n\'BatchCreateTensorboardTimeSeriesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\x12U\n\x08requests\x18\x02 \x03(\x0b\x32>.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequestB\x03\xe0\x41\x02\"~\n(BatchCreateTensorboardTimeSeriesResponse\x12R\n\x17tensorboard_time_series\x18\x01 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardTimeSeries\"\xef\x01\n\"CreateTensorboardTimeSeriesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\x12\'\n\x1atensorboard_time_series_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12W\n\x17tensorboard_time_series\x18\x02 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardTimeSeriesB\x03\xe0\x41\x02\"h\n\x1fGetTensorboardTimeSeriesRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\"\xe3\x01\n ListTensorboardTimeSeriesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/aiplatform.googleapis.com/TensorboardTimeSeries\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12-\n\tread_mask\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x90\x01\n!ListTensorboardTimeSeriesResponse\x12R\n\x17tensorboard_time_series\x18\x01 \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardTimeSeries\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb3\x01\n\"UpdateTensorboardTimeSeriesRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12W\n\x17tensorboard_time_series\x18\x02 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.TensorboardTimeSeriesB\x03\xe0\x41\x02\"k\n\"DeleteTensorboardTimeSeriesRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\"\xbd\x01\n)BatchReadTensorboardTimeSeriesDataRequest\x12\x42\n\x0btensorboard\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\x12L\n\x0btime_series\x18\x02 \x03(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\"r\n*BatchReadTensorboardTimeSeriesDataResponse\x12\x44\n\x10time_series_data\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.TimeSeriesData\"\xa9\x01\n$ReadTensorboardTimeSeriesDataRequest\x12X\n\x17tensorboard_time_series\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\x12\x17\n\x0fmax_data_points\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\"m\n%ReadTensorboardTimeSeriesDataResponse\x12\x44\n\x10time_series_data\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.TimeSeriesData\"\xe2\x01\n%WriteTensorboardExperimentDataRequest\x12W\n\x16tensorboard_experiment\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardExperiment\x12`\n\x17write_run_data_requests\x18\x02 \x03(\x0b\x32:.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequestB\x03\xe0\x41\x02\"(\n&WriteTensorboardExperimentDataResponse\"\xb6\x01\n\x1eWriteTensorboardRunDataRequest\x12I\n\x0ftensorboard_run\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(aiplatform.googleapis.com/TensorboardRun\x12I\n\x10time_series_data\x18\x02 \x03(\x0b\x32*.google.cloud.aiplatform.v1.TimeSeriesDataB\x03\xe0\x41\x02\"!\n\x1fWriteTensorboardRunDataResponse\"\xcb\x01\n&ExportTensorboardTimeSeriesDataRequest\x12X\n\x17tensorboard_time_series\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/aiplatform.googleapis.com/TensorboardTimeSeries\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x94\x01\n\'ExportTensorboardTimeSeriesDataResponse\x12P\n\x17time_series_data_points\x18\x01 \x03(\x0b\x32/.google.cloud.aiplatform.v1.TimeSeriesDataPoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"t\n\"CreateTensorboardOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"t\n\"UpdateTensorboardOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata2\xd9>\n\x12TensorboardService\x12\xf9\x01\n\x11\x43reateTensorboard\x12\x34.google.cloud.aiplatform.v1.CreateTensorboardRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41\x31\n\x0bTensorboard\x12\"CreateTensorboardOperationMetadata\xda\x41\x12parent,tensorboard\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/tensorboards:\x0btensorboard\x12\xad\x01\n\x0eGetTensorboard\x12\x31.google.cloud.aiplatform.v1.GetTensorboardRequest\x1a\'.google.cloud.aiplatform.v1.Tensorboard\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/tensorboards/*}\x12\x8a\x02\n\x11UpdateTensorboard\x12\x34.google.cloud.aiplatform.v1.UpdateTensorboardRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x31\n\x0bTensorboard\x12\"UpdateTensorboardOperationMetadata\xda\x41\x17tensorboard,update_mask\x82\xd3\xe4\x93\x02K2.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardExperiment\"\x98\x01\xda\x41\x37parent,tensorboard_experiment,tensorboard_experiment_id\x82\xd3\xe4\x93\x02X\">/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments:\x16tensorboard_experiment\x12\xd9\x01\n\x18GetTensorboardExperiment\x12;.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardExperiment\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}\x12\xad\x02\n\x1bUpdateTensorboardExperiment\x12>.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardExperiment\"\x9a\x01\xda\x41\"tensorboard_experiment,update_mask\x82\xd3\xe4\x93\x02o2U/v1/{tensorboard_experiment.name=projects/*/locations/*/tensorboards/*/experiments/*}:\x16tensorboard_experiment\x12\xec\x01\n\x1aListTensorboardExperiments\x12=.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest\x1a>.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments\x12\xff\x01\n\x1b\x44\x65leteTensorboardExperiment\x12>.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}\x12\x88\x02\n\x14\x43reateTensorboardRun\x12\x37.google.cloud.aiplatform.v1.CreateTensorboardRunRequest\x1a*.google.cloud.aiplatform.v1.TensorboardRun\"\x8a\x01\xda\x41)parent,tensorboard_run,tensorboard_run_id\x82\xd3\xe4\x93\x02X\"E/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:\x0ftensorboard_run\x12\x8b\x02\n\x1a\x42\x61tchCreateTensorboardRuns\x12=.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest\x1a>.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse\"n\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02V\"Q/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:batchCreate:\x01*\x12\xcb\x01\n\x11GetTensorboardRun\x12\x34.google.cloud.aiplatform.v1.GetTensorboardRunRequest\x1a*.google.cloud.aiplatform.v1.TensorboardRun\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}\x12\x8a\x02\n\x14UpdateTensorboardRun\x12\x37.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest\x1a*.google.cloud.aiplatform.v1.TensorboardRun\"\x8c\x01\xda\x41\x1btensorboard_run,update_mask\x82\xd3\xe4\x93\x02h2U/v1/{tensorboard_run.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:\x0ftensorboard_run\x12\xde\x01\n\x13ListTensorboardRuns\x12\x36.google.cloud.aiplatform.v1.ListTensorboardRunsRequest\x1a\x37.google.cloud.aiplatform.v1.ListTensorboardRunsResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs\x12\xf8\x01\n\x14\x44\x65leteTensorboardRun\x12\x37.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}\x12\x98\x02\n BatchCreateTensorboardTimeSeries\x12\x43.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest\x1a\x44.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse\"i\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02Q\"L/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}:batchCreate:\x01*\x12\xa7\x02\n\x1b\x43reateTensorboardTimeSeries\x12>.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardTimeSeries\"\x94\x01\xda\x41\x1eparent,tensorboard_time_series\x82\xd3\xe4\x93\x02m\"R/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries:\x17tensorboard_time_series\x12\xed\x01\n\x18GetTensorboardTimeSeries\x12;.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardTimeSeries\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\x12R/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}\x12\xc5\x02\n\x1bUpdateTensorboardTimeSeries\x12>.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest\x1a\x31.google.cloud.aiplatform.v1.TensorboardTimeSeries\"\xb2\x01\xda\x41#tensorboard_time_series,update_mask\x82\xd3\xe4\x93\x02\x85\x01\x32j/v1/{tensorboard_time_series.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:\x17tensorboard_time_series\x12\xfd\x01\n\x19ListTensorboardTimeSeries\x12<.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest\x1a=.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse\"c\xda\x41\x06parent\x82\xd3\xe4\x93\x02T\x12R/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries\x12\x93\x02\n\x1b\x44\x65leteTensorboardTimeSeries\x12>.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02T*R/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}\x12\x8c\x02\n\"BatchReadTensorboardTimeSeriesData\x12\x45.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest\x1a\x46.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse\"W\xda\x41\x0btensorboard\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{tensorboard=projects/*/locations/*/tensorboards/*}:batchRead\x12\xb3\x02\n\x1dReadTensorboardTimeSeriesData\x12@.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest\x1a\x41.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse\"\x8c\x01\xda\x41\x17tensorboard_time_series\x82\xd3\xe4\x93\x02l\x12j/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:read\x12\x92\x02\n\x17ReadTensorboardBlobData\x12:.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest\x1a;.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse\"|\xda\x41\x0btime_series\x82\xd3\xe4\x93\x02h\x12\x66/v1/{time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:readBlobData0\x01\x12\xbc\x02\n\x1eWriteTensorboardExperimentData\x12\x41.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest\x1a\x42.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse\"\x92\x01\xda\x41.tensorboard_experiment,write_run_data_requests\x82\xd3\xe4\x93\x02[\"V/v1/{tensorboard_experiment=projects/*/locations/*/tensorboards/*/experiments/*}:write:\x01*\x12\x99\x02\n\x17WriteTensorboardRunData\x12:.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest\x1a;.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse\"\x84\x01\xda\x41 tensorboard_run,time_series_data\x82\xd3\xe4\x93\x02[\"V/v1/{tensorboard_run=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:write:\x01*\x12\xd5\x02\n\x1f\x45xportTensorboardTimeSeriesData\x12\x42.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest\x1a\x43.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse\"\xa8\x01\xda\x41\x17tensorboard_time_series\x82\xd3\xe4\x93\x02\x87\x01\"\x81\x01/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:exportTensorboardTimeSeries:\x01*\x1a\x86\x01\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xd5\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x17TensorboardServiceProtoP\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.Tensorboard", "google/cloud/aiplatform/v1/tensorboard.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.aiplatform.v1.TensorboardExperiment", "google/cloud/aiplatform/v1/tensorboard_experiment.proto"], + ["google.cloud.aiplatform.v1.TensorboardRun", "google/cloud/aiplatform/v1/tensorboard_run.proto"], + ["google.cloud.aiplatform.v1.TensorboardBlob", "google/cloud/aiplatform/v1/tensorboard_data.proto"], + ["google.cloud.aiplatform.v1.TensorboardTimeSeries", "google/cloud/aiplatform/v1/tensorboard_time_series.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + CreateTensorboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTensorboardRequest").msgclass + GetTensorboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTensorboardRequest").msgclass + ListTensorboardsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardsRequest").msgclass + ListTensorboardsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardsResponse").msgclass + UpdateTensorboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateTensorboardRequest").msgclass + DeleteTensorboardRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTensorboardRequest").msgclass + ReadTensorboardUsageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardUsageRequest").msgclass + ReadTensorboardUsageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardUsageResponse").msgclass + ReadTensorboardUsageResponse::PerUserUsageData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData").msgclass + ReadTensorboardUsageResponse::PerMonthUsageData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData").msgclass + ReadTensorboardSizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardSizeRequest").msgclass + ReadTensorboardSizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardSizeResponse").msgclass + CreateTensorboardExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest").msgclass + GetTensorboardExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTensorboardExperimentRequest").msgclass + ListTensorboardExperimentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest").msgclass + ListTensorboardExperimentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse").msgclass + UpdateTensorboardExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest").msgclass + DeleteTensorboardExperimentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest").msgclass + BatchCreateTensorboardRunsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest").msgclass + BatchCreateTensorboardRunsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse").msgclass + CreateTensorboardRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTensorboardRunRequest").msgclass + GetTensorboardRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTensorboardRunRequest").msgclass + ReadTensorboardBlobDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest").msgclass + ReadTensorboardBlobDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse").msgclass + ListTensorboardRunsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardRunsRequest").msgclass + ListTensorboardRunsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardRunsResponse").msgclass + UpdateTensorboardRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateTensorboardRunRequest").msgclass + DeleteTensorboardRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTensorboardRunRequest").msgclass + BatchCreateTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest").msgclass + BatchCreateTensorboardTimeSeriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse").msgclass + CreateTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest").msgclass + GetTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest").msgclass + ListTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest").msgclass + ListTensorboardTimeSeriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse").msgclass + UpdateTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest").msgclass + DeleteTensorboardTimeSeriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest").msgclass + BatchReadTensorboardTimeSeriesDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest").msgclass + BatchReadTensorboardTimeSeriesDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse").msgclass + ReadTensorboardTimeSeriesDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest").msgclass + ReadTensorboardTimeSeriesDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse").msgclass + WriteTensorboardExperimentDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest").msgclass + WriteTensorboardExperimentDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse").msgclass + WriteTensorboardRunDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest").msgclass + WriteTensorboardRunDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse").msgclass + ExportTensorboardTimeSeriesDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest").msgclass + ExportTensorboardTimeSeriesDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse").msgclass + CreateTensorboardOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata").msgclass + UpdateTensorboardOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_services_pb.rb new file mode 100644 index 000000000000..f776c27889be --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_service_services_pb.rb @@ -0,0 +1,117 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/tensorboard_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/tensorboard_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module TensorboardService + # TensorboardService + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.TensorboardService' + + # Creates a Tensorboard. + rpc :CreateTensorboard, ::Google::Cloud::AIPlatform::V1::CreateTensorboardRequest, ::Google::Longrunning::Operation + # Gets a Tensorboard. + rpc :GetTensorboard, ::Google::Cloud::AIPlatform::V1::GetTensorboardRequest, ::Google::Cloud::AIPlatform::V1::Tensorboard + # Updates a Tensorboard. + rpc :UpdateTensorboard, ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest, ::Google::Longrunning::Operation + # Lists Tensorboards in a Location. + rpc :ListTensorboards, ::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest, ::Google::Cloud::AIPlatform::V1::ListTensorboardsResponse + # Deletes a Tensorboard. + rpc :DeleteTensorboard, ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest, ::Google::Longrunning::Operation + # Returns a list of monthly active users for a given TensorBoard instance. + rpc :ReadTensorboardUsage, ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageRequest, ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse + # Returns the storage size for a given TensorBoard instance. + rpc :ReadTensorboardSize, ::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeRequest, ::Google::Cloud::AIPlatform::V1::ReadTensorboardSizeResponse + # Creates a TensorboardExperiment. + rpc :CreateTensorboardExperiment, ::Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest, ::Google::Cloud::AIPlatform::V1::TensorboardExperiment + # Gets a TensorboardExperiment. + rpc :GetTensorboardExperiment, ::Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest, ::Google::Cloud::AIPlatform::V1::TensorboardExperiment + # Updates a TensorboardExperiment. + rpc :UpdateTensorboardExperiment, ::Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest, ::Google::Cloud::AIPlatform::V1::TensorboardExperiment + # Lists TensorboardExperiments in a Location. + rpc :ListTensorboardExperiments, ::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest, ::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsResponse + # Deletes a TensorboardExperiment. + rpc :DeleteTensorboardExperiment, ::Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest, ::Google::Longrunning::Operation + # Creates a TensorboardRun. + rpc :CreateTensorboardRun, ::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest, ::Google::Cloud::AIPlatform::V1::TensorboardRun + # Batch create TensorboardRuns. + rpc :BatchCreateTensorboardRuns, ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest, ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse + # Gets a TensorboardRun. + rpc :GetTensorboardRun, ::Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest, ::Google::Cloud::AIPlatform::V1::TensorboardRun + # Updates a TensorboardRun. + rpc :UpdateTensorboardRun, ::Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest, ::Google::Cloud::AIPlatform::V1::TensorboardRun + # Lists TensorboardRuns in a Location. + rpc :ListTensorboardRuns, ::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest, ::Google::Cloud::AIPlatform::V1::ListTensorboardRunsResponse + # Deletes a TensorboardRun. + rpc :DeleteTensorboardRun, ::Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest, ::Google::Longrunning::Operation + # Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + rpc :BatchCreateTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest, ::Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse + # Creates a TensorboardTimeSeries. + rpc :CreateTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest, ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries + # Gets a TensorboardTimeSeries. + rpc :GetTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest, ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries + # Updates a TensorboardTimeSeries. + rpc :UpdateTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest, ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries + # Lists TensorboardTimeSeries in a Location. + rpc :ListTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest, ::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesResponse + # Deletes a TensorboardTimeSeries. + rpc :DeleteTensorboardTimeSeries, ::Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest, ::Google::Longrunning::Operation + # Reads multiple TensorboardTimeSeries' data. The data point number limit is + # 1000 for scalars, 100 for tensors and blob references. If the number of + # data points stored is less than the limit, all data is returned. + # Otherwise, the number limit of data points is randomly selected from + # this time series and returned. + rpc :BatchReadTensorboardTimeSeriesData, ::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest, ::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse + # Reads a TensorboardTimeSeries' data. By default, if the number of data + # points stored is less than 1000, all data is returned. Otherwise, 1000 + # data points is randomly selected from this time series and returned. + # This value can be changed by changing max_data_points, which can't be + # greater than 10k. + rpc :ReadTensorboardTimeSeriesData, ::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest, ::Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse + # Gets bytes of TensorboardBlobs. + # This is to allow reading blob data stored in consumer project's Cloud + # Storage bucket without users having to obtain Cloud Storage access + # permission. + rpc :ReadTensorboardBlobData, ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest, stream(::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse) + # Write time series data points of multiple TensorboardTimeSeries in multiple + # TensorboardRun's. If any data fail to be ingested, an error is returned. + rpc :WriteTensorboardExperimentData, ::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest, ::Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse + # Write time series data points into multiple TensorboardTimeSeries under + # a TensorboardRun. If any data fail to be ingested, an error is returned. + rpc :WriteTensorboardRunData, ::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest, ::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse + # Exports a TensorboardTimeSeries' data. Data is returned in paginated + # responses. + rpc :ExportTensorboardTimeSeriesData, ::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest, ::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb new file mode 100644 index 000000000000..c697f1d1d0fc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tensorboard_time_series.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/aiplatform/v1/tensorboard_time_series.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbf\x06\n\x15TensorboardTimeSeries\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12W\n\nvalue_type\x18\x04 \x01(\x0e\x32;.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x07 \x01(\t\x12\x18\n\x0bplugin_name\x18\x08 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x0bplugin_data\x18\t \x01(\x0c\x12Q\n\x08metadata\x18\n \x01(\x0b\x32:.google.cloud.aiplatform.v1.TensorboardTimeSeries.MetadataB\x03\xe0\x41\x03\x1a\x80\x01\n\x08Metadata\x12\x15\n\x08max_step\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x36\n\rmax_wall_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12%\n\x18max_blob_sequence_length\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"R\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06SCALAR\x10\x01\x12\n\n\x06TENSOR\x10\x02\x12\x11\n\rBLOB_SEQUENCE\x10\x03:\xb6\x01\xea\x41\xb2\x01\n/aiplatform.googleapis.com/TensorboardTimeSeries\x12\x7fprojects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}B\xd8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1aTensorboardTimeSeriesProtoP\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"], + ] + 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 + TensorboardTimeSeries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardTimeSeries").msgclass + TensorboardTimeSeries::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata").msgclass + TensorboardTimeSeries::ValueType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tool_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tool_pb.rb new file mode 100644 index 000000000000..3e896109df9a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tool_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tool.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/openapi_pb' +require 'google/protobuf/struct_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n%google/cloud/aiplatform/v1/tool.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/aiplatform/v1/openapi.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x18google/type/latlng.proto\"\xf3\x01\n\x04Tool\x12S\n\x15\x66unction_declarations\x18\x01 \x03(\x0b\x32/.google.cloud.aiplatform.v1.FunctionDeclarationB\x03\xe0\x41\x01\x12=\n\tretrieval\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.RetrievalB\x03\xe0\x41\x01\x12W\n\x17google_search_retrieval\x18\x03 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.GoogleSearchRetrievalB\x03\xe0\x41\x01\"\xba\x01\n\x13\x46unctionDeclaration\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12;\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.SchemaB\x03\xe0\x41\x01\x12\x39\n\x08response\x18\x04 \x01(\x0b\x32\".google.cloud.aiplatform.v1.SchemaB\x03\xe0\x41\x01\"M\n\x0c\x46unctionCall\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x04\x61rgs\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\"U\n\x10\x46unctionResponse\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12.\n\x08response\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x02\"\xc9\x01\n\tRetrieval\x12\x46\n\x10vertex_ai_search\x18\x02 \x01(\x0b\x32*.google.cloud.aiplatform.v1.VertexAISearchH\x00\x12\x46\n\x10vertex_rag_store\x18\x04 \x01(\x0b\x32*.google.cloud.aiplatform.v1.VertexRagStoreH\x00\x12\"\n\x13\x64isable_attribution\x18\x03 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x42\x08\n\x06source\"\xaa\x03\n\x0eVertexRagStore\x12R\n\rrag_resources\x18\x04 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.VertexRagStore.RagResourceB\x03\xe0\x41\x01\x12$\n\x10similarity_top_k\x18\x02 \x01(\x05\x42\x05\x18\x01\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x19vector_distance_threshold\x18\x03 \x01(\x01\x42\x05\x18\x01\xe0\x41\x01H\x01\x88\x01\x01\x12Q\n\x14rag_retrieval_config\x18\x06 \x01(\x0b\x32..google.cloud.aiplatform.v1.RagRetrievalConfigB\x03\xe0\x41\x01\x1ai\n\x0bRagResource\x12?\n\nrag_corpus\x18\x01 \x01(\tB+\xe0\x41\x01\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\x12\x19\n\x0crag_file_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x42\x13\n\x11_similarity_top_kB\x1c\n\x1a_vector_distance_threshold\"(\n\x0eVertexAISearch\x12\x16\n\tdatastore\x18\x01 \x01(\tB\x03\xe0\x41\x02\"m\n\x15GoogleSearchRetrieval\x12T\n\x18\x64ynamic_retrieval_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.aiplatform.v1.DynamicRetrievalConfig\"\xca\x01\n\x16\x44ynamicRetrievalConfig\x12\x45\n\x04mode\x18\x01 \x01(\x0e\x32\x37.google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode\x12#\n\x11\x64ynamic_threshold\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\".\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x10\n\x0cMODE_DYNAMIC\x10\x01\x42\x14\n\x12_dynamic_threshold\"\xb1\x01\n\nToolConfig\x12W\n\x17\x66unction_calling_config\x18\x01 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.FunctionCallingConfigB\x03\xe0\x41\x01\x12J\n\x10retrieval_config\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.RetrievalConfigB\x03\xe0\x41\x01\"\xc2\x01\n\x15\x46unctionCallingConfig\x12I\n\x04mode\x18\x01 \x01(\x0e\x32\x36.google.cloud.aiplatform.v1.FunctionCallingConfig.ModeB\x03\xe0\x41\x01\x12#\n\x16\x61llowed_function_names\x18\x02 \x03(\tB\x03\xe0\x41\x01\"9\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x07\n\x03\x41NY\x10\x02\x12\x08\n\x04NONE\x10\x03\"v\n\x0fRetrievalConfig\x12)\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x88\x01\x01\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\n\n\x08_lat_lngB\x10\n\x0e_language_code\"\x8a\x02\n\x12RagRetrievalConfig\x12\x12\n\x05top_k\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12J\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.RagRetrievalConfig.FilterB\x03\xe0\x41\x01\x1a\x93\x01\n\x06\x46ilter\x12(\n\x19vector_distance_threshold\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x12*\n\x1bvector_similarity_threshold\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x12\x1c\n\x0fmetadata_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x15\n\x13vector_db_thresholdB\xc7\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\tToolProtoP\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.Schema", "google/cloud/aiplatform/v1/openapi.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.type.LatLng", "google/type/latlng.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 + Tool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Tool").msgclass + FunctionDeclaration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FunctionDeclaration").msgclass + FunctionCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FunctionCall").msgclass + FunctionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FunctionResponse").msgclass + Retrieval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Retrieval").msgclass + VertexRagStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.VertexRagStore").msgclass + VertexRagStore::RagResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.VertexRagStore.RagResource").msgclass + VertexAISearch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.VertexAISearch").msgclass + GoogleSearchRetrieval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GoogleSearchRetrieval").msgclass + DynamicRetrievalConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DynamicRetrievalConfig").msgclass + DynamicRetrievalConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode").enummodule + ToolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ToolConfig").msgclass + FunctionCallingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FunctionCallingConfig").msgclass + FunctionCallingConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FunctionCallingConfig.Mode").enummodule + RetrievalConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrievalConfig").msgclass + RagRetrievalConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagRetrievalConfig").msgclass + RagRetrievalConfig::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagRetrievalConfig.Filter").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb new file mode 100644 index 000000000000..bc8839104abe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/training_pipeline.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/cloud/aiplatform/v1/model_pb' +require 'google/cloud/aiplatform/v1/pipeline_state_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/cloud/aiplatform/v1/training_pipeline.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/io.proto\x1a&google/cloud/aiplatform/v1/model.proto\x1a/google/cloud/aiplatform/v1/pipeline_state.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x8e\x08\n\x10TrainingPipeline\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x11input_data_config\x18\x03 \x01(\x0b\x32+.google.cloud.aiplatform.v1.InputDataConfig\x12%\n\x18training_task_definition\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x14training_task_inputs\x18\x05 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12;\n\x16training_task_metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\x12:\n\x0fmodel_to_upload\x18\x07 \x01(\x0b\x32!.google.cloud.aiplatform.v1.Model\x12\x15\n\x08model_id\x18\x16 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cparent_model\x18\x15 \x01(\tB\x03\xe0\x41\x01\x12=\n\x05state\x18\t \x01(\x0e\x32).google.cloud.aiplatform.v1.PipelineStateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12H\n\x06labels\x18\x0f \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.TrainingPipeline.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x12 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:~\xea\x41{\n*aiplatform.googleapis.com/TrainingPipeline\x12Mprojects/{project}/locations/{location}/trainingPipelines/{training_pipeline}\"\xaf\x05\n\x0fInputDataConfig\x12\x43\n\x0e\x66raction_split\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.FractionSplitH\x00\x12?\n\x0c\x66ilter_split\x18\x03 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.FilterSplitH\x00\x12G\n\x10predefined_split\x18\x04 \x01(\x0b\x32+.google.cloud.aiplatform.v1.PredefinedSplitH\x00\x12\x45\n\x0ftimestamp_split\x18\x05 \x01(\x0b\x32*.google.cloud.aiplatform.v1.TimestampSplitH\x00\x12G\n\x10stratified_split\x18\x0c \x01(\x0b\x32+.google.cloud.aiplatform.v1.StratifiedSplitH\x00\x12\x45\n\x0fgcs_destination\x18\x08 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationH\x01\x12O\n\x14\x62igquery_destination\x18\n \x01(\x0b\x32/.google.cloud.aiplatform.v1.BigQueryDestinationH\x01\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\x12\x61nnotations_filter\x18\x06 \x01(\t\x12\x1d\n\x15\x61nnotation_schema_uri\x18\t \x01(\t\x12\x16\n\x0esaved_query_id\x18\x07 \x01(\t\x12!\n\x19persist_ml_use_assignment\x18\x0b \x01(\x08\x42\x07\n\x05splitB\r\n\x0b\x64\x65stination\"^\n\rFractionSplit\x12\x19\n\x11training_fraction\x18\x01 \x01(\x01\x12\x1b\n\x13validation_fraction\x18\x02 \x01(\x01\x12\x15\n\rtest_fraction\x18\x03 \x01(\x01\"e\n\x0b\x46ilterSplit\x12\x1c\n\x0ftraining_filter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11validation_filter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btest_filter\x18\x03 \x01(\tB\x03\xe0\x41\x02\"#\n\x0fPredefinedSplit\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\"q\n\x0eTimestampSplit\x12\x19\n\x11training_fraction\x18\x01 \x01(\x01\x12\x1b\n\x13validation_fraction\x18\x02 \x01(\x01\x12\x15\n\rtest_fraction\x18\x03 \x01(\x01\x12\x10\n\x03key\x18\x04 \x01(\tB\x03\xe0\x41\x02\"r\n\x0fStratifiedSplit\x12\x19\n\x11training_fraction\x18\x01 \x01(\x01\x12\x1b\n\x13validation_fraction\x18\x02 \x01(\x01\x12\x15\n\rtest_fraction\x18\x03 \x01(\x01\x12\x10\n\x03key\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\xd3\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x15TrainingPipelineProtoP\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.Value", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.Model", "google/cloud/aiplatform/v1/model.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.proto"], + ["google.cloud.aiplatform.v1.GcsDestination", "google/cloud/aiplatform/v1/io.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 + TrainingPipeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TrainingPipeline").msgclass + InputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.InputDataConfig").msgclass + FractionSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FractionSplit").msgclass + FilterSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FilterSplit").msgclass + PredefinedSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.PredefinedSplit").msgclass + TimestampSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TimestampSplit").msgclass + StratifiedSplit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StratifiedSplit").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb new file mode 100644 index 000000000000..e53df55c33da --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/tuning_job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/content_pb' +require 'google/cloud/aiplatform/v1/encryption_spec_pb' +require 'google/cloud/aiplatform/v1/job_state_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n+google/cloud/aiplatform/v1/tuning_job.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\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xc7\x08\n\tTuningJob\x12\x14\n\nbase_model\x18\x04 \x01(\tH\x00\x12R\n\x16supervised_tuning_spec\x18\x05 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.SupervisedTuningSpecH\x01\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12%\n\x18tuned_model_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x38\n\x05state\x18\x06 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x0c \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.TuningJob.LabelsEntryB\x03\xe0\x41\x01\x12=\n\nexperiment\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!aiplatform.googleapis.com/Context\x12@\n\x0btuned_model\x18\x0e \x01(\x0b\x32&.google.cloud.aiplatform.v1.TunedModelB\x03\xe0\x41\x03\x12K\n\x11tuning_data_stats\x18\x0f \x01(\x0b\x32+.google.cloud.aiplatform.v1.TuningDataStatsB\x03\xe0\x41\x03\x12\x43\n\x0f\x65ncryption_spec\x18\x10 \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12\x17\n\x0fservice_account\x18\x16 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x80\x01\xea\x41}\n#aiplatform.googleapis.com/TuningJob\x12?projects/{project}/locations/{location}/tuningJobs/{tuning_job}*\ntuningJobs2\ttuningJobB\x0e\n\x0csource_modelB\r\n\x0btuning_spec\"\x82\x01\n\nTunedModel\x12\x36\n\x05model\x18\x01 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12<\n\x08\x65ndpoint\x18\x02 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\"\xf2\x02\n#SupervisedTuningDatasetDistribution\x12\x10\n\x03sum\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x62illable_sum\x18\t \x01(\x03\x42\x03\xe0\x41\x03\x12\x10\n\x03min\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\x12\x10\n\x03max\x18\x03 \x01(\x01\x42\x03\xe0\x41\x03\x12\x11\n\x04mean\x18\x04 \x01(\x01\x42\x03\xe0\x41\x03\x12\x13\n\x06median\x18\x05 \x01(\x01\x42\x03\xe0\x41\x03\x12\x0f\n\x02p5\x18\x06 \x01(\x01\x42\x03\xe0\x41\x03\x12\x10\n\x03p95\x18\x07 \x01(\x01\x42\x03\xe0\x41\x03\x12\x63\n\x07\x62uckets\x18\x08 \x03(\x0b\x32M.google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution.DatasetBucketB\x03\xe0\x41\x03\x1aJ\n\rDatasetBucket\x12\x12\n\x05\x63ount\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\x12\x11\n\x04left\x18\x02 \x01(\x01\x42\x03\xe0\x41\x03\x12\x12\n\x05right\x18\x03 \x01(\x01\x42\x03\xe0\x41\x03\"\xcc\x05\n\x19SupervisedTuningDataStats\x12)\n\x1ctuning_dataset_example_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12)\n\x1ctotal_tuning_character_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12-\n\x1etotal_billable_character_count\x18\x03 \x01(\x03\x42\x05\x18\x01\xe0\x41\x03\x12\'\n\x1atotal_billable_token_count\x18\t \x01(\x03\x42\x03\xe0\x41\x03\x12\x1e\n\x11tuning_step_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12k\n\x1duser_input_token_distribution\x18\x05 \x01(\x0b\x32?.google.cloud.aiplatform.v1.SupervisedTuningDatasetDistributionB\x03\xe0\x41\x03\x12l\n\x1euser_output_token_distribution\x18\x06 \x01(\x0b\x32?.google.cloud.aiplatform.v1.SupervisedTuningDatasetDistributionB\x03\xe0\x41\x03\x12s\n%user_message_per_example_distribution\x18\x07 \x01(\x0b\x32?.google.cloud.aiplatform.v1.SupervisedTuningDatasetDistributionB\x03\xe0\x41\x03\x12G\n\x15user_dataset_examples\x18\x08 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x03\x12%\n\x1dtotal_truncated_example_count\x18\n \x01(\x03\x12!\n\x19truncated_example_indices\x18\x0b \x03(\x03\"\x85\x01\n\x0fTuningDataStats\x12]\n\x1csupervised_tuning_data_stats\x18\x01 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.SupervisedTuningDataStatsH\x00\x42\x13\n\x11tuning_data_stats\"\xc7\x02\n\x19SupervisedHyperParameters\x12\x18\n\x0b\x65poch_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12%\n\x18learning_rate_multiplier\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\\\n\x0c\x61\x64\x61pter_size\x18\x03 \x01(\x0e\x32\x41.google.cloud.aiplatform.v1.SupervisedHyperParameters.AdapterSizeB\x03\xe0\x41\x01\"\x8a\x01\n\x0b\x41\x64\x61pterSize\x12\x1c\n\x18\x41\x44\x41PTER_SIZE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41\x44\x41PTER_SIZE_ONE\x10\x01\x12\x15\n\x11\x41\x44\x41PTER_SIZE_FOUR\x10\x02\x12\x16\n\x12\x41\x44\x41PTER_SIZE_EIGHT\x10\x03\x12\x18\n\x14\x41\x44\x41PTER_SIZE_SIXTEEN\x10\x04\"\xb4\x01\n\x14SupervisedTuningSpec\x12!\n\x14training_dataset_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12#\n\x16validation_dataset_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12T\n\x10hyper_parameters\x18\x03 \x01(\x0b\x32\x35.google.cloud.aiplatform.v1.SupervisedHyperParametersB\x03\xe0\x41\x01\"\xe3\x01\n\rTunedModelRef\x12;\n\x0btuned_model\x18\x01 \x01(\tB$\xfa\x41!\n\x1f\x61iplatform.googleapis.com/ModelH\x00\x12>\n\ntuning_job\x18\x02 \x01(\tB(\xfa\x41%\n#aiplatform.googleapis.com/TuningJobH\x00\x12\x42\n\x0cpipeline_job\x18\x03 \x01(\tB*\xfa\x41\'\n%aiplatform.googleapis.com/PipelineJobH\x00\x42\x11\n\x0ftuned_model_refB\xcc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0eTuningJobProtoP\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.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.EncryptionSpec", "google/cloud/aiplatform/v1/encryption_spec.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 + TuningJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TuningJob").msgclass + TunedModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TunedModel").msgclass + SupervisedTuningDatasetDistribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution").msgclass + SupervisedTuningDatasetDistribution::DatasetBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedTuningDatasetDistribution.DatasetBucket").msgclass + SupervisedTuningDataStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedTuningDataStats").msgclass + TuningDataStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TuningDataStats").msgclass + SupervisedHyperParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedHyperParameters").msgclass + SupervisedHyperParameters::AdapterSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedHyperParameters.AdapterSize").enummodule + SupervisedTuningSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SupervisedTuningSpec").msgclass + TunedModelRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.TunedModelRef").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/types_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/types_pb.rb new file mode 100644 index 000000000000..a31f47a80aba --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/types_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/types.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/types.proto\x12\x1agoogle.cloud.aiplatform.v1\"\x1b\n\tBoolArray\x12\x0e\n\x06values\x18\x01 \x03(\x08\"\x1d\n\x0b\x44oubleArray\x12\x0e\n\x06values\x18\x01 \x03(\x01\"\x1c\n\nInt64Array\x12\x0e\n\x06values\x18\x01 \x03(\x03\"\x1d\n\x0bStringArray\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x93\x05\n\x06Tensor\x12:\n\x05\x64type\x18\x01 \x01(\x0e\x32+.google.cloud.aiplatform.v1.Tensor.DataType\x12\r\n\x05shape\x18\x02 \x03(\x03\x12\x10\n\x08\x62ool_val\x18\x03 \x03(\x08\x12\x12\n\nstring_val\x18\x0e \x03(\t\x12\x11\n\tbytes_val\x18\x0f \x03(\x0c\x12\x11\n\tfloat_val\x18\x05 \x03(\x02\x12\x12\n\ndouble_val\x18\x06 \x03(\x01\x12\x0f\n\x07int_val\x18\x07 \x03(\x05\x12\x11\n\tint64_val\x18\x08 \x03(\x03\x12\x10\n\x08uint_val\x18\t \x03(\r\x12\x12\n\nuint64_val\x18\n \x03(\x04\x12\x34\n\x08list_val\x18\x0b \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x45\n\nstruct_val\x18\x0c \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.Tensor.StructValEntry\x12\x12\n\ntensor_val\x18\r \x01(\x0c\x1aT\n\x0eStructValEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor:\x02\x38\x01\"\xac\x01\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\n\n\x06STRING\x10\x02\x12\t\n\x05\x46LOAT\x10\x03\x12\n\n\x06\x44OUBLE\x10\x04\x12\x08\n\x04INT8\x10\x05\x12\t\n\x05INT16\x10\x06\x12\t\n\x05INT32\x10\x07\x12\t\n\x05INT64\x10\x08\x12\t\n\x05UINT8\x10\t\x12\n\n\x06UINT16\x10\n\x12\n\n\x06UINT32\x10\x0b\x12\n\n\x06UINT64\x10\x0c\x42\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nTypesProtoP\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 = [ + ] + 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 + BoolArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.BoolArray").msgclass + DoubleArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DoubleArray").msgclass + Int64Array = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Int64Array").msgclass + StringArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StringArray").msgclass + Tensor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Tensor").msgclass + Tensor::DataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Tensor.DataType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb new file mode 100644 index 000000000000..f75f47881726 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/unmanaged_container_model.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/aiplatform/v1/model_pb' + + +descriptor_data = "\n:google/cloud/aiplatform/v1/unmanaged_container_model.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a&google/cloud/aiplatform/v1/model.proto\"\xc3\x01\n\x17UnmanagedContainerModel\x12\x14\n\x0c\x61rtifact_uri\x18\x01 \x01(\t\x12\x45\n\x10predict_schemata\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.PredictSchemata\x12K\n\x0e\x63ontainer_spec\x18\x03 \x01(\x0b\x32..google.cloud.aiplatform.v1.ModelContainerSpecB\x03\xe0\x41\x04\x42\xda\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1cUnmanagedContainerModelProtoP\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.PredictSchemata", "google/cloud/aiplatform/v1/model.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 + UnmanagedContainerModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UnmanagedContainerModel").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb new file mode 100644 index 000000000000..fa8683e15bc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/user_action_reference.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/aiplatform/v1/user_action_reference.proto\x12\x1agoogle.cloud.aiplatform.v1\"d\n\x13UserActionReference\x12\x13\n\toperation\x18\x01 \x01(\tH\x00\x12\x1b\n\x11\x64\x61ta_labeling_job\x18\x02 \x01(\tH\x00\x12\x0e\n\x06method\x18\x03 \x01(\tB\x0b\n\treferenceB\xd6\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x18UserActionReferenceProtoP\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 = [ + ] + 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 + UserActionReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UserActionReference").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/value_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/value_pb.rb new file mode 100644 index 000000000000..929f0f7d4e7d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/value_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/value.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/cloud/aiplatform/v1/value.proto\x12\x1agoogle.cloud.aiplatform.v1\"U\n\x05Value\x12\x13\n\tint_value\x18\x01 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x42\x07\n\x05valueB\xc8\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\nValueProtoP\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 = [ + ] + 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 + Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Value").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb new file mode 100644 index 000000000000..69b915064c05 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/vertex_rag_data.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/api_auth_pb' +require 'google/cloud/aiplatform/v1/io_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/vertex_rag_data.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/aiplatform/v1/api_auth.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcf\x02\n\x17RagEmbeddingModelConfig\x12r\n\x1avertex_prediction_endpoint\x18\x01 \x01(\x0b\x32L.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpointH\x00\x1a\xaf\x01\n\x18VertexPredictionEndpoint\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x36\n\x05model\x18\x02 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x03 \x01(\tB\x03\xe0\x41\x03\x42\x0e\n\x0cmodel_config\"\xa9\x04\n\x11RagVectorDbConfig\x12T\n\x0erag_managed_db\x18\x01 \x01(\x0b\x32:.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDbH\x00\x12J\n\x08pinecone\x18\x03 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.RagVectorDbConfig.PineconeH\x00\x12`\n\x14vertex_vector_search\x18\x06 \x01(\x0b\x32@.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearchH\x00\x12\x35\n\x08\x61pi_auth\x18\x05 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ApiAuth\x12_\n\x1arag_embedding_model_config\x18\x07 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.RagEmbeddingModelConfigB\x06\xe0\x41\x01\xe0\x41\x05\x1a\x0e\n\x0cRagManagedDb\x1a\x1e\n\x08Pinecone\x12\x12\n\nindex_name\x18\x01 \x01(\t\x1a;\n\x12VertexVectorSearch\x12\x16\n\x0eindex_endpoint\x18\x01 \x01(\t\x12\r\n\x05index\x18\x02 \x01(\tB\x0b\n\tvector_db\"\xa0\x01\n\nFileStatus\x12@\n\x05state\x18\x01 \x01(\x0e\x32,.google.cloud.aiplatform.v1.FileStatus.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x65rror_status\x18\x02 \x01(\tB\x03\xe0\x41\x03\"5\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\t\n\x05\x45RROR\x10\x02\"\xab\x01\n\x0c\x43orpusStatus\x12\x42\n\x05state\x18\x01 \x01(\x0e\x32..google.cloud.aiplatform.v1.CorpusStatus.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x65rror_status\x18\x02 \x01(\tB\x03\xe0\x41\x03\"<\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0f\n\x0bINITIALIZED\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"\xed\x03\n\tRagCorpus\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\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\x44\n\rcorpus_status\x18\x08 \x01(\x0b\x32(.google.cloud.aiplatform.v1.CorpusStatusB\x03\xe0\x41\x03\x12Q\n\x10vector_db_config\x18\t \x01(\x0b\x32-.google.cloud.aiplatform.v1.RagVectorDbConfigB\x06\xe0\x41\x01\xe0\x41\x05H\x00:\x80\x01\xea\x41}\n#aiplatform.googleapis.com/RagCorpus\x12?projects/{project}/locations/{location}/ragCorpora/{rag_corpus}*\nragCorpora2\tragCorpusB\x10\n\x0e\x62\x61\x63kend_config\"\xdc\x06\n\x07RagFile\x12@\n\ngcs_source\x18\x08 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceB\x03\xe0\x41\x03H\x00\x12Q\n\x13google_drive_source\x18\t \x01(\x0b\x32-.google.cloud.aiplatform.v1.GoogleDriveSourceB\x03\xe0\x41\x03H\x00\x12S\n\x14\x64irect_upload_source\x18\n \x01(\x0b\x32..google.cloud.aiplatform.v1.DirectUploadSourceB\x03\xe0\x41\x03H\x00\x12?\n\x0cslack_source\x18\x0b \x01(\x0b\x32\'.google.cloud.aiplatform.v1.SlackSourceH\x00\x12=\n\x0bjira_source\x18\x0c \x01(\x0b\x32&.google.cloud.aiplatform.v1.JiraSourceH\x00\x12L\n\x13share_point_sources\x18\x0e \x01(\x0b\x32-.google.cloud.aiplatform.v1.SharePointSourcesH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x0b\x66ile_status\x18\r \x01(\x0b\x32&.google.cloud.aiplatform.v1.FileStatusB\x03\xe0\x41\x03:\x8f\x01\xea\x41\x8b\x01\n!aiplatform.googleapis.com/RagFile\x12Sprojects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}*\x08ragFiles2\x07ragFileB\x11\n\x0frag_file_source\"\xd4\x01\n\x15RagFileChunkingConfig\x12\x66\n\x15\x66ixed_length_chunking\x18\x03 \x01(\x0b\x32\x45.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunkingH\x00\x1a@\n\x13\x46ixedLengthChunking\x12\x12\n\nchunk_size\x18\x01 \x01(\x05\x12\x15\n\rchunk_overlap\x18\x02 \x01(\x05\x42\x11\n\x0f\x63hunking_config\"r\n\x1bRagFileTransformationConfig\x12S\n\x18rag_file_chunking_config\x18\x01 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.RagFileChunkingConfig\"v\n\x13UploadRagFileConfig\x12_\n\x1erag_file_transformation_config\x18\x03 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.RagFileTransformationConfig\"\xd8\x05\n\x14ImportRagFilesConfig\x12;\n\ngcs_source\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.GcsSourceH\x00\x12L\n\x13google_drive_source\x18\x03 \x01(\x0b\x32-.google.cloud.aiplatform.v1.GoogleDriveSourceH\x00\x12?\n\x0cslack_source\x18\x06 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.SlackSourceH\x00\x12=\n\x0bjira_source\x18\x07 \x01(\x0b\x32&.google.cloud.aiplatform.v1.JiraSourceH\x00\x12L\n\x13share_point_sources\x18\r \x01(\x0b\x32-.google.cloud.aiplatform.v1.SharePointSourcesH\x00\x12R\n\x18partial_failure_gcs_sink\x18\x0b \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestinationB\x02\x18\x01H\x01\x12\\\n\x1dpartial_failure_bigquery_sink\x18\x0c \x01(\x0b\x32/.google.cloud.aiplatform.v1.BigQueryDestinationB\x02\x18\x01H\x01\x12_\n\x1erag_file_transformation_config\x18\x10 \x01(\x0b\x32\x37.google.cloud.aiplatform.v1.RagFileTransformationConfig\x12+\n\x1emax_embedding_requests_per_min\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x42\x0f\n\rimport_sourceB\x16\n\x14partial_failure_sinkB\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12VertexRagDataProtoP\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.ApiAuth", "google/cloud/aiplatform/v1/api_auth.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.GcsSource", "google/cloud/aiplatform/v1/io.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 + RagEmbeddingModelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagEmbeddingModelConfig").msgclass + RagEmbeddingModelConfig::VertexPredictionEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint").msgclass + RagVectorDbConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagVectorDbConfig").msgclass + RagVectorDbConfig::RagManagedDb = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb").msgclass + RagVectorDbConfig::Pinecone = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone").msgclass + RagVectorDbConfig::VertexVectorSearch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch").msgclass + FileStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FileStatus").msgclass + FileStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FileStatus.State").enummodule + CorpusStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CorpusStatus").msgclass + CorpusStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CorpusStatus.State").enummodule + RagCorpus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagCorpus").msgclass + RagFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagFile").msgclass + RagFileChunkingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagFileChunkingConfig").msgclass + RagFileChunkingConfig::FixedLengthChunking = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking").msgclass + RagFileTransformationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagFileTransformationConfig").msgclass + UploadRagFileConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadRagFileConfig").msgclass + ImportRagFilesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportRagFilesConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb new file mode 100644 index 000000000000..be56506a6f59 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/vertex_rag_data_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/vertex_rag_data_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n8google/cloud/aiplatform/v1/vertex_rag_data_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\x30google/cloud/aiplatform/v1/vertex_rag_data.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"\x93\x01\n\x16\x43reateRagCorpusRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12>\n\nrag_corpus\x18\x02 \x01(\x0b\x32%.google.cloud.aiplatform.v1.RagCorpusB\x03\xe0\x41\x02\"P\n\x13GetRagCorpusRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\"\x83\x01\n\x15ListRagCorporaRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"m\n\x16ListRagCorporaResponse\x12:\n\x0brag_corpora\x18\x01 \x03(\x0b\x32%.google.cloud.aiplatform.v1.RagCorpus\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x16\x44\x65leteRagCorpusRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xe5\x01\n\x14UploadRagFileRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\x12:\n\x08rag_file\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.RagFileB\x03\xe0\x41\x02\x12T\n\x16upload_rag_file_config\x18\x05 \x01(\x0b\x32/.google.cloud.aiplatform.v1.UploadRagFileConfigB\x03\xe0\x41\x02\"\x7f\n\x15UploadRagFileResponse\x12\x37\n\x08rag_file\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.RagFileH\x00\x12#\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x42\x08\n\x06result\"\xac\x01\n\x15ImportRagFilesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\x12V\n\x17import_rag_files_config\x18\x02 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ImportRagFilesConfigB\x03\xe0\x41\x02\"\xe3\x01\n\x16ImportRagFilesResponse\x12#\n\x19partial_failures_gcs_path\x18\x04 \x01(\tH\x00\x12)\n\x1fpartial_failures_bigquery_table\x18\x05 \x01(\tH\x00\x12 \n\x18imported_rag_files_count\x18\x01 \x01(\x03\x12\x1e\n\x16\x66\x61iled_rag_files_count\x18\x02 \x01(\x03\x12\x1f\n\x17skipped_rag_files_count\x18\x03 \x01(\x03\x42\x16\n\x14partial_failure_sink\"L\n\x11GetRagFileRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/RagFile\"\x83\x01\n\x13ListRagFilesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\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\"g\n\x14ListRagFilesResponse\x12\x36\n\trag_files\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.RagFile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x14\x44\x65leteRagFileRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/RagFile\"r\n CreateRagCorpusOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"X\n\x16UpdateRagCorpusRequest\x12>\n\nrag_corpus\x18\x01 \x01(\x0b\x32%.google.cloud.aiplatform.v1.RagCorpusB\x03\xe0\x41\x02\"r\n UpdateRagCorpusOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\xfd\x01\n\x1fImportRagFilesOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x15\n\rrag_corpus_id\x18\x02 \x01(\x03\x12V\n\x17import_rag_files_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.aiplatform.v1.ImportRagFilesConfigB\x03\xe0\x41\x03\x12\x1b\n\x13progress_percentage\x18\x04 \x01(\x05\x32\xcf\x11\n\x14VertexRagDataService\x12\xed\x01\n\x0f\x43reateRagCorpus\x12\x32.google.cloud.aiplatform.v1.CreateRagCorpusRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41-\n\tRagCorpus\x12 CreateRagCorpusOperationMetadata\xda\x41\x11parent,rag_corpus\x82\xd3\xe4\x93\x02<\"./v1/{parent=projects/*/locations/*}/ragCorpora:\nrag_corpus\x12\xf1\x01\n\x0fUpdateRagCorpus\x12\x32.google.cloud.aiplatform.v1.UpdateRagCorpusRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41-\n\tRagCorpus\x12 UpdateRagCorpusOperationMetadata\xda\x41\nrag_corpus\x82\xd3\xe4\x93\x02G29/v1/{rag_corpus.name=projects/*/locations/*/ragCorpora/*}:\nrag_corpus\x12\xa5\x01\n\x0cGetRagCorpus\x12/.google.cloud.aiplatform.v1.GetRagCorpusRequest\x1a%.google.cloud.aiplatform.v1.RagCorpus\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/ragCorpora/*}\x12\xb8\x01\n\x0eListRagCorpora\x12\x31.google.cloud.aiplatform.v1.ListRagCorporaRequest\x1a\x32.google.cloud.aiplatform.v1.ListRagCorporaResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/ragCorpora\x12\xd6\x01\n\x0f\x44\x65leteRagCorpus\x12\x32.google.cloud.aiplatform.v1.DeleteRagCorpusRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/ragCorpora/*}\x12\xea\x01\n\rUploadRagFile\x12\x30.google.cloud.aiplatform.v1.UploadRagFileRequest\x1a\x31.google.cloud.aiplatform.v1.UploadRagFileResponse\"t\xda\x41&parent,rag_file,upload_rag_file_config\x82\xd3\xe4\x93\x02\x45\"@/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:upload:\x01*\x12\x8d\x02\n\x0eImportRagFiles\x12\x31.google.cloud.aiplatform.v1.ImportRagFilesRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41\x39\n\x16ImportRagFilesResponse\x12\x1fImportRagFilesOperationMetadata\xda\x41\x1eparent,import_rag_files_config\x82\xd3\xe4\x93\x02\x45\"@/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:import:\x01*\x12\xaa\x01\n\nGetRagFile\x12-.google.cloud.aiplatform.v1.GetRagFileRequest\x1a#.google.cloud.aiplatform.v1.RagFile\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}\x12\xbd\x01\n\x0cListRagFiles\x12/.google.cloud.aiplatform.v1.ListRagFilesRequest\x1a\x30.google.cloud.aiplatform.v1.ListRagFilesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles\x12\xdd\x01\n\rDeleteRagFile\x12\x30.google.cloud.aiplatform.v1.DeleteRagFileRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd7\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x19VertexRagDataServiceProtoP\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.RagCorpus", "google/cloud/aiplatform/v1/vertex_rag_data.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + CreateRagCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateRagCorpusRequest").msgclass + GetRagCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetRagCorpusRequest").msgclass + ListRagCorporaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListRagCorporaRequest").msgclass + ListRagCorporaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListRagCorporaResponse").msgclass + DeleteRagCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteRagCorpusRequest").msgclass + UploadRagFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadRagFileRequest").msgclass + UploadRagFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UploadRagFileResponse").msgclass + ImportRagFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportRagFilesRequest").msgclass + ImportRagFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportRagFilesResponse").msgclass + GetRagFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetRagFileRequest").msgclass + ListRagFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListRagFilesRequest").msgclass + ListRagFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListRagFilesResponse").msgclass + DeleteRagFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteRagFileRequest").msgclass + CreateRagCorpusOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata").msgclass + UpdateRagCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateRagCorpusRequest").msgclass + UpdateRagCorpusOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata").msgclass + ImportRagFilesOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb new file mode 100644 index 000000000000..9ca1275932c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/vertex_rag_data_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/vertex_rag_data_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagDataService + # A service for managing user data for RAG. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.VertexRagDataService' + + # Creates a RagCorpus. + rpc :CreateRagCorpus, ::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest, ::Google::Longrunning::Operation + # Updates a RagCorpus. + rpc :UpdateRagCorpus, ::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest, ::Google::Longrunning::Operation + # Gets a RagCorpus. + rpc :GetRagCorpus, ::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest, ::Google::Cloud::AIPlatform::V1::RagCorpus + # Lists RagCorpora in a Location. + rpc :ListRagCorpora, ::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest, ::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse + # Deletes a RagCorpus. + rpc :DeleteRagCorpus, ::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest, ::Google::Longrunning::Operation + # Upload a file into a RagCorpus. + rpc :UploadRagFile, ::Google::Cloud::AIPlatform::V1::UploadRagFileRequest, ::Google::Cloud::AIPlatform::V1::UploadRagFileResponse + # Import files from Google Cloud Storage or Google Drive into a RagCorpus. + rpc :ImportRagFiles, ::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest, ::Google::Longrunning::Operation + # Gets a RagFile. + rpc :GetRagFile, ::Google::Cloud::AIPlatform::V1::GetRagFileRequest, ::Google::Cloud::AIPlatform::V1::RagFile + # Lists RagFiles in a RagCorpus. + rpc :ListRagFiles, ::Google::Cloud::AIPlatform::V1::ListRagFilesRequest, ::Google::Cloud::AIPlatform::V1::ListRagFilesResponse + # Deletes a RagFile. + rpc :DeleteRagFile, ::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_pb.rb new file mode 100644 index 000000000000..0faf43434673 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_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/vertex_rag_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/content_pb' +require 'google/cloud/aiplatform/v1/tool_pb' + + +descriptor_data = "\n3google/cloud/aiplatform/v1/vertex_rag_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/content.proto\x1a%google/cloud/aiplatform/v1/tool.proto\"{\n\x08RagQuery\x12\x13\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12Q\n\x14rag_retrieval_config\x18\x06 \x01(\x0b\x32..google.cloud.aiplatform.v1.RagRetrievalConfigB\x03\xe0\x41\x01\x42\x07\n\x05query\"\xb4\x04\n\x17RetrieveContextsRequest\x12^\n\x10vertex_rag_store\x18\x02 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStoreH\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x38\n\x05query\x18\x03 \x01(\x0b\x32$.google.cloud.aiplatform.v1.RagQueryB\x03\xe0\x41\x02\x1a\xb4\x02\n\x0eVertexRagStore\x12j\n\rrag_resources\x18\x03 \x03(\x0b\x32N.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResourceB\x03\xe0\x41\x01\x12-\n\x19vector_distance_threshold\x18\x02 \x01(\x01\x42\x05\x18\x01\xe0\x41\x01H\x00\x88\x01\x01\x1ai\n\x0bRagResource\x12?\n\nrag_corpus\x18\x01 \x01(\tB+\xe0\x41\x01\xfa\x41%\n#aiplatform.googleapis.com/RagCorpus\x12\x19\n\x0crag_file_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x42\x1c\n\x1a_vector_distance_thresholdB\r\n\x0b\x64\x61ta_source\"\xb8\x01\n\x0bRagContexts\x12\x41\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32/.google.cloud.aiplatform.v1.RagContexts.Context\x1a\x66\n\x07\x43ontext\x12\x12\n\nsource_uri\x18\x01 \x01(\t\x12\x1b\n\x13source_display_name\x18\x05 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x12\n\x05score\x18\x06 \x01(\x01H\x00\x88\x01\x01\x42\x08\n\x06_score\"U\n\x18RetrieveContextsResponse\x12\x39\n\x08\x63ontexts\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.RagContexts\"\xee\x02\n\x14\x41ugmentPromptRequest\x12K\n\x10vertex_rag_store\x18\x04 \x01(\x0b\x32*.google.cloud.aiplatform.v1.VertexRagStoreB\x03\xe0\x41\x01H\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\x08\x63ontents\x18\x02 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\x12J\n\x05model\x18\x03 \x01(\x0b\x32\x36.google.cloud.aiplatform.v1.AugmentPromptRequest.ModelB\x03\xe0\x41\x01\x1a\x37\n\x05Model\x12\x12\n\x05model\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rmodel_version\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x64\x61ta_source\"\x87\x01\n\x15\x41ugmentPromptResponse\x12=\n\x10\x61ugmented_prompt\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Content\x12/\n\x05\x66\x61\x63ts\x18\x02 \x03(\x0b\x32 .google.cloud.aiplatform.v1.Fact\"\xe2\x02\n\x19\x43orroborateContentRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12>\n\x07\x63ontent\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x34\n\x05\x66\x61\x63ts\x18\x03 \x03(\x0b\x32 .google.cloud.aiplatform.v1.FactB\x03\xe0\x41\x01\x12Y\n\nparameters\x18\x04 \x01(\x0b\x32@.google.cloud.aiplatform.v1.CorroborateContentRequest.ParametersB\x03\xe0\x41\x01\x1a-\n\nParameters\x12\x1f\n\x12\x63itation_threshold\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x42\n\n\x08_content\"\x89\x01\n\x1a\x43orroborateContentResponse\x12 \n\x13\x63orroboration_score\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x31\n\x06\x63laims\x18\x02 \x03(\x0b\x32!.google.cloud.aiplatform.v1.ClaimB\x16\n\x14_corroboration_score\"\xd2\x01\n\x04\x46\x61\x63t\x12\x12\n\x05query\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05title\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x10\n\x03uri\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x14\n\x07summary\x18\x04 \x01(\tH\x03\x88\x01\x01\x12 \n\x0fvector_distance\x18\x05 \x01(\x01\x42\x02\x18\x01H\x04\x88\x01\x01\x12\x12\n\x05score\x18\x06 \x01(\x01H\x05\x88\x01\x01\x42\x08\n\x06_queryB\x08\n\x06_titleB\x06\n\x04_uriB\n\n\x08_summaryB\x12\n\x10_vector_distanceB\x08\n\x06_score\"\x8b\x01\n\x05\x43laim\x12\x18\n\x0bstart_index\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x16\n\tend_index\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x14\n\x0c\x66\x61\x63t_indexes\x18\x03 \x03(\x05\x12\x12\n\x05score\x18\x04 \x01(\x02H\x02\x88\x01\x01\x42\x0e\n\x0c_start_indexB\x0c\n\n_end_indexB\x08\n\x06_score2\xe6\x05\n\x10VertexRagService\x12\xcd\x01\n\x10RetrieveContexts\x12\x33.google.cloud.aiplatform.v1.RetrieveContextsRequest\x1a\x34.google.cloud.aiplatform.v1.RetrieveContextsResponse\"N\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02\x39\"4/v1/{parent=projects/*/locations/*}:retrieveContexts:\x01*\x12\xd2\x01\n\rAugmentPrompt\x12\x30.google.cloud.aiplatform.v1.AugmentPromptRequest\x1a\x31.google.cloud.aiplatform.v1.AugmentPromptResponse\"\\\xda\x41\x1dparent,model,vertex_rag_store\x82\xd3\xe4\x93\x02\x36\"1/v1/{parent=projects/*/locations/*}:augmentPrompt:\x01*\x12\xdd\x01\n\x12\x43orroborateContent\x12\x35.google.cloud.aiplatform.v1.CorroborateContentRequest\x1a\x36.google.cloud.aiplatform.v1.CorroborateContentResponse\"X\xda\x41\x14parent,content,facts\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/locations/*}:corroborateContent:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x15VertexRagServiceProtoP\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.RagRetrievalConfig", "google/cloud/aiplatform/v1/tool.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 + RagQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagQuery").msgclass + RetrieveContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrieveContextsRequest").msgclass + RetrieveContextsRequest::VertexRagStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore").msgclass + RetrieveContextsRequest::VertexRagStore::RagResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource").msgclass + RagContexts = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagContexts").msgclass + RagContexts::Context = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RagContexts.Context").msgclass + RetrieveContextsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.RetrieveContextsResponse").msgclass + AugmentPromptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AugmentPromptRequest").msgclass + AugmentPromptRequest::Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AugmentPromptRequest.Model").msgclass + AugmentPromptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AugmentPromptResponse").msgclass + CorroborateContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CorroborateContentRequest").msgclass + CorroborateContentRequest::Parameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters").msgclass + CorroborateContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CorroborateContentResponse").msgclass + Fact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Fact").msgclass + Claim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Claim").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb new file mode 100644 index 000000000000..3b398a980fd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/vertex_rag_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/vertex_rag_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module VertexRagService + # A service for retrieving relevant contexts. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.VertexRagService' + + # Retrieves relevant contexts for a query. + rpc :RetrieveContexts, ::Google::Cloud::AIPlatform::V1::RetrieveContextsRequest, ::Google::Cloud::AIPlatform::V1::RetrieveContextsResponse + # Given an input prompt, it returns augmented prompt from vertex rag store + # to guide LLM towards generating grounded responses. + rpc :AugmentPrompt, ::Google::Cloud::AIPlatform::V1::AugmentPromptRequest, ::Google::Cloud::AIPlatform::V1::AugmentPromptResponse + # Given an input text, it returns a score that evaluates the factuality of + # the text. It also extracts and returns claims from the text and provides + # supporting facts. + rpc :CorroborateContent, ::Google::Cloud::AIPlatform::V1::CorroborateContentRequest, ::Google::Cloud::AIPlatform::V1::CorroborateContentResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb new file mode 100644 index 000000000000..78cfe5ac7b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/vizier_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/study_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/aiplatform/v1/vizier_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/study.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"H\n\x0fGetStudyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\"\x86\x01\n\x12\x43reateStudyRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x35\n\x05study\x18\x02 \x01(\x0b\x32!.google.cloud.aiplatform.v1.StudyB\x03\xe0\x41\x02\"\x80\x01\n\x12ListStudiesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"b\n\x13ListStudiesResponse\x12\x32\n\x07studies\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Study\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"K\n\x12\x44\x65leteStudyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\"j\n\x12LookupStudyRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xc7\x01\n\x14SuggestTrialsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\x12\x1d\n\x10suggestion_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tclient_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12?\n\x08\x63ontexts\x18\x04 \x03(\x0b\x32(.google.cloud.aiplatform.v1.TrialContextB\x03\xe0\x41\x01\"\xe6\x01\n\x15SuggestTrialsResponse\x12\x31\n\x06trials\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Trial\x12<\n\x0bstudy_state\x18\x02 \x01(\x0e\x32\'.google.cloud.aiplatform.v1.Study.State\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x15SuggestTrialsMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\x11\n\tclient_id\x18\x02 \x01(\t\"\x84\x01\n\x12\x43reateTrialRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\x12\x35\n\x05trial\x18\x02 \x01(\x0b\x32!.google.cloud.aiplatform.v1.TrialB\x03\xe0\x41\x02\"H\n\x0fGetTrialRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\"}\n\x11ListTrialsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"`\n\x12ListTrialsResponse\x12\x31\n\x06trials\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Trial\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9c\x01\n\x1a\x41\x64\x64TrialMeasurementRequest\x12;\n\ntrial_name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\x12\x41\n\x0bmeasurement\x18\x03 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MeasurementB\x03\xe0\x41\x02\"\xd5\x01\n\x14\x43ompleteTrialRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\x12G\n\x11\x66inal_measurement\x18\x02 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MeasurementB\x03\xe0\x41\x01\x12\x1d\n\x10trial_infeasible\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1e\n\x11infeasible_reason\x18\x04 \x01(\tB\x03\xe0\x41\x01\"K\n\x12\x44\x65leteTrialRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\"b\n#CheckTrialEarlyStoppingStateRequest\x12;\n\ntrial_name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\";\n$CheckTrialEarlyStoppingStateResponse\x12\x13\n\x0bshould_stop\x18\x01 \x01(\x08\"\x95\x01\n%CheckTrialEarlyStoppingStateMetatdata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\x12\r\n\x05study\x18\x02 \x01(\t\x12\r\n\x05trial\x18\x03 \x01(\t\"I\n\x10StopTrialRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Trial\"S\n\x18ListOptimalTrialsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Study\"V\n\x19ListOptimalTrialsResponse\x12\x39\n\x0eoptimal_trials\x18\x01 \x03(\x0b\x32!.google.cloud.aiplatform.v1.Trial2\xd4\x16\n\rVizierService\x12\xab\x01\n\x0b\x43reateStudy\x12..google.cloud.aiplatform.v1.CreateStudyRequest\x1a!.google.cloud.aiplatform.v1.Study\"I\xda\x41\x0cparent,study\x82\xd3\xe4\x93\x02\x34\"+/v1/{parent=projects/*/locations/*}/studies:\x05study\x12\x96\x01\n\x08GetStudy\x12+.google.cloud.aiplatform.v1.GetStudyRequest\x1a!.google.cloud.aiplatform.v1.Study\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/studies/*}\x12\xac\x01\n\x0bListStudies\x12..google.cloud.aiplatform.v1.ListStudiesRequest\x1a/.google.cloud.aiplatform.v1.ListStudiesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/studies\x12\x91\x01\n\x0b\x44\x65leteStudy\x12..google.cloud.aiplatform.v1.DeleteStudyRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/studies/*}\x12\xa8\x01\n\x0bLookupStudy\x12..google.cloud.aiplatform.v1.LookupStudyRequest\x1a!.google.cloud.aiplatform.v1.Study\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\"2/v1/{parent=projects/*/locations/*}/studies:lookup:\x01*\x12\xda\x01\n\rSuggestTrials\x12\x30.google.cloud.aiplatform.v1.SuggestTrialsRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41.\n\x15SuggestTrialsResponse\x12\x15SuggestTrialsMetadata\x82\xd3\xe4\x93\x02\x41\"\"9/v1/{name=projects/*/locations/*/studies/*/trials/*}:stop:\x01*\x12\xdc\x01\n\x11ListOptimalTrials\x12\x34.google.cloud.aiplatform.v1.ListOptimalTrialsRequest\x1a\x35.google.cloud.aiplatform.v1.ListOptimalTrialsResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\"F/v1/{parent=projects/*/locations/*/studies/*}/trials:listOptimalTrials:\x01*\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12VizierServiceProtoP\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.Study", "google/cloud/aiplatform/v1/study.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.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 + GetStudyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetStudyRequest").msgclass + CreateStudyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateStudyRequest").msgclass + ListStudiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListStudiesRequest").msgclass + ListStudiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListStudiesResponse").msgclass + DeleteStudyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteStudyRequest").msgclass + LookupStudyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.LookupStudyRequest").msgclass + SuggestTrialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SuggestTrialsRequest").msgclass + SuggestTrialsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SuggestTrialsResponse").msgclass + SuggestTrialsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SuggestTrialsMetadata").msgclass + CreateTrialRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateTrialRequest").msgclass + GetTrialRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetTrialRequest").msgclass + ListTrialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTrialsRequest").msgclass + ListTrialsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListTrialsResponse").msgclass + AddTrialMeasurementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AddTrialMeasurementRequest").msgclass + CompleteTrialRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CompleteTrialRequest").msgclass + DeleteTrialRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteTrialRequest").msgclass + CheckTrialEarlyStoppingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest").msgclass + CheckTrialEarlyStoppingStateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse").msgclass + CheckTrialEarlyStoppingStateMetatdata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateMetatdata").msgclass + StopTrialRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StopTrialRequest").msgclass + ListOptimalTrialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListOptimalTrialsRequest").msgclass + ListOptimalTrialsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListOptimalTrialsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb new file mode 100644 index 000000000000..e1b774f45037 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/vizier_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/vizier_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module VizierService + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.VizierService' + + # Creates a Study. A resource name will be generated after creation of the + # Study. + rpc :CreateStudy, ::Google::Cloud::AIPlatform::V1::CreateStudyRequest, ::Google::Cloud::AIPlatform::V1::Study + # Gets a Study by name. + rpc :GetStudy, ::Google::Cloud::AIPlatform::V1::GetStudyRequest, ::Google::Cloud::AIPlatform::V1::Study + # Lists all the studies in a region for an associated project. + rpc :ListStudies, ::Google::Cloud::AIPlatform::V1::ListStudiesRequest, ::Google::Cloud::AIPlatform::V1::ListStudiesResponse + # Deletes a Study. + rpc :DeleteStudy, ::Google::Cloud::AIPlatform::V1::DeleteStudyRequest, ::Google::Protobuf::Empty + # Looks a study up using the user-defined display_name field instead of the + # fully qualified resource name. + rpc :LookupStudy, ::Google::Cloud::AIPlatform::V1::LookupStudyRequest, ::Google::Cloud::AIPlatform::V1::Study + # Adds one or more Trials to a Study, with parameter values + # suggested by Vertex AI Vizier. Returns a long-running + # operation associated with the generation of Trial suggestions. + # When this long-running operation succeeds, it will contain + # a + # [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse]. + rpc :SuggestTrials, ::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest, ::Google::Longrunning::Operation + # Adds a user provided Trial to a Study. + rpc :CreateTrial, ::Google::Cloud::AIPlatform::V1::CreateTrialRequest, ::Google::Cloud::AIPlatform::V1::Trial + # Gets a Trial. + rpc :GetTrial, ::Google::Cloud::AIPlatform::V1::GetTrialRequest, ::Google::Cloud::AIPlatform::V1::Trial + # Lists the Trials associated with a Study. + rpc :ListTrials, ::Google::Cloud::AIPlatform::V1::ListTrialsRequest, ::Google::Cloud::AIPlatform::V1::ListTrialsResponse + # Adds a measurement of the objective metrics to a Trial. This measurement + # is assumed to have been taken before the Trial is complete. + rpc :AddTrialMeasurement, ::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest, ::Google::Cloud::AIPlatform::V1::Trial + # Marks a Trial as complete. + rpc :CompleteTrial, ::Google::Cloud::AIPlatform::V1::CompleteTrialRequest, ::Google::Cloud::AIPlatform::V1::Trial + # Deletes a Trial. + rpc :DeleteTrial, ::Google::Cloud::AIPlatform::V1::DeleteTrialRequest, ::Google::Protobuf::Empty + # Checks whether a Trial should stop or not. Returns a + # long-running operation. When the operation is successful, + # it will contain a + # [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]. + rpc :CheckTrialEarlyStoppingState, ::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest, ::Google::Longrunning::Operation + # Stops a Trial. + rpc :StopTrial, ::Google::Cloud::AIPlatform::V1::StopTrialRequest, ::Google::Cloud::AIPlatform::V1::Trial + # Lists the pareto-optimal Trials for multi-objective Study or the + # optimal Trials for single-objective Study. The definition of + # pareto-optimal can be checked in wiki page. + # https://en.wikipedia.org/wiki/Pareto_efficiency + rpc :ListOptimalTrials, ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest, ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/README.md new file mode 100644 index 000000000000..4197a8c4faad --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Vertex AI V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..1c6c0f32ec94 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..fb9115c630af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..13b2379bcaf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/httpbody.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Message that represents an arbitrary HTTP body. It should only be used for + # payload formats that can't be represented as JSON, such as raw binary or + # an HTML page. + # + # + # This message can be used both in streaming and non-streaming API methods in + # the request as well as the response. + # + # It can be used as a top-level request field, which is convenient if one + # wants to extract parameters from either the URL or HTTP template into the + # request fields and also want access to the raw HTTP body. + # + # Example: + # + # message GetResourceRequest { + # // A unique request id. + # string request_id = 1; + # + # // The raw HTTP body is bound to this field. + # google.api.HttpBody http_body = 2; + # + # } + # + # service ResourceService { + # rpc GetResource(GetResourceRequest) + # returns (google.api.HttpBody); + # rpc UpdateResource(google.api.HttpBody) + # returns (google.protobuf.Empty); + # + # } + # + # Example with streaming methods: + # + # service CaldavService { + # rpc GetCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # rpc UpdateCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # + # } + # + # Use of this type only changes how the request and response bodies are + # handled, all other features will continue to work unchanged. + # @!attribute [rw] content_type + # @return [::String] + # The HTTP Content-Type header value specifying the content type of the body. + # @!attribute [rw] data + # @return [::String] + # The HTTP request/response body as raw binary. + # @!attribute [rw] extensions + # @return [::Array<::Google::Protobuf::Any>] + # Application specific response metadata. Must be set in the first response + # for streaming APIs. + class HttpBody + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..b836bdb60b21 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..71b994c7ef20 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb new file mode 100644 index 000000000000..dfde7d672195 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a hardware accelerator type. + module AcceleratorType + # Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0 + + # Deprecated: Nvidia Tesla K80 GPU has reached end of support, + # see https://cloud.google.com/compute/docs/eol/k80-eol. + NVIDIA_TESLA_K80 = 1 + + # Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2 + + # Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3 + + # Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4 + + # Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5 + + # Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8 + + # Nvidia A100 80GB GPU. + NVIDIA_A100_80GB = 9 + + # Nvidia L4 GPU. + NVIDIA_L4 = 11 + + # Nvidia H100 80Gb GPU. + NVIDIA_H100_80GB = 13 + + # Nvidia H100 Mega 80Gb GPU. + NVIDIA_H100_MEGA_80GB = 14 + + # TPU v2. + TPU_V2 = 6 + + # TPU v3. + TPU_V3 = 7 + + # TPU v4. + TPU_V4_POD = 10 + + # TPU v5. + TPU_V5_LITEPOD = 12 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation.rb new file mode 100644 index 000000000000..f26aa13a4f9d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Used to assign specific AnnotationSpec to a particular area of a DataItem or + # the whole part of the DataItem. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the Annotation. + # @!attribute [rw] payload_schema_uri + # @return [::String] + # Required. Google Cloud Storage URI points to a YAML file describing + # {::Google::Cloud::AIPlatform::V1::Annotation#payload payload}. The schema is + # defined as an [OpenAPI 3.0.2 Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # The schema files that can be used here are found in + # gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the + # chosen schema must be consistent with the parent Dataset's + # {::Google::Cloud::AIPlatform::V1::Dataset#metadata_schema_uri metadata}. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Value] + # Required. The schema of the payload can be found in + # {::Google::Cloud::AIPlatform::V1::Annotation#payload_schema_uri payload_schema}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Annotation was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Annotation was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [r] annotation_source + # @return [::Google::Cloud::AIPlatform::V1::UserActionReference] + # Output only. The source of the Annotation. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # Annotations. + # + # 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. + # No more than 64 user labels can be associated with one Annotation(System + # labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. Following system labels exist for each Annotation: + # + # * "aiplatform.googleapis.com/annotation_set_name": + # optional, name of the UI's annotation set this Annotation belongs to. + # If not set, the Annotation is not visible in the UI. + # + # * "aiplatform.googleapis.com/payload_schema": + # output only, its value is the + # [payload_schema's][google.cloud.aiplatform.v1.Annotation.payload_schema_uri] + # title. + class Annotation + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation_spec.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation_spec.rb new file mode 100644 index 000000000000..a9f49dffad20 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/annotation_spec.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Identifies a concept with which DataItems may be annotated with. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the AnnotationSpec. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the AnnotationSpec. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this AnnotationSpec was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when AnnotationSpec was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + class AnnotationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/api_auth.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/api_auth.rb new file mode 100644 index 000000000000..d325492c19da --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/api_auth.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The generic reusable api auth config. + # @!attribute [rw] api_key_config + # @return [::Google::Cloud::AIPlatform::V1::ApiAuth::ApiKeyConfig] + # The API secret. + class ApiAuth + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The API secret. + # @!attribute [rw] api_key_secret_version + # @return [::String] + # Required. The SecretManager secret version resource name storing API key. + # e.g. projects/\\{project}/secrets/\\{secret}/versions/\\{version} + class ApiKeyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb new file mode 100644 index 000000000000..4f329cde0dcf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Instance of a general artifact. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the Artifact. + # @!attribute [rw] display_name + # @return [::String] + # User provided display name of the Artifact. + # May be up to 128 Unicode characters. + # @!attribute [rw] uri + # @return [::String] + # The uniform resource identifier of the artifact file. + # May be empty if there is no actual artifact file. + # @!attribute [rw] etag + # @return [::String] + # An eTag used to perform consistent read-modify-write updates. If not set, a + # blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Artifacts. + # + # 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. + # No more than 64 user labels can be associated with one Artifact (System + # labels are excluded). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Artifact was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Artifact was last updated. + # @!attribute [rw] state + # @return [::Google::Cloud::AIPlatform::V1::Artifact::State] + # The state of this Artifact. This is a property of the Artifact, and does + # not imply or capture any ongoing process. This property is managed by + # clients (such as Vertex AI Pipelines), and the system does not prescribe + # or check the validity of state transitions. + # @!attribute [rw] schema_title + # @return [::String] + # The title of the schema describing the metadata. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] schema_version + # @return [::String] + # The version of the schema in schema_name to use. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Properties of the Artifact. + # Top level metadata keys' heading and trailing spaces will be trimmed. + # The size of this field should not exceed 200KB. + # @!attribute [rw] description + # @return [::String] + # Description of the Artifact + class Artifact + 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 + + # Describes the state of the Artifact. + module State + # Unspecified state for the Artifact. + STATE_UNSPECIFIED = 0 + + # A state used by systems like Vertex AI Pipelines to indicate that the + # underlying data item represented by this Artifact is being created. + PENDING = 1 + + # A state indicating that the Artifact should exist, unless something + # external to the system deletes it. + LIVE = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb new file mode 100644 index 000000000000..51aa42de81ac --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A job that uses a + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#model Model} to produce + # predictions on multiple [input + # instances][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If + # predictions for significant portion of the instances fail, the job may finish + # without attempting predictions for all remaining instances. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the BatchPredictionJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of this BatchPredictionJob. + # @!attribute [rw] model + # @return [::String] + # The name of the Model resource that produces the predictions via this job, + # must share the same ancestor Location. + # Starting this job has no impact on any existing deployments of the Model + # and their resources. + # Exactly one of model and unmanaged_container_model must be set. + # + # The model resource name may contain version id or version alias to specify + # the version. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # if no version is specified, the default version will be deployed. + # + # The model resource could also be a publisher model. + # Example: `publishers/{publisher}/models/{model}` + # or + # `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + # @!attribute [r] model_version_id + # @return [::String] + # Output only. The version ID of the Model that produces the predictions via + # this job. + # @!attribute [rw] unmanaged_container_model + # @return [::Google::Cloud::AIPlatform::V1::UnmanagedContainerModel] + # Contains model information necessary to perform batch prediction without + # requiring uploading to model registry. + # Exactly one of model and unmanaged_container_model must be set. + # @!attribute [rw] input_config + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig] + # Required. Input configuration of the instances on which predictions are + # performed. The schema of any single instance may be specified via the + # [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig] + # Configuration for how to convert batch prediction input instances to the + # prediction instances that are sent to the Model. + # @!attribute [rw] model_parameters + # @return [::Google::Protobuf::Value] + # The parameters that govern the predictions. The schema of the parameters + # may be specified via the + # [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # @!attribute [rw] output_config + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig] + # Required. The Configuration specifying where output predictions should + # be written. + # The schema of any single prediction may be specified as a concatenation + # of [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri} + # and + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#prediction_schema_uri prediction_schema_uri}. + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::AIPlatform::V1::BatchDedicatedResources] + # The config of resources used by the Model during the batch prediction. If + # the Model + # {::Google::Cloud::AIPlatform::V1::Model#supported_deployment_resources_types supports} + # DEDICATED_RESOURCES this config may be provided (and the job will use these + # resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config + # must be provided. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the DeployedModel's container runs as. If not + # specified, a system generated one will be used, which + # has minimal permissions and the custom container, if used, may not have + # enough permission to access other Google Cloud resources. + # + # Users deploying the Model must have the `iam.serviceAccounts.actAs` + # permission on this service account. + # @!attribute [rw] manual_batch_tuning_parameters + # @return [::Google::Cloud::AIPlatform::V1::ManualBatchTuningParameters] + # Immutable. Parameters configuring the batch behavior. Currently only + # applicable when + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#dedicated_resources dedicated_resources} + # are used (in other cases Vertex AI does the tuning itself). + # @!attribute [rw] generate_explanation + # @return [::Boolean] + # Generate explanation with the batch prediction results. + # + # When set to `true`, the batch prediction output changes based on the + # `predictions_format` field of the + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#output_config BatchPredictionJob.output_config} + # object: + # + # * `bigquery`: output includes a column named `explanation`. The value + # is a struct that conforms to the + # {::Google::Cloud::AIPlatform::V1::Explanation Explanation} object. + # * `jsonl`: The JSON objects on each line include an additional entry + # keyed `explanation`. The value of the entry is a JSON object that + # conforms to the {::Google::Cloud::AIPlatform::V1::Explanation Explanation} + # object. + # * `csv`: Generating explanations for CSV format is not supported. + # + # If this field is set to true, either the + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec} + # or + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#explanation_spec explanation_spec} + # must be populated. + # @!attribute [rw] explanation_spec + # @return [::Google::Cloud::AIPlatform::V1::ExplanationSpec] + # Explanation configuration for this BatchPredictionJob. Can be + # specified only if + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#generate_explanation generate_explanation} + # is set to `true`. + # + # This value overrides the value of + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec}. + # All fields of + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#explanation_spec explanation_spec} + # are optional in the request. If a field of the + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#explanation_spec explanation_spec} + # object is not populated, the corresponding field of the + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec} + # object is inherited. + # @!attribute [r] output_info + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputInfo] + # Output only. Information further describing the output of this job. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the job. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when the job's state is JOB_STATE_FAILED or + # JOB_STATE_CANCELLED. + # @!attribute [r] partial_failures + # @return [::Array<::Google::Rpc::Status>] + # Output only. Partial failures encountered. + # For example, single files that can't be read. + # This field never exceeds 20 entries. + # Status details fields contain standard Google Cloud error details. + # @!attribute [r] resources_consumed + # @return [::Google::Cloud::AIPlatform::V1::ResourcesConsumed] + # Output only. Information about resources that had been consumed by this + # job. Provided in real time at best effort basis, as well as a final value + # once the job completes. + # + # Note: This field currently may be not populated for batch predictions that + # use AutoML Models. + # @!attribute [r] completion_stats + # @return [::Google::Cloud::AIPlatform::V1::CompletionStats] + # Output only. Statistics on completed and failed prediction instances. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the BatchPredictionJob was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the BatchPredictionJob for the first time entered + # the `JOB_STATE_RUNNING` state. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the BatchPredictionJob entered any of the following + # states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the BatchPredictionJob was most recently updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize BatchPredictionJobs. + # + # 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] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key options for a BatchPredictionJob. If this + # is set, then all resources created by the BatchPredictionJob will be + # encrypted with the provided encryption key. + # @!attribute [rw] disable_container_logging + # @return [::Boolean] + # For custom-trained Models and AutoML Tabular Models, the container of the + # DeployedModel instances will send `stderr` and `stdout` streams to + # Cloud Logging by default. Please note that the logs incur cost, + # which are subject to [Cloud Logging + # pricing](https://cloud.google.com/logging/pricing). + # + # User can disable container logging by setting this flag to true. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class BatchPredictionJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configures the input to + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. See + # {::Google::Cloud::AIPlatform::V1::Model#supported_input_storage_formats Model.supported_input_storage_formats} + # for Model's supported input formats, and how instances should be expressed + # via any of them. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # The Cloud Storage location for the input instances. + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::AIPlatform::V1::BigQuerySource] + # The BigQuery location of the input table. + # The schema of the table should be in the format described by the given + # context OpenAPI Schema, if one is provided. The table may contain + # additional columns that are not described by the schema, and they will + # be ignored. + # @!attribute [rw] instances_format + # @return [::String] + # Required. The format in which instances are given, must be one of the + # [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + # {::Google::Cloud::AIPlatform::V1::Model#supported_input_storage_formats supported_input_storage_formats}. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration defining how to transform batch prediction input instances to + # the instances that the Model accepts. + # @!attribute [rw] instance_type + # @return [::String] + # The format of the instance that the Model accepts. Vertex AI will + # convert compatible + # [batch prediction input instance + # formats][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.instances_format] + # to the specified format. + # + # Supported values are: + # + # * `object`: Each input is converted to JSON object format. + # * For `bigquery`, each row is converted to an object. + # * For `jsonl`, each line of the JSONL input must be an object. + # * Does not apply to `csv`, `file-list`, `tf-record`, or + # `tf-record-gzip`. + # + # * `array`: Each input is converted to JSON array format. + # * For `bigquery`, each row is converted to an array. The order + # of columns is determined by the BigQuery column order, unless + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#included_fields included_fields} + # is populated. + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#included_fields included_fields} + # must be populated for specifying field orders. + # * For `jsonl`, if each line of the JSONL input is an object, + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#included_fields included_fields} + # must be populated for specifying field orders. + # * Does not apply to `csv`, `file-list`, `tf-record`, or + # `tf-record-gzip`. + # + # If not specified, Vertex AI converts the batch prediction input as + # follows: + # + # * For `bigquery` and `csv`, the behavior is the same as `array`. The + # order of columns is the same as defined in the file or table, unless + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#included_fields included_fields} + # is populated. + # * For `jsonl`, the prediction instance format is determined by + # each line of the input. + # * For `tf-record`/`tf-record-gzip`, each record will be converted to + # an object in the format of `{"b64": }`, where `` is + # the Base64-encoded string of the content of the record. + # * For `file-list`, each file in the list will be converted to an + # object in the format of `{"b64": }`, where `` is + # the Base64-encoded string of the content of the file. + # @!attribute [rw] key_field + # @return [::String] + # The name of the field that is considered as a key. + # + # The values identified by the key field is not included in the transformed + # instances that is sent to the Model. This is similar to + # specifying this name of the field in + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#excluded_fields excluded_fields}. + # In addition, the batch prediction output will not include the instances. + # Instead the output will only include the value of the key field, in a + # field named `key` in the output: + # + # * For `jsonl` output format, the output will have a `key` field + # instead of the `instance` field. + # * For `csv`/`bigquery` output format, the output will have have a `key` + # column instead of the instance feature columns. + # + # The input must be JSONL with objects at each line, CSV, BigQuery + # or TfRecord. + # @!attribute [rw] included_fields + # @return [::Array<::String>] + # Fields that will be included in the prediction instance that is + # sent to the Model. + # + # If + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#instance_type instance_type} + # is `array`, the order of field names in included_fields also determines + # the order of the values in the array. + # + # When included_fields is populated, + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#excluded_fields excluded_fields} + # must be empty. + # + # The input must be JSONL with objects at each line, BigQuery + # or TfRecord. + # @!attribute [rw] excluded_fields + # @return [::Array<::String>] + # Fields that will be excluded in the prediction instance that is + # sent to the Model. + # + # Excluded will be attached to the batch prediction output if + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#key_field key_field} + # is not specified. + # + # When excluded_fields is populated, + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InstanceConfig#included_fields included_fields} + # must be empty. + # + # The input must be JSONL with objects at each line, BigQuery + # or TfRecord. + class InstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configures the output of + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. See + # {::Google::Cloud::AIPlatform::V1::Model#supported_output_storage_formats Model.supported_output_storage_formats} + # for supported output formats, and how predictions are expressed via any of + # them. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # The Cloud Storage location of the directory where the output is + # to be written to. In the given directory a new directory is created. + # Its name is `prediction--`, + # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + # Inside of it files `predictions_0001.`, + # `predictions_0002.`, ..., `predictions_N.` + # are created where `` depends on chosen + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig#predictions_format predictions_format}, + # and N may equal 0001 and depends on the total number of successfully + # predicted instances. If the Model has both + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance} + # and + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri prediction} + # schemata defined then each such file contains predictions as per the + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig#predictions_format predictions_format}. + # If prediction for any instance failed (partially or completely), then + # an additional `errors_0001.`, `errors_0002.`,..., + # `errors_N.` files are created (N depends on total number + # of failed predictions). These files contain the failed instances, + # as per their schema, followed by an additional `error` field which as + # value has {::Google::Rpc::Status google.rpc.Status} + # containing only `code` and `message` fields. + # @!attribute [rw] bigquery_destination + # @return [::Google::Cloud::AIPlatform::V1::BigQueryDestination] + # The BigQuery project or dataset location where the output is to be + # written to. If project is provided, a new dataset is created with name + # `prediction__` + # where is made + # BigQuery-dataset-name compatible (for example, most special characters + # become underscores), and timestamp is in + # YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset + # two tables will be created, `predictions`, and `errors`. + # If the Model has both + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance} + # and + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri prediction} + # schemata defined then the tables have columns as follows: The + # `predictions` table contains instances for which the prediction + # succeeded, it has columns as per a concatenation of the Model's + # instance and prediction schemata. The `errors` table contains rows for + # which the prediction has failed, it has instance columns, as per the + # instance schema, followed by a single "errors" column, which as values + # has {::Google::Rpc::Status google.rpc.Status} + # represented as a STRUCT, and containing only `code` and `message`. + # @!attribute [rw] predictions_format + # @return [::String] + # Required. The format in which Vertex AI gives the predictions, must be + # one of the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + # {::Google::Cloud::AIPlatform::V1::Model#supported_output_storage_formats supported_output_storage_formats}. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Further describes this job's output. + # Supplements + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#output_config output_config}. + # @!attribute [r] gcs_output_directory + # @return [::String] + # Output only. The full path of the Cloud Storage directory created, into + # which the prediction output is written. + # @!attribute [r] bigquery_output_dataset + # @return [::String] + # Output only. The path of the BigQuery dataset created, in + # `bq://projectId.bqDatasetId` + # format, into which the prediction output is written. + # @!attribute [r] bigquery_output_table + # @return [::String] + # Output only. The name of the BigQuery table created, in + # `predictions_` + # format, into which the prediction output is written. + # Can be used by UI to generate the BigQuery output path, for example. + class OutputInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/cached_content.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/cached_content.rb new file mode 100644 index 000000000000..a8263bce687b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/cached_content.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A resource used in LLM queries for users to explicitly specify what to cache + # and how to cache. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of when this resource is considered expired. + # This is *always* provided on output, regardless of what was sent + # on input. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL for this resource. The expiration time is computed: + # now + TTL. + # @!attribute [rw] name + # @return [::String] + # Immutable. Identifier. The server-generated resource name of the cached + # content Format: + # projects/\\{project}/locations/\\{location}/cachedContents/\\{cached_content} + # @!attribute [rw] display_name + # @return [::String] + # Optional. Immutable. The user-generated meaningful display name of the + # cached content. + # @!attribute [rw] model + # @return [::String] + # Immutable. The name of the publisher model to use for cached content. + # Format: + # projects/\\{project}/locations/\\{location}/publishers/\\{publisher}/models/\\{model} + # @!attribute [rw] system_instruction + # @return [::Google::Cloud::AIPlatform::V1::Content] + # Optional. Input only. Immutable. Developer set system instruction. + # Currently, text only + # @!attribute [rw] contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::Content>] + # Optional. Input only. Immutable. The content to cache + # @!attribute [rw] tools + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tool>] + # Optional. Input only. Immutable. A list of `Tools` the model may use to + # generate the next response + # @!attribute [rw] tool_config + # @return [::Google::Cloud::AIPlatform::V1::ToolConfig] + # Optional. Input only. Immutable. Tool config. This config is shared for all + # tools + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creatation time of the cache entry. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the cache entry was last updated in UTC time. + # @!attribute [r] usage_metadata + # @return [::Google::Cloud::AIPlatform::V1::CachedContent::UsageMetadata] + # Output only. Metadata on the usage of the cached content. + class CachedContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata on the usage of the cached content. + # @!attribute [rw] total_token_count + # @return [::Integer] + # Total number of tokens that the cached content consumes. + # @!attribute [rw] text_count + # @return [::Integer] + # Number of text characters. + # @!attribute [rw] image_count + # @return [::Integer] + # Number of images. + # @!attribute [rw] video_duration_seconds + # @return [::Integer] + # Duration of video in seconds. + # @!attribute [rw] audio_duration_seconds + # @return [::Integer] + # Duration of audio in seconds. + class UsageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/completion_stats.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/completion_stats.rb new file mode 100644 index 000000000000..86da1c1678ee --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/completion_stats.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Success and error statistics of processing multiple entities + # (for example, DataItems or structured data rows) in batch. + # @!attribute [r] successful_count + # @return [::Integer] + # Output only. The number of entities that had been processed successfully. + # @!attribute [r] failed_count + # @return [::Integer] + # Output only. The number of entities for which any error was encountered. + # @!attribute [r] incomplete_count + # @return [::Integer] + # Output only. In cases when enough errors are encountered a job, pipeline, + # or operation may be failed as a whole. Below is the number of entities for + # which the processing had not been finished (either in successful or failed + # state). Set to -1 if the number is unknown (for example, the operation + # failed before the total entity number could be collected). + # @!attribute [r] successful_forecast_point_count + # @return [::Integer] + # Output only. The number of the successful forecast points that are + # generated by the forecasting model. This is ONLY used by the forecasting + # batch prediction. + class CompletionStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/content.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/content.rb new file mode 100644 index 000000000000..263ce293a579 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/content.rb @@ -0,0 +1,637 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The base structured datatype containing multi-part content of a message. + # + # A `Content` includes a `role` field designating the producer of the `Content` + # and a `parts` field containing multi-part data that contains the content of + # the message turn. + # @!attribute [rw] role + # @return [::String] + # Optional. The producer of the content. Must be either 'user' or 'model'. + # + # Useful to set for multi-turn conversations, otherwise can be left blank + # or unset. + # @!attribute [rw] parts + # @return [::Array<::Google::Cloud::AIPlatform::V1::Part>] + # Required. Ordered `Parts` that constitute a single message. Parts may have + # different IANA MIME types. + class Content + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A datatype containing media that is part of a multi-part `Content` message. + # + # A `Part` consists of data which has an associated datatype. A `Part` can only + # contain one of the accepted types in `Part.data`. + # + # A `Part` must have a fixed IANA MIME type identifying the type and subtype + # of the media if `inline_data` or `file_data` field is filled with raw bytes. + # @!attribute [rw] text + # @return [::String] + # Optional. Text part (can be code). + # @!attribute [rw] inline_data + # @return [::Google::Cloud::AIPlatform::V1::Blob] + # Optional. Inlined bytes data. + # @!attribute [rw] file_data + # @return [::Google::Cloud::AIPlatform::V1::FileData] + # Optional. URI based data. + # @!attribute [rw] function_call + # @return [::Google::Cloud::AIPlatform::V1::FunctionCall] + # Optional. A predicted [FunctionCall] returned from the model that + # contains a string representing the [FunctionDeclaration.name] with the + # parameters and their values. + # @!attribute [rw] function_response + # @return [::Google::Cloud::AIPlatform::V1::FunctionResponse] + # Optional. The result output of a [FunctionCall] that contains a string + # representing the [FunctionDeclaration.name] and a structured JSON object + # containing any output from the function call. It is used as context to + # the model. + # @!attribute [rw] video_metadata + # @return [::Google::Cloud::AIPlatform::V1::VideoMetadata] + # Optional. Video metadata. The metadata should only be specified while the + # video data is presented in inline_data or file_data. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Content blob. + # + # It's preferred to send as {::Google::Cloud::AIPlatform::V1::Part#text text} + # directly rather than raw bytes. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The IANA standard MIME type of the source data. + # @!attribute [rw] data + # @return [::String] + # Required. Raw bytes. + class Blob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # URI based data. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The IANA standard MIME type of the source data. + # @!attribute [rw] file_uri + # @return [::String] + # Required. URI. + class FileData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata describes the input video content. + # @!attribute [rw] start_offset + # @return [::Google::Protobuf::Duration] + # Optional. The start offset of the video. + # @!attribute [rw] end_offset + # @return [::Google::Protobuf::Duration] + # Optional. The end offset of the video. + class VideoMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Generation config. + # @!attribute [rw] temperature + # @return [::Float] + # Optional. Controls the randomness of predictions. + # @!attribute [rw] top_p + # @return [::Float] + # Optional. If specified, nucleus sampling will be used. + # @!attribute [rw] top_k + # @return [::Float] + # Optional. If specified, top-k sampling will be used. + # @!attribute [rw] candidate_count + # @return [::Integer] + # Optional. Number of candidates to generate. + # @!attribute [rw] max_output_tokens + # @return [::Integer] + # Optional. The maximum number of output tokens to generate per message. + # @!attribute [rw] stop_sequences + # @return [::Array<::String>] + # Optional. Stop sequences. + # @!attribute [rw] response_logprobs + # @return [::Boolean] + # Optional. If true, export the logprobs results in response. + # @!attribute [rw] logprobs + # @return [::Integer] + # Optional. Logit probabilities. + # @!attribute [rw] presence_penalty + # @return [::Float] + # Optional. Positive penalties. + # @!attribute [rw] frequency_penalty + # @return [::Float] + # Optional. Frequency penalties. + # @!attribute [rw] seed + # @return [::Integer] + # Optional. Seed. + # @!attribute [rw] response_mime_type + # @return [::String] + # Optional. Output response mimetype of the generated candidate text. + # Supported mimetype: + # - `text/plain`: (default) Text output. + # - `application/json`: JSON response in the candidates. + # The model needs to be prompted to output the appropriate response type, + # otherwise the behavior is undefined. + # This is a preview feature. + # @!attribute [rw] response_schema + # @return [::Google::Cloud::AIPlatform::V1::Schema] + # Optional. The `Schema` object allows the definition of input and output + # data types. These types can be objects, but also primitives and arrays. + # Represents a select subset of an [OpenAPI 3.0 schema + # object](https://spec.openapis.org/oas/v3.0.3#schema). + # If set, a compatible response_mime_type must also be set. + # Compatible mimetypes: + # `application/json`: Schema for JSON response. + # @!attribute [rw] routing_config + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig] + # Optional. Routing configuration. + class GenerationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration for routing the request to a specific model. + # @!attribute [rw] auto_mode + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig::AutoRoutingMode] + # Automated routing. + # @!attribute [rw] manual_mode + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig::ManualRoutingMode] + # Manual routing. + class RoutingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # When automated routing is specified, the routing will be determined by + # the pretrained routing model and customer provided model routing + # preference. + # @!attribute [rw] model_routing_preference + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig::AutoRoutingMode::ModelRoutingPreference] + # The model routing preference. + class AutoRoutingMode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The model routing preference. + module ModelRoutingPreference + # Unspecified model routing preference. + UNKNOWN = 0 + + # Prefer higher quality over low cost. + PRIORITIZE_QUALITY = 1 + + # Balanced model routing preference. + BALANCED = 2 + + # Prefer lower cost over higher quality. + PRIORITIZE_COST = 3 + end + end + + # When manual routing is set, the specified model will be used directly. + # @!attribute [rw] model_name + # @return [::String] + # The model name to use. Only the public LLM models are accepted. e.g. + # 'gemini-1.5-pro-001'. + class ManualRoutingMode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Safety settings. + # @!attribute [rw] category + # @return [::Google::Cloud::AIPlatform::V1::HarmCategory] + # Required. Harm category. + # @!attribute [rw] threshold + # @return [::Google::Cloud::AIPlatform::V1::SafetySetting::HarmBlockThreshold] + # Required. The harm block threshold. + # @!attribute [rw] method + # @return [::Google::Cloud::AIPlatform::V1::SafetySetting::HarmBlockMethod] + # Optional. Specify if the threshold is used for probability or severity + # score. If not specified, the threshold is used for probability score. + class SafetySetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Probability based thresholds levels for blocking. + module HarmBlockThreshold + # Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0 + + # Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1 + + # Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2 + + # Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3 + + # Block none. + BLOCK_NONE = 4 + + # Turn off the safety filter. + OFF = 5 + end + + # Probability vs severity. + module HarmBlockMethod + # The harm block method is unspecified. + HARM_BLOCK_METHOD_UNSPECIFIED = 0 + + # The harm block method uses both probability and severity scores. + SEVERITY = 1 + + # The harm block method uses the probability score. + PROBABILITY = 2 + end + end + + # Safety rating corresponding to the generated content. + # @!attribute [r] category + # @return [::Google::Cloud::AIPlatform::V1::HarmCategory] + # Output only. Harm category. + # @!attribute [r] probability + # @return [::Google::Cloud::AIPlatform::V1::SafetyRating::HarmProbability] + # Output only. Harm probability levels in the content. + # @!attribute [r] probability_score + # @return [::Float] + # Output only. Harm probability score. + # @!attribute [r] severity + # @return [::Google::Cloud::AIPlatform::V1::SafetyRating::HarmSeverity] + # Output only. Harm severity levels in the content. + # @!attribute [r] severity_score + # @return [::Float] + # Output only. Harm severity score. + # @!attribute [r] blocked + # @return [::Boolean] + # Output only. Indicates whether the content was filtered out because of this + # rating. + class SafetyRating + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Harm probability levels in the content. + module HarmProbability + # Harm probability unspecified. + HARM_PROBABILITY_UNSPECIFIED = 0 + + # Negligible level of harm. + NEGLIGIBLE = 1 + + # Low level of harm. + LOW = 2 + + # Medium level of harm. + MEDIUM = 3 + + # High level of harm. + HIGH = 4 + end + + # Harm severity levels. + module HarmSeverity + # Harm severity unspecified. + HARM_SEVERITY_UNSPECIFIED = 0 + + # Negligible level of harm severity. + HARM_SEVERITY_NEGLIGIBLE = 1 + + # Low level of harm severity. + HARM_SEVERITY_LOW = 2 + + # Medium level of harm severity. + HARM_SEVERITY_MEDIUM = 3 + + # High level of harm severity. + HARM_SEVERITY_HIGH = 4 + end + end + + # A collection of source attributions for a piece of content. + # @!attribute [r] citations + # @return [::Array<::Google::Cloud::AIPlatform::V1::Citation>] + # Output only. List of citations. + class CitationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Source attributions for content. + # @!attribute [r] start_index + # @return [::Integer] + # Output only. Start index into the content. + # @!attribute [r] end_index + # @return [::Integer] + # Output only. End index into the content. + # @!attribute [r] uri + # @return [::String] + # Output only. Url reference of the attribution. + # @!attribute [r] title + # @return [::String] + # Output only. Title of the attribution. + # @!attribute [r] license + # @return [::String] + # Output only. License of the attribution. + # @!attribute [r] publication_date + # @return [::Google::Type::Date] + # Output only. Publication date of the attribution. + class Citation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response candidate generated from the model. + # @!attribute [r] index + # @return [::Integer] + # Output only. Index of the candidate. + # @!attribute [r] content + # @return [::Google::Cloud::AIPlatform::V1::Content] + # Output only. Content parts of the candidate. + # @!attribute [r] score + # @return [::Float] + # Output only. Confidence score of the candidate. + # @!attribute [r] avg_logprobs + # @return [::Float] + # Output only. Average log probability score of the candidate. + # @!attribute [r] logprobs_result + # @return [::Google::Cloud::AIPlatform::V1::LogprobsResult] + # Output only. Log-likelihood scores for the response tokens and top tokens + # @!attribute [r] finish_reason + # @return [::Google::Cloud::AIPlatform::V1::Candidate::FinishReason] + # Output only. The reason why the model stopped generating tokens. + # If empty, the model has not stopped generating the tokens. + # @!attribute [r] safety_ratings + # @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>] + # Output only. List of ratings for the safety of a response candidate. + # + # There is at most one rating per category. + # @!attribute [r] finish_message + # @return [::String] + # Output only. Describes the reason the mode stopped generating tokens in + # more detail. This is only filled when `finish_reason` is set. + # @!attribute [r] citation_metadata + # @return [::Google::Cloud::AIPlatform::V1::CitationMetadata] + # Output only. Source attribution of the generated content. + # @!attribute [r] grounding_metadata + # @return [::Google::Cloud::AIPlatform::V1::GroundingMetadata] + # Output only. Metadata specifies sources used to ground generated content. + class Candidate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The reason why the model stopped generating tokens. + # If empty, the model has not stopped generating the tokens. + module FinishReason + # The finish reason is unspecified. + FINISH_REASON_UNSPECIFIED = 0 + + # Token generation reached a natural stopping point or a configured stop + # sequence. + STOP = 1 + + # Token generation reached the configured maximum output tokens. + MAX_TOKENS = 2 + + # Token generation stopped because the content potentially contains safety + # violations. NOTE: When streaming, + # {::Google::Cloud::AIPlatform::V1::Candidate#content content} is empty if + # content filters blocks the output. + SAFETY = 3 + + # Token generation stopped because the content potentially contains + # copyright violations. + RECITATION = 4 + + # All other reasons that stopped the token generation. + OTHER = 5 + + # Token generation stopped because the content contains forbidden terms. + BLOCKLIST = 6 + + # Token generation stopped for potentially containing prohibited content. + PROHIBITED_CONTENT = 7 + + # Token generation stopped because the content potentially contains + # Sensitive Personally Identifiable Information (SPII). + SPII = 8 + + # The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 9 + end + end + + # Logprobs Result + # @!attribute [rw] top_candidates + # @return [::Array<::Google::Cloud::AIPlatform::V1::LogprobsResult::TopCandidates>] + # Length = total number of decoding steps. + # @!attribute [rw] chosen_candidates + # @return [::Array<::Google::Cloud::AIPlatform::V1::LogprobsResult::Candidate>] + # Length = total number of decoding steps. + # The chosen candidates may or may not be in top_candidates. + class LogprobsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Candidate for the logprobs token and score. + # @!attribute [rw] token + # @return [::String] + # The candidate’s token string value. + # @!attribute [rw] token_id + # @return [::Integer] + # The candidate’s token id value. + # @!attribute [rw] log_probability + # @return [::Float] + # The candidate's log probability. + class Candidate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Candidates with top log probabilities at each decoding step. + # @!attribute [rw] candidates + # @return [::Array<::Google::Cloud::AIPlatform::V1::LogprobsResult::Candidate>] + # Sorted by log probability in descending order. + class TopCandidates + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Segment of the content. + # @!attribute [r] part_index + # @return [::Integer] + # Output only. The index of a Part object within its parent Content object. + # @!attribute [r] start_index + # @return [::Integer] + # Output only. Start index in the given Part, measured in bytes. Offset from + # the start of the Part, inclusive, starting at zero. + # @!attribute [r] end_index + # @return [::Integer] + # Output only. End index in the given Part, measured in bytes. Offset from + # the start of the Part, exclusive, starting at zero. + # @!attribute [r] text + # @return [::String] + # Output only. The text corresponding to the segment from the response. + class Segment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Grounding chunk. + # @!attribute [rw] web + # @return [::Google::Cloud::AIPlatform::V1::GroundingChunk::Web] + # Grounding chunk from the web. + # @!attribute [rw] retrieved_context + # @return [::Google::Cloud::AIPlatform::V1::GroundingChunk::RetrievedContext] + # Grounding chunk from context retrieved by the retrieval tools. + class GroundingChunk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Chunk from the web. + # @!attribute [rw] uri + # @return [::String] + # URI reference of the chunk. + # @!attribute [rw] title + # @return [::String] + # Title of the chunk. + class Web + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Chunk from context retrieved by the retrieval tools. + # @!attribute [rw] uri + # @return [::String] + # URI reference of the attribution. + # @!attribute [rw] title + # @return [::String] + # Title of the attribution. + # @!attribute [rw] text + # @return [::String] + # Text of the attribution. + class RetrievedContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Grounding support. + # @!attribute [rw] segment + # @return [::Google::Cloud::AIPlatform::V1::Segment] + # Segment of the content this support belongs to. + # @!attribute [rw] grounding_chunk_indices + # @return [::Array<::Integer>] + # A list of indices (into 'grounding_chunk') specifying the + # citations associated with the claim. For instance [1,3,4] means + # that grounding_chunk[1], grounding_chunk[3], + # grounding_chunk[4] are the retrieved content attributed to the claim. + # @!attribute [rw] confidence_scores + # @return [::Array<::Float>] + # Confidence score of the support references. Ranges from 0 to 1. 1 is the + # most confident. This list must have the same size as the + # grounding_chunk_indices. + class GroundingSupport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata returned to client when grounding is enabled. + # @!attribute [rw] web_search_queries + # @return [::Array<::String>] + # Optional. Web search queries for the following-up web search. + # @!attribute [rw] search_entry_point + # @return [::Google::Cloud::AIPlatform::V1::SearchEntryPoint] + # Optional. Google search entry for the following-up web searches. + # @!attribute [rw] grounding_chunks + # @return [::Array<::Google::Cloud::AIPlatform::V1::GroundingChunk>] + # List of supporting references retrieved from specified grounding source. + # @!attribute [rw] grounding_supports + # @return [::Array<::Google::Cloud::AIPlatform::V1::GroundingSupport>] + # Optional. List of grounding support. + # @!attribute [r] retrieval_metadata + # @return [::Google::Cloud::AIPlatform::V1::RetrievalMetadata] + # Optional. Output only. Retrieval metadata. + class GroundingMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Google search entry point. + # @!attribute [rw] rendered_content + # @return [::String] + # Optional. Web content snippet that can be embedded in a web page or an app + # webview. + # @!attribute [rw] sdk_blob + # @return [::String] + # Optional. Base64 encoded JSON representing array of tuple. + class SearchEntryPoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to retrieval in the grounding flow. + # @!attribute [rw] google_search_dynamic_retrieval_score + # @return [::Float] + # Optional. Score indicating how likely information from Google Search could + # help answer the prompt. The score is in the range `[0, 1]`, where 0 is the + # least likely and 1 is the most likely. This score is only populated when + # Google Search grounding and dynamic retrieval is enabled. It will be + # compared to the threshold to determine whether to trigger Google Search. + class RetrievalMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Harm categories that will block the content. + module HarmCategory + # The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0 + + # The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1 + + # The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2 + + # The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3 + + # The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + + # The harm category is civic integrity. + HARM_CATEGORY_CIVIC_INTEGRITY = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb new file mode 100644 index 000000000000..bfd94887b8d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Instance of a general context. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the Context. + # @!attribute [rw] display_name + # @return [::String] + # User provided display name of the Context. + # May be up to 128 Unicode characters. + # @!attribute [rw] etag + # @return [::String] + # An eTag used to perform consistent read-modify-write updates. If not set, a + # blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Contexts. + # + # 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. + # No more than 64 user labels can be associated with one Context (System + # labels are excluded). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Context was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Context was last updated. + # @!attribute [r] parent_contexts + # @return [::Array<::String>] + # Output only. A list of resource names of Contexts that are parents of this + # Context. A Context may have at most 10 parent_contexts. + # @!attribute [rw] schema_title + # @return [::String] + # The title of the schema describing the metadata. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] schema_version + # @return [::String] + # The version of the schema in schema_name to use. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Properties of the Context. + # Top level metadata keys' heading and trailing spaces will be trimmed. + # The size of this field should not exceed 200KB. + # @!attribute [rw] description + # @return [::String] + # Description of the Context + class Context + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/custom_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/custom_job.rb new file mode 100644 index 000000000000..4b30e2f55798 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/custom_job.rb @@ -0,0 +1,386 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a job that runs custom workloads such as a Docker container or a + # Python package. A CustomJob can have multiple worker pools and each worker + # pool can have its own machine and input spec. A CustomJob will be cleaned up + # once the job enters terminal state (failed or succeeded). + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of a CustomJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the CustomJob. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] job_spec + # @return [::Google::Cloud::AIPlatform::V1::CustomJobSpec] + # Required. Job spec. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the job. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the CustomJob was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the CustomJob for the first time entered the + # `JOB_STATE_RUNNING` state. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the CustomJob entered any of the following states: + # `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the CustomJob was most recently updated. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when job's state is `JOB_STATE_FAILED` or + # `JOB_STATE_CANCELLED`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize CustomJobs. + # + # 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] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key options for a CustomJob. If this is set, + # then all resources created by the CustomJob will be encrypted with the + # provided encryption key. + # @!attribute [r] web_access_uris + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. URIs for accessing [interactive + # shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + # (one URI for each training node). Only available if + # {::Google::Cloud::AIPlatform::V1::CustomJobSpec#enable_web_access job_spec.enable_web_access} + # is `true`. + # + # The keys are names of each node in the training job; for example, + # `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + # the second worker pool, and `workerpool1-1` for the second node in the + # second worker pool. + # + # The values are the URIs for each node's interactive shell. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class CustomJob + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class WebAccessUrisEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the spec of a CustomJob. + # @!attribute [rw] persistent_resource_id + # @return [::String] + # Optional. The ID of the PersistentResource in the same Project and Location + # which to run + # + # If this is specified, the job will be run on existing machines held by the + # PersistentResource instead of on-demand short-live machines. + # The network and CMEK configs on the job should be consistent with those on + # the PersistentResource, otherwise, the job will be rejected. + # @!attribute [rw] worker_pool_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::WorkerPoolSpec>] + # Required. The spec of the worker pools including machine type and Docker + # image. All worker pools except the first one are optional and can be + # skipped by providing an empty value. + # @!attribute [rw] scheduling + # @return [::Google::Cloud::AIPlatform::V1::Scheduling] + # Scheduling options for a CustomJob. + # @!attribute [rw] service_account + # @return [::String] + # Specifies the service account for workload run-as account. + # Users submitting jobs must have act-as permission on this run-as account. + # If unspecified, the [Vertex AI Custom Code Service + # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + # for the CustomJob's project is used. + # @!attribute [rw] network + # @return [::String] + # Optional. The full name of the Compute Engine + # [network](/compute/docs/networks-and-firewalls#networks) to which the Job + # should be peered. For example, `projects/12345/global/networks/myVPC`. + # [Format](/compute/docs/reference/rest/v1/networks/insert) + # is of the form `projects/{project}/global/networks/{network}`. + # Where \\{project} is a project number, as in `12345`, and \\{network} is a + # network name. + # + # To specify this field, you must have already [configured VPC Network + # Peering for Vertex + # AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). + # + # If this field is left unspecified, the job is not peered with any network. + # @!attribute [rw] reserved_ip_ranges + # @return [::Array<::String>] + # Optional. A list of names for the reserved ip ranges under the VPC network + # that can be used for this job. + # + # If set, we will deploy the job within the provided ip ranges. Otherwise, + # the job will be deployed to any ip ranges under the provided VPC + # network. + # + # Example: ['vertex-ai-ip-range']. + # @!attribute [rw] base_output_directory + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # The Cloud Storage location to store the output of this CustomJob or + # HyperparameterTuningJob. For HyperparameterTuningJob, + # the baseOutputDirectory of + # each child CustomJob backing a Trial is set to a subdirectory of name + # {::Google::Cloud::AIPlatform::V1::Trial#id id} under its parent + # HyperparameterTuningJob's baseOutputDirectory. + # + # The following Vertex AI environment variables will be passed to + # containers or python modules when this field is set: + # + # For CustomJob: + # + # * AIP_MODEL_DIR = `/model/` + # * AIP_CHECKPOINT_DIR = `/checkpoints/` + # * AIP_TENSORBOARD_LOG_DIR = `/logs/` + # + # For CustomJob backing a Trial of HyperparameterTuningJob: + # + # * AIP_MODEL_DIR = `//model/` + # * AIP_CHECKPOINT_DIR = `//checkpoints/` + # * AIP_TENSORBOARD_LOG_DIR = `//logs/` + # @!attribute [rw] protected_artifact_location_id + # @return [::String] + # The ID of the location to store protected artifacts. e.g. us-central1. + # Populate only when the location is different than CustomJob location. + # List of supported locations: + # https://cloud.google.com/vertex-ai/docs/general/locations + # @!attribute [rw] tensorboard + # @return [::String] + # Optional. The name of a Vertex AI + # {::Google::Cloud::AIPlatform::V1::Tensorboard Tensorboard} resource to which + # this CustomJob will upload Tensorboard logs. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @!attribute [rw] enable_web_access + # @return [::Boolean] + # Optional. Whether you want Vertex AI to enable [interactive shell + # access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + # to training containers. + # + # If set to `true`, you can access interactive shells at the URIs given + # by + # {::Google::Cloud::AIPlatform::V1::CustomJob#web_access_uris CustomJob.web_access_uris} + # or + # {::Google::Cloud::AIPlatform::V1::Trial#web_access_uris Trial.web_access_uris} + # (within + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#trials HyperparameterTuningJob.trials}). + # @!attribute [rw] enable_dashboard_access + # @return [::Boolean] + # Optional. Whether you want Vertex AI to enable access to the customized + # dashboard in training chief container. + # + # If set to `true`, you can access the dashboard at the URIs given + # by + # {::Google::Cloud::AIPlatform::V1::CustomJob#web_access_uris CustomJob.web_access_uris} + # or + # {::Google::Cloud::AIPlatform::V1::Trial#web_access_uris Trial.web_access_uris} + # (within + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#trials HyperparameterTuningJob.trials}). + # @!attribute [rw] experiment + # @return [::String] + # Optional. The Experiment associated with this job. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` + # @!attribute [rw] experiment_run + # @return [::String] + # Optional. The Experiment Run associated with this job. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` + # @!attribute [rw] models + # @return [::Array<::String>] + # Optional. The name of the Model resources for which to generate a mapping + # to artifact URIs. Applicable only to some of the Google-provided custom + # jobs. Format: `projects/{project}/locations/{location}/models/{model}` + # + # In order to retrieve a specific version of the model, also provide + # the version ID or version alias. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # If no version ID or alias is specified, the "default" version will be + # returned. The "default" version alias is created for the first version of + # the model, and can be moved to other versions later on. There will be + # exactly one default version. + class CustomJobSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec of a worker pool in a job. + # @!attribute [rw] container_spec + # @return [::Google::Cloud::AIPlatform::V1::ContainerSpec] + # The custom container task. + # @!attribute [rw] python_package_spec + # @return [::Google::Cloud::AIPlatform::V1::PythonPackageSpec] + # The Python packaged task. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # Optional. Immutable. The specification of a single machine. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of worker replicas to use for this worker pool. + # @!attribute [rw] nfs_mounts + # @return [::Array<::Google::Cloud::AIPlatform::V1::NfsMount>] + # Optional. List of NFS mount spec. + # @!attribute [rw] disk_spec + # @return [::Google::Cloud::AIPlatform::V1::DiskSpec] + # Disk spec. + class WorkerPoolSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The spec of a Container. + # @!attribute [rw] image_uri + # @return [::String] + # Required. The URI of a container image in the Container Registry that is to + # be run on each worker replica. + # @!attribute [rw] command + # @return [::Array<::String>] + # The command to be invoked when the container is started. + # It overrides the entrypoint instruction in Dockerfile when provided. + # @!attribute [rw] args + # @return [::Array<::String>] + # The arguments to be passed when starting the container. + # @!attribute [rw] env + # @return [::Array<::Google::Cloud::AIPlatform::V1::EnvVar>] + # Environment variables to be passed to the container. + # Maximum limit is 100. + class ContainerSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The spec of a Python packaged code. + # @!attribute [rw] executor_image_uri + # @return [::String] + # Required. The URI of a container image in Artifact Registry that will run + # the provided Python package. Vertex AI provides a wide range of executor + # images with pre-installed packages to meet users' various use cases. See + # the list of [pre-built containers for + # training](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + # You must use an image from this list. + # @!attribute [rw] package_uris + # @return [::Array<::String>] + # Required. The Google Cloud Storage location of the Python package files + # which are the training program and its dependent packages. The maximum + # number of package URIs is 100. + # @!attribute [rw] python_module + # @return [::String] + # Required. The Python module name to run after installing the packages. + # @!attribute [rw] args + # @return [::Array<::String>] + # Command line arguments to be passed to the Python task. + # @!attribute [rw] env + # @return [::Array<::Google::Cloud::AIPlatform::V1::EnvVar>] + # Environment variables to be passed to the python module. + # Maximum limit is 100. + class PythonPackageSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # All parameters related to queuing and scheduling of custom jobs. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # Optional. The maximum job running time. The default is 7 days. + # @!attribute [rw] restart_job_on_worker_restart + # @return [::Boolean] + # Optional. Restarts the entire CustomJob if a worker gets restarted. + # This feature can be used by distributed training jobs that are not + # resilient to workers leaving and joining a job. + # @!attribute [rw] strategy + # @return [::Google::Cloud::AIPlatform::V1::Scheduling::Strategy] + # Optional. This determines which type of scheduling strategy to use. + # @!attribute [rw] disable_retries + # @return [::Boolean] + # Optional. Indicates if the job should retry for internal errors after the + # job starts running. If true, overrides + # `Scheduling.restart_job_on_worker_restart` to false. + # @!attribute [rw] max_wait_duration + # @return [::Google::Protobuf::Duration] + # Optional. This is the maximum duration that a job will wait for the + # requested resources to be provisioned if the scheduling strategy is set to + # [Strategy.DWS_FLEX_START]. + # If set to 0, the job will wait indefinitely. The default is 24 hours. + class Scheduling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Optional. This determines which type of scheduling strategy to use. Right + # now users have two options such as STANDARD which will use regular on + # demand resources to schedule the job, the other is SPOT which would + # leverage spot resources alongwith regular resources to schedule + # the job. + module Strategy + # Strategy will default to STANDARD. + STRATEGY_UNSPECIFIED = 0 + + # Deprecated. Regular on-demand provisioning strategy. + ON_DEMAND = 1 + + # Deprecated. Low cost by making potential use of spot resources. + LOW_COST = 2 + + # Standard provisioning strategy uses regular on-demand resources. + STANDARD = 3 + + # Spot provisioning strategy uses spot resources. + SPOT = 4 + + # Flex Start strategy uses DWS to queue for resources. + FLEX_START = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_item.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_item.rb new file mode 100644 index 000000000000..ed30ea075daf --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_item.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A piece of data in a Dataset. Could be an image, a video, a document or plain + # text. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the DataItem. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DataItem was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DataItem was last updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your DataItems. + # + # 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. + # No more than 64 user labels can be associated with one DataItem(System + # labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Value] + # Required. The data that the DataItem represents (for example, an image or a + # text snippet). The schema of the payload is stored in the parent Dataset's + # [metadata schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] + # dataItemSchemaUri field. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class DataItem + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_labeling_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_labeling_job.rb new file mode 100644 index 000000000000..03450c5f6359 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/data_labeling_job.rb @@ -0,0 +1,207 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # DataLabelingJob is used to trigger a human labeling job on unlabeled data + # from the following Dataset: + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the DataLabelingJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the DataLabelingJob. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # Display name of a DataLabelingJob. + # @!attribute [rw] datasets + # @return [::Array<::String>] + # Required. Dataset resource names. Right now we only support labeling from a + # single Dataset. Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] annotation_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels to assign to annotations generated by this DataLabelingJob. + # + # 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. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] labeler_count + # @return [::Integer] + # Required. Number of labelers to work on each DataItem. + # @!attribute [rw] instruction_uri + # @return [::String] + # Required. The Google Cloud Storage location of the instruction pdf. This + # pdf is shared with labelers, and provides detailed description on how to + # label DataItems in Datasets. + # @!attribute [rw] inputs_schema_uri + # @return [::String] + # Required. Points to a YAML file stored on Google Cloud Storage describing + # the config for a specific type of DataLabelingJob. The schema files that + # can be used here are found in the + # https://storage.googleapis.com/google-cloud-aiplatform bucket in the + # /schema/datalabelingjob/inputs/ folder. + # @!attribute [rw] inputs + # @return [::Google::Protobuf::Value] + # Required. Input config parameters for the DataLabelingJob. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the job. + # @!attribute [r] labeling_progress + # @return [::Integer] + # Output only. Current labeling job progress percentage scaled in interval + # [0, 100], indicating the percentage of DataItems that has been finished. + # @!attribute [r] current_spend + # @return [::Google::Type::Money] + # Output only. Estimated cost(in US dollars) that the DataLabelingJob has + # incurred to date. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DataLabelingJob was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DataLabelingJob was updated most recently. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. DataLabelingJob errors. It is only populated when job's state + # is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your DataLabelingJobs. + # + # 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. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. Following system labels exist for each DataLabelingJob: + # + # * "aiplatform.googleapis.com/schema": output only, its value is the + # {::Google::Cloud::AIPlatform::V1::DataLabelingJob#inputs_schema_uri inputs_schema}'s + # title. + # @!attribute [rw] specialist_pools + # @return [::Array<::String>] + # The SpecialistPools' resource names associated with this job. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a DataLabelingJob. If set, this + # DataLabelingJob will be secured by this key. + # + # Note: Annotations created in the DataLabelingJob are associated with + # the EncryptionSpec of the Dataset they are exported to. + # @!attribute [rw] active_learning_config + # @return [::Google::Cloud::AIPlatform::V1::ActiveLearningConfig] + # Parameters that configure the active learning pipeline. Active learning + # will label the data incrementally via several iterations. For every + # iteration, it will select a batch of data based on the sampling strategy. + class DataLabelingJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Parameters that configure the active learning pipeline. Active learning will + # label the data incrementally by several iterations. For every iteration, it + # will select a batch of data based on the sampling strategy. + # @!attribute [rw] max_data_item_count + # @return [::Integer] + # Max number of human labeled DataItems. + # @!attribute [rw] max_data_item_percentage + # @return [::Integer] + # Max percent of total DataItems for human labeling. + # @!attribute [rw] sample_config + # @return [::Google::Cloud::AIPlatform::V1::SampleConfig] + # Active learning data sampling config. For every active learning labeling + # iteration, it will select a batch of data based on the sampling strategy. + # @!attribute [rw] training_config + # @return [::Google::Cloud::AIPlatform::V1::TrainingConfig] + # CMLE training config. For every active learning labeling iteration, system + # will train a machine learning model on CMLE. The trained model will be used + # by data sampling algorithm to select DataItems. + class ActiveLearningConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Active learning data sampling config. For every active learning labeling + # iteration, it will select a batch of data based on the sampling strategy. + # @!attribute [rw] initial_batch_sample_percentage + # @return [::Integer] + # The percentage of data needed to be labeled in the first batch. + # @!attribute [rw] following_batch_sample_percentage + # @return [::Integer] + # The percentage of data needed to be labeled in each following batch + # (except the first batch). + # @!attribute [rw] sample_strategy + # @return [::Google::Cloud::AIPlatform::V1::SampleConfig::SampleStrategy] + # Field to choose sampling strategy. Sampling strategy will decide which data + # should be selected for human labeling in every batch. + class SampleConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Sample strategy decides which subset of DataItems should be selected for + # human labeling in every batch. + module SampleStrategy + # Default will be treated as UNCERTAINTY. + SAMPLE_STRATEGY_UNSPECIFIED = 0 + + # Sample the most uncertain data to label. + UNCERTAINTY = 1 + end + end + + # CMLE training config. For every active learning labeling iteration, system + # will train a machine learning model on CMLE. The trained model will be used + # by data sampling algorithm to select DataItems. + # @!attribute [rw] timeout_training_milli_hours + # @return [::Integer] + # The timeout hours for the CMLE training job, expressed in milli hours + # i.e. 1,000 value in this field means 1 hour. + class TrainingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb new file mode 100644 index 000000000000..fc455d3bb8e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb @@ -0,0 +1,334 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A collection of DataItems and Annotations on them. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the Dataset. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the Dataset. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the Dataset. + # @!attribute [rw] metadata_schema_uri + # @return [::String] + # Required. Points to a YAML file stored on Google Cloud Storage describing + # additional information about the Dataset. The schema is defined as an + # OpenAPI 3.0.2 Schema Object. The schema files that can be used here are + # found in gs://google-cloud-aiplatform/schema/dataset/metadata/. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Value] + # Required. Additional information about the Dataset. + # @!attribute [r] data_item_count + # @return [::Integer] + # Output only. The number of DataItems in this Dataset. Only apply for + # non-structured Dataset. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Dataset was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Dataset was last updated. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Datasets. + # + # 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. + # No more than 64 user labels can be associated with one Dataset (System + # labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. Following system labels exist for each Dataset: + # + # * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its + # value is the + # [metadata_schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] + # title. + # @!attribute [rw] saved_queries + # @return [::Array<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # All SavedQueries belong to the Dataset will be returned in List/Get + # Dataset response. The annotation_specs field + # will not be populated except for UI cases which will only use + # {::Google::Cloud::AIPlatform::V1::SavedQuery#annotation_spec_count annotation_spec_count}. + # In CreateDataset request, a SavedQuery is created together if + # this field is set, up to one SavedQuery can be set in CreateDatasetRequest. + # The SavedQuery should not contain any AnnotationSpec. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a Dataset. If set, this Dataset + # and all sub-resources of this Dataset will be secured by this key. + # @!attribute [r] metadata_artifact + # @return [::String] + # Output only. The resource name of the Artifact that was created in + # MetadataStore when creating the Dataset. The Artifact resource name pattern + # is + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + # @!attribute [rw] model_reference + # @return [::String] + # Optional. Reference to the public base model last used by the dataset. Only + # set for prompt datasets. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Dataset + 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 + + # Describes the location from where we import data into a Dataset, together + # with the labels that will be applied to the DataItems and the Annotations. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # The Google Cloud Storage location for the input content. + # @!attribute [rw] data_item_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels that will be applied to newly imported DataItems. If an identical + # DataItem as one being imported already exists in the Dataset, then these + # labels will be appended to these of the already existing one, and if labels + # with identical key is imported before, the old label value will be + # overwritten. If two DataItems are identical in the same import data + # operation, the labels will be combined and if key collision happens in this + # case, one of the values will be picked randomly. Two DataItems are + # considered identical if their content bytes are identical (e.g. image bytes + # or pdf bytes). + # These labels will be overridden by Annotation labels specified inside index + # file referenced by + # {::Google::Cloud::AIPlatform::V1::ImportDataConfig#import_schema_uri import_schema_uri}, + # e.g. jsonl file. + # @!attribute [rw] annotation_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels that will be applied to newly imported Annotations. If two + # Annotations are identical, one of them will be deduped. Two Annotations are + # considered identical if their + # {::Google::Cloud::AIPlatform::V1::Annotation#payload payload}, + # {::Google::Cloud::AIPlatform::V1::Annotation#payload_schema_uri payload_schema_uri} + # and all of their {::Google::Cloud::AIPlatform::V1::Annotation#labels labels} are + # the same. These labels will be overridden by Annotation labels specified + # inside index file referenced by + # {::Google::Cloud::AIPlatform::V1::ImportDataConfig#import_schema_uri import_schema_uri}, + # e.g. jsonl file. + # @!attribute [rw] import_schema_uri + # @return [::String] + # Required. Points to a YAML file stored on Google Cloud Storage describing + # the import format. Validation will be done against the schema. The schema + # is defined as an [OpenAPI 3.0.2 Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + class ImportDataConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class DataItemLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes what part of the Dataset is to be exported, the destination of + # the export and how to export. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # The Google Cloud Storage location where the output is to be written to. + # In the given directory a new directory will be created with name: + # `export-data--` where + # timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + # output will be written into that directory. Inside that directory, + # annotations with the same schema will be grouped into sub directories + # which are named with the corresponding annotations' schema title. Inside + # these sub directories, a schema.yaml will be created to describe the + # output format. + # @!attribute [rw] fraction_split + # @return [::Google::Cloud::AIPlatform::V1::ExportFractionSplit] + # Split based on fractions defining the size of each set. + # @!attribute [rw] filter_split + # @return [::Google::Cloud::AIPlatform::V1::ExportFilterSplit] + # Split based on the provided filters for each set. + # @!attribute [rw] annotations_filter + # @return [::String] + # An expression for filtering what part of the Dataset is to be exported. + # Only Annotations that match this filter will be exported. The filter syntax + # is the same as in + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_annotations ListAnnotations}. + # @!attribute [rw] saved_query_id + # @return [::String] + # The ID of a SavedQuery (annotation set) under the Dataset specified by + # {::Google::Cloud::AIPlatform::V1::ExportDataRequest#name ExportDataRequest.name} + # used for filtering Annotations for training. + # + # Only used for custom training data export use cases. + # Only applicable to Datasets that have SavedQueries. + # + # Only Annotations that are associated with this SavedQuery are used in + # respectively training. When used in conjunction with + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotations_filter annotations_filter}, + # the Annotations used for training are filtered by both + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#saved_query_id saved_query_id} + # and + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotations_filter annotations_filter}. + # + # Only one of + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#saved_query_id saved_query_id} + # and + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotation_schema_uri annotation_schema_uri} + # should be specified as both of them represent the same thing: problem type. + # @!attribute [rw] annotation_schema_uri + # @return [::String] + # The Cloud Storage URI that points to a YAML file describing the annotation + # schema. The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # The schema files that can be used here are found in + # gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the + # chosen schema must be consistent with + # {::Google::Cloud::AIPlatform::V1::Dataset#metadata_schema_uri metadata} of the + # Dataset specified by + # {::Google::Cloud::AIPlatform::V1::ExportDataRequest#name ExportDataRequest.name}. + # + # Only used for custom training data export use cases. + # Only applicable to Datasets that have DataItems and Annotations. + # + # Only Annotations that both match this schema and belong to DataItems not + # ignored by the split method are used in respectively training, validation + # or test role, depending on the role of the DataItem they are on. + # + # When used in conjunction with + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotations_filter annotations_filter}, + # the Annotations used for training are filtered by both + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotations_filter annotations_filter} + # and + # {::Google::Cloud::AIPlatform::V1::ExportDataConfig#annotation_schema_uri annotation_schema_uri}. + # @!attribute [rw] export_use + # @return [::Google::Cloud::AIPlatform::V1::ExportDataConfig::ExportUse] + # Indicates the usage of the exported files. + class ExportDataConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # ExportUse indicates the usage of the exported files. It restricts file + # destination, format, annotations to be exported, whether to allow + # unannotated data to be exported and whether to clone files to temp Cloud + # Storage bucket. + module ExportUse + # Regular user export. + EXPORT_USE_UNSPECIFIED = 0 + + # Export for custom code training. + CUSTOM_CODE_TRAINING = 6 + end + end + + # Assigns the input data to training, validation, and test sets as per the + # given fractions. Any of `training_fraction`, `validation_fraction` and + # `test_fraction` may optionally be provided, they must sum to up to 1. If the + # provided ones sum to less than 1, the remainder is assigned to sets as + # decided by Vertex AI. If none of the fractions are set, by default roughly + # 80% of data is used for training, 10% for validation, and 10% for test. + # @!attribute [rw] training_fraction + # @return [::Float] + # The fraction of the input data that is to be used to train the Model. + # @!attribute [rw] validation_fraction + # @return [::Float] + # The fraction of the input data that is to be used to validate the Model. + # @!attribute [rw] test_fraction + # @return [::Float] + # The fraction of the input data that is to be used to evaluate the Model. + class ExportFractionSplit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Assigns input data to training, validation, and test sets based on the given + # filters, data pieces not matched by any filter are ignored. Currently only + # supported for Datasets containing DataItems. + # If any of the filters in this message are to match nothing, then they can be + # set as '-' (the minus sign). + # + # Supported only for unstructured Datasets. + # @!attribute [rw] training_filter + # @return [::String] + # Required. A filter on DataItems of the Dataset. DataItems that match + # this filter are used to train the Model. A filter with same syntax + # as the one used in + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items DatasetService.ListDataItems} + # may be used. If a single DataItem is matched by more than one of the + # FilterSplit filters, then it is assigned to the first set that applies to + # it in the training, validation, test order. + # @!attribute [rw] validation_filter + # @return [::String] + # Required. A filter on DataItems of the Dataset. DataItems that match + # this filter are used to validate the Model. A filter with same syntax + # as the one used in + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items DatasetService.ListDataItems} + # may be used. If a single DataItem is matched by more than one of the + # FilterSplit filters, then it is assigned to the first set that applies to + # it in the training, validation, test order. + # @!attribute [rw] test_filter + # @return [::String] + # Required. A filter on DataItems of the Dataset. DataItems that match + # this filter are used to test the Model. A filter with same syntax + # as the one used in + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items DatasetService.ListDataItems} + # may be used. If a single DataItem is matched by more than one of the + # FilterSplit filters, then it is assigned to the first set that applies to + # it in the training, validation, test order. + class ExportFilterSplit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb new file mode 100644 index 000000000000..6256bb1fe5c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb @@ -0,0 +1,657 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#create_dataset DatasetService.CreateDataset}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the Dataset in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] dataset + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # Required. The Dataset to create. + class CreateDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#create_dataset DatasetService.CreateDataset}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateDatasetOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#get_dataset DatasetService.GetDataset}. + # Next ID: 4 + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Dataset resource. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class GetDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#update_dataset DatasetService.UpdateDataset}. + # @!attribute [rw] dataset + # @return [::Google::Cloud::AIPlatform::V1::Dataset] + # Required. The Dataset which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + # * `description` + # * `labels` + class UpdateDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#update_dataset_version DatasetService.UpdateDatasetVersion}. + # @!attribute [rw] dataset_version + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # Required. The DatasetVersion which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Updatable fields: + # + # * `display_name` + class UpdateDatasetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_datasets DatasetService.ListDatasets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the Dataset's parent resource. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `display_name`: supports = and != + # * `metadata_schema_uri`: supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + class ListDatasetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_datasets DatasetService.ListDatasets}. + # @!attribute [rw] datasets + # @return [::Array<::Google::Cloud::AIPlatform::V1::Dataset>] + # A list of Datasets that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListDatasetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#delete_dataset DatasetService.DeleteDataset}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Dataset to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + class DeleteDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#import_data DatasetService.ImportData}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] import_configs + # @return [::Array<::Google::Cloud::AIPlatform::V1::ImportDataConfig>] + # Required. The desired input locations. The contents of all input locations + # will be imported in one batch. + class ImportDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#import_data DatasetService.ImportData}. + class ImportDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#import_data DatasetService.ImportData}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class ImportDataOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#export_data DatasetService.ExportData}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] export_config + # @return [::Google::Cloud::AIPlatform::V1::ExportDataConfig] + # Required. The desired output location. + class ExportDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#export_data DatasetService.ExportData}. + # @!attribute [rw] exported_files + # @return [::Array<::String>] + # All of the files that are exported in this export operation. For custom + # code training export, only three (training, validation and test) + # Cloud Storage paths in wildcard format are populated + # (for example, gs://.../training-*). + # @!attribute [rw] data_stats + # @return [::Google::Cloud::AIPlatform::V1::Model::DataStats] + # Only present for custom code training export use case. Records data stats, + # i.e., train/validation/test item/annotation counts calculated during + # the export operation. + class ExportDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#export_data DatasetService.ExportData}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + # @!attribute [rw] gcs_output_directory + # @return [::String] + # A Google Cloud Storage directory which path ends with '/'. The exported + # data is stored in the directory. + class ExportDataOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#create_dataset_version DatasetService.CreateDatasetVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the Dataset resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] dataset_version + # @return [::Google::Cloud::AIPlatform::V1::DatasetVersion] + # Required. The version to be created. The same CMEK policies with the + # original Dataset will be applied the dataset version. So here we don't need + # to specify the EncryptionSpecType here. + class CreateDatasetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#create_dataset_version DatasetService.CreateDatasetVersion}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class CreateDatasetVersionOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#delete_dataset_version DatasetService.DeleteDatasetVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + class DeleteDatasetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#get_dataset_version DatasetService.GetDatasetVersion}. + # Next ID: 4 + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Dataset version to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class GetDatasetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_dataset_versions DatasetService.ListDatasetVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Dataset to list DatasetVersions from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to read. + # @!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. + class ListDatasetVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_dataset_versions DatasetService.ListDatasetVersions}. + # @!attribute [rw] dataset_versions + # @return [::Array<::Google::Cloud::AIPlatform::V1::DatasetVersion>] + # A list of DatasetVersions that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListDatasetVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#restore_dataset_version DatasetService.RestoreDatasetVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DatasetVersion resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}` + class RestoreDatasetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#restore_dataset_version DatasetService.RestoreDatasetVersion}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class RestoreDatasetVersionOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items DatasetService.ListDataItems}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Dataset to list DataItems from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + class ListDataItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items DatasetService.ListDataItems}. + # @!attribute [rw] data_items + # @return [::Array<::Google::Cloud::AIPlatform::V1::DataItem>] + # A list of DataItems that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListDataItemsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#search_data_items DatasetService.SearchDataItems}. + # @!attribute [rw] order_by_data_item + # @return [::String] + # A comma-separated list of data item fields to order by, sorted in + # ascending order. Use "desc" after a field name for descending. + # @!attribute [rw] order_by_annotation + # @return [::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest::OrderByAnnotation] + # Expression that allows ranking results based on annotation's property. + # @!attribute [rw] dataset + # @return [::String] + # Required. The resource name of the Dataset from which to search DataItems. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] saved_query + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The resource name of a SavedQuery(annotation set in UI). + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + # All of the search will be done in the context of this SavedQuery. + # @!attribute [rw] data_labeling_job + # @return [::String] + # The resource name of a DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + # If this field is set, all of the search will be done in the context of + # this DataLabelingJob. + # @!attribute [rw] data_item_filter + # @return [::String] + # An expression for filtering the DataItem that will be returned. + # + # * `data_item_id` - for = or !=. + # * `labeled` - for = or !=. + # * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + # have at least one annotation with annotation_spec_id = + # `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + # + # For example: + # + # * `data_item=1` + # * `has_annotation(5)` + # @!attribute [rw] annotations_filter + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # An expression for filtering the Annotations that will be returned per + # DataItem. + # * `annotation_spec_id` - for = or !=. + # @!attribute [rw] annotation_filters + # @return [::Array<::String>] + # An expression that specifies what Annotations will be returned per + # DataItem. Annotations satisfied either of the conditions will be returned. + # * `annotation_spec_id` - for = or !=. + # Must specify `saved_query_id=` - saved query id that annotations should + # belong to. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields of + # {::Google::Cloud::AIPlatform::V1::DataItemView DataItemView} to read. + # @!attribute [rw] annotations_limit + # @return [::Integer] + # If set, only up to this many of Annotations will be returned per + # DataItemView. The maximum value is 1000. If not set, the maximum value will + # be used. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer results than requested. + # Default and maximum page size is 100. + # @!attribute [rw] order_by + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results for the server to return + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsResponse#next_page_token SearchDataItemsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#search_data_items DatasetService.SearchDataItems} + # call. + class SearchDataItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Expression that allows ranking results based on annotation's property. + # @!attribute [rw] saved_query + # @return [::String] + # Required. Saved query of the Annotation. Only Annotations belong to this + # saved query will be considered for ordering. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of annotation fields to order by, sorted in + # ascending order. Use "desc" after a field name for descending. Must also + # specify saved_query. + class OrderByAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#search_data_items DatasetService.SearchDataItems}. + # @!attribute [rw] data_item_views + # @return [::Array<::Google::Cloud::AIPlatform::V1::DataItemView>] + # The DataItemViews read. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::SearchDataItemsRequest#page_token SearchDataItemsRequest.page_token} + # to obtain that page. + class SearchDataItemsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A container for a single DataItem and Annotations on it. + # @!attribute [rw] data_item + # @return [::Google::Cloud::AIPlatform::V1::DataItem] + # The DataItem. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::AIPlatform::V1::Annotation>] + # The Annotations on the DataItem. If too many Annotations should be returned + # for the DataItem, this field will be truncated per annotations_limit in + # request. If it was, then the has_truncated_annotations will be set to true. + # @!attribute [rw] has_truncated_annotations + # @return [::Boolean] + # True if and only if the Annotations field has been truncated. It happens if + # more Annotations for this DataItem met the request's annotation_filter than + # are allowed to be returned by annotations_limit. + # Note that if Annotations field is not being returned due to field mask, + # then this field will not be set to true no matter how many Annotations are + # there. + class DataItemView + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_saved_queries DatasetService.ListSavedQueries}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Dataset to list SavedQueries from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + class ListSavedQueriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_saved_queries DatasetService.ListSavedQueries}. + # @!attribute [rw] saved_queries + # @return [::Array<::Google::Cloud::AIPlatform::V1::SavedQuery>] + # A list of SavedQueries that match the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListSavedQueriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#delete_saved_query DatasetService.DeleteSavedQuery}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the SavedQuery to delete. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + class DeleteSavedQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#get_annotation_spec DatasetService.GetAnnotationSpec}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the AnnotationSpec resource. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class GetAnnotationSpecRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_annotations DatasetService.ListAnnotations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the DataItem to list Annotations from. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + class ListAnnotationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::DatasetService::Client#list_annotations DatasetService.ListAnnotations}. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::AIPlatform::V1::Annotation>] + # A list of Annotations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListAnnotationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_version.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_version.rb new file mode 100644 index 000000000000..ff082c0fa4c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset_version.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Describes the dataset version. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the DatasetVersion. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DatasetVersion was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DatasetVersion was last updated. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [r] big_query_dataset_name + # @return [::String] + # Output only. Name of the associated BigQuery dataset. + # @!attribute [rw] display_name + # @return [::String] + # The user-defined name of the DatasetVersion. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [r] metadata + # @return [::Google::Protobuf::Value] + # Required. Output only. Additional information about the DatasetVersion. + # @!attribute [r] model_reference + # @return [::String] + # Output only. Reference to the public base model last used by the dataset + # version. Only set for prompt dataset versions. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class DatasetVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb new file mode 100644 index 000000000000..a6cbede1694a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Points to a DeployedIndex. + # @!attribute [rw] index_endpoint + # @return [::String] + # Immutable. A resource name of the IndexEndpoint. + # @!attribute [rw] deployed_index_id + # @return [::String] + # Immutable. The ID of the DeployedIndex in the above IndexEndpoint. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of the DeployedIndex. + class DeployedIndexRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_model_ref.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_model_ref.rb new file mode 100644 index 000000000000..6b402b9e14b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployed_model_ref.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Points to a DeployedModel. + # @!attribute [rw] endpoint + # @return [::String] + # Immutable. A resource name of an Endpoint. + # @!attribute [rw] deployed_model_id + # @return [::String] + # Immutable. An ID of a DeployedModel in the above Endpoint. + class DeployedModelRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb new file mode 100644 index 000000000000..77054faab79d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A description of resources that can be shared by multiple DeployedModels, + # whose underlying specification consists of a DedicatedResources. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the DeploymentResourcePool. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::AIPlatform::V1::DedicatedResources] + # Required. The underlying DedicatedResources that the DeploymentResourcePool + # uses. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a DeploymentResourcePool. If set, + # this DeploymentResourcePool will be secured by this key. Endpoints and the + # DeploymentResourcePool they deploy in need to have the same EncryptionSpec. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the DeploymentResourcePool's container(s) run as. + # Specify the email address of the service account. If this service account + # is not specified, the container(s) run as a service account that doesn't + # have access to the resource project. + # + # Users deploying the Models to this DeploymentResourcePool must have the + # `iam.serviceAccounts.actAs` permission on this service account. + # @!attribute [rw] disable_container_logging + # @return [::Boolean] + # If the DeploymentResourcePool is deployed with custom-trained Models or + # AutoML Tabular Models, the container(s) of the DeploymentResourcePool will + # send `stderr` and `stdout` streams to Cloud Logging by default. + # Please note that the logs incur cost, which are subject to [Cloud Logging + # pricing](https://cloud.google.com/logging/pricing). + # + # User can disable container logging by setting this flag to true. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this DeploymentResourcePool was created. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class DeploymentResourcePool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb new file mode 100644 index 000000000000..550ebaaa9c22 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for CreateDeploymentResourcePool method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location resource where this DeploymentResourcePool + # will be created. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] deployment_resource_pool + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # Required. The DeploymentResourcePool to create. + # @!attribute [rw] deployment_resource_pool_id + # @return [::String] + # Required. The ID to use for the DeploymentResourcePool, which + # will become the final component of the DeploymentResourcePool's resource + # name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + class CreateDeploymentResourcePoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for CreateDeploymentResourcePool method. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateDeploymentResourcePoolOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetDeploymentResourcePool method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DeploymentResourcePool to retrieve. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + class GetDeploymentResourcePoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListDeploymentResourcePools method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent Location which owns this collection of + # DeploymentResourcePools. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of DeploymentResourcePools to return. The service may + # return fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListDeploymentResourcePools` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDeploymentResourcePools` must match the call that provided the page + # token. + class ListDeploymentResourcePoolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListDeploymentResourcePools method. + # @!attribute [rw] deployment_resource_pools + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>] + # The DeploymentResourcePools from the specified location. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListDeploymentResourcePoolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateDeploymentResourcePool method. + # @!attribute [rw] deployment_resource_pool + # @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool] + # Required. The DeploymentResourcePool to update. + # + # The DeploymentResourcePool's `name` field is used to identify the + # DeploymentResourcePool to update. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. + class UpdateDeploymentResourcePoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for UpdateDeploymentResourcePool method. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UpdateDeploymentResourcePoolOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteDeploymentResourcePool method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DeploymentResourcePool to delete. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + class DeleteDeploymentResourcePoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for QueryDeployedModels method. + # @!attribute [rw] deployment_resource_pool + # @return [::String] + # Required. The name of the target DeploymentResourcePool to query. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of DeployedModels to return. The service may return + # fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `QueryDeployedModels` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `QueryDeployedModels` must match the call that provided the page + # token. + class QueryDeployedModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for QueryDeployedModels method. + # @!attribute [rw] deployed_models + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedModel>] + # DEPRECATED Use deployed_model_refs instead. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] deployed_model_refs + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedModelRef>] + # References to the DeployedModels that share the specified + # deploymentResourcePool. + # @!attribute [rw] total_deployed_model_count + # @return [::Integer] + # The total number of DeployedModels on this DeploymentResourcePool. + # @!attribute [rw] total_endpoint_count + # @return [::Integer] + # The total number of Endpoints that have DeployedModels on this + # DeploymentResourcePool. + class QueryDeployedModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/encryption_spec.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/encryption_spec.rb new file mode 100644 index 000000000000..4129cbecbff3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/encryption_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a customer-managed encryption key spec that can be applied to + # a top-level resource. + # @!attribute [rw] kms_key_name + # @return [::String] + # Required. The Cloud KMS resource identifier of the customer managed + # encryption key used to protect a resource. Has the form: + # `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + # The key needs to be in the same region as where the compute resource is + # created. + class EncryptionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint.rb new file mode 100644 index 000000000000..7112adfb45ac --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Models are deployed into it, and afterwards Endpoint is called to obtain + # predictions and explanations. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the Endpoint. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the Endpoint. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the Endpoint. + # @!attribute [r] deployed_models + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedModel>] + # Output only. The models deployed in this Endpoint. + # To add or remove DeployedModels use + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model EndpointService.DeployModel} + # and + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#undeploy_model EndpointService.UndeployModel} + # respectively. + # @!attribute [rw] traffic_split + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A map from a DeployedModel's ID to the percentage of this Endpoint's + # traffic that should be forwarded to that DeployedModel. + # + # If a DeployedModel's ID is not listed in this map, then it receives no + # traffic. + # + # The traffic percentage values must add up to 100, or map must be empty if + # the Endpoint is to not accept any traffic at a moment. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Endpoints. + # + # 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 [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Endpoint was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Endpoint was last updated. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for an Endpoint. If set, this + # Endpoint and all sub-resources of this Endpoint will be secured by + # this key. + # @!attribute [rw] network + # @return [::String] + # Optional. The full name of the Google Compute Engine + # [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + # to which the Endpoint should be peered. + # + # Private services access must already be configured for the network. If left + # unspecified, the Endpoint is not peered with any network. + # + # Only one of the fields, + # {::Google::Cloud::AIPlatform::V1::Endpoint#network network} or + # {::Google::Cloud::AIPlatform::V1::Endpoint#enable_private_service_connect enable_private_service_connect}, + # can be set. + # + # [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + # `projects/{project}/global/networks/{network}`. + # Where `{project}` is a project number, as in `12345`, and `{network}` is + # network name. + # @!attribute [rw] enable_private_service_connect + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Deprecated: If true, expose the Endpoint via private service connect. + # + # Only one of the fields, + # {::Google::Cloud::AIPlatform::V1::Endpoint#network network} or + # {::Google::Cloud::AIPlatform::V1::Endpoint#enable_private_service_connect enable_private_service_connect}, + # can be set. + # @!attribute [rw] private_service_connect_config + # @return [::Google::Cloud::AIPlatform::V1::PrivateServiceConnectConfig] + # Optional. Configuration for private service connect. + # + # {::Google::Cloud::AIPlatform::V1::Endpoint#network network} and + # {::Google::Cloud::AIPlatform::V1::Endpoint#private_service_connect_config private_service_connect_config} + # are mutually exclusive. + # @!attribute [r] model_deployment_monitoring_job + # @return [::String] + # Output only. Resource name of the Model Monitoring job associated with this + # Endpoint if monitoring is enabled by + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_model_deployment_monitoring_job JobService.CreateModelDeploymentMonitoringJob}. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @!attribute [rw] predict_request_response_logging_config + # @return [::Google::Cloud::AIPlatform::V1::PredictRequestResponseLoggingConfig] + # Configures the request-response logging for online prediction. + # @!attribute [rw] dedicated_endpoint_enabled + # @return [::Boolean] + # If true, the endpoint will be exposed through a dedicated + # DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS + # will be isolated from other users' traffic and will have better performance + # and reliability. + # Note: Once you enabled dedicated endpoint, you won't be able to send + # request to the shared DNS \\{region}-aiplatform.googleapis.com. The + # limitation will be removed soon. + # @!attribute [r] dedicated_endpoint_dns + # @return [::String] + # Output only. DNS of the dedicated endpoint. Will only be populated if + # dedicated_endpoint_enabled is true. + # Format: + # `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`. + # @!attribute [rw] client_connection_config + # @return [::Google::Cloud::AIPlatform::V1::ClientConnectionConfig] + # Configurations that are applied to the endpoint for online prediction. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Endpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class TrafficSplitEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A deployment of a Model. Endpoints contain one or more DeployedModels. + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::AIPlatform::V1::DedicatedResources] + # A description of resources that are dedicated to the DeployedModel, and + # that need a higher degree of manual configuration. + # @!attribute [rw] automatic_resources + # @return [::Google::Cloud::AIPlatform::V1::AutomaticResources] + # A description of resources that to large degree are decided by Vertex + # AI, and require only a modest additional configuration. + # @!attribute [rw] shared_resources + # @return [::String] + # The resource name of the shared DeploymentResourcePool to deploy on. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @!attribute [rw] id + # @return [::String] + # Immutable. The ID of the DeployedModel. If not provided upon deployment, + # Vertex AI will generate a value for this ID. + # + # This value should be 1-10 characters, and valid characters are `/[0-9]/`. + # @!attribute [rw] model + # @return [::String] + # Required. The resource name of the Model that this is the deployment of. + # Note that the Model may be in a different location than the DeployedModel's + # Endpoint. + # + # The resource name may contain version id or version alias to specify the + # version. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # if no version is specified, the default version will be deployed. + # @!attribute [r] model_version_id + # @return [::String] + # Output only. The version ID of the model that is deployed. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the DeployedModel. If not provided upon creation, + # the Model's display_name is used. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the DeployedModel was created. + # @!attribute [rw] explanation_spec + # @return [::Google::Cloud::AIPlatform::V1::ExplanationSpec] + # Explanation configuration for this DeployedModel. + # + # When deploying a Model using + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model EndpointService.DeployModel}, + # this value overrides the value of + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec}. + # All fields of + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # are optional in the request. If a field of + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # is not populated, the value of the same field of + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec} + # is inherited. If the corresponding + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec} + # is not populated, all fields of the + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # will be used for the explanation configuration. + # @!attribute [rw] disable_explanations + # @return [::Boolean] + # If true, deploy the model without explainable feature, regardless the + # existence of + # {::Google::Cloud::AIPlatform::V1::Model#explanation_spec Model.explanation_spec} + # or + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec}. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the DeployedModel's container runs as. Specify the + # email address of the service account. If this service account is not + # specified, the container runs as a service account that doesn't have access + # to the resource project. + # + # Users deploying the Model must have the `iam.serviceAccounts.actAs` + # permission on this service account. + # @!attribute [rw] disable_container_logging + # @return [::Boolean] + # For custom-trained Models and AutoML Tabular Models, the container of the + # DeployedModel instances will send `stderr` and `stdout` streams to + # Cloud Logging by default. Please note that the logs incur cost, + # which are subject to [Cloud Logging + # pricing](https://cloud.google.com/logging/pricing). + # + # User can disable container logging by setting this flag to true. + # @!attribute [rw] enable_access_logging + # @return [::Boolean] + # If true, online prediction access logs are sent to Cloud + # Logging. + # These logs are like standard server access logs, containing + # information like timestamp and latency for each prediction request. + # + # Note that logs may incur a cost, especially if your project + # receives prediction requests at a high queries per second rate (QPS). + # Estimate your costs before enabling this option. + # @!attribute [r] private_endpoints + # @return [::Google::Cloud::AIPlatform::V1::PrivateEndpoints] + # Output only. Provide paths for users to send predict/explain/health + # requests directly to the deployed model services running on Cloud via + # private services access. This field is populated if + # {::Google::Cloud::AIPlatform::V1::Endpoint#network network} is configured. + # @!attribute [rw] faster_deployment_config + # @return [::Google::Cloud::AIPlatform::V1::FasterDeploymentConfig] + # Configuration for faster model deployment. + # @!attribute [r] status + # @return [::Google::Cloud::AIPlatform::V1::DeployedModel::Status] + # Output only. Runtime status of the deployed model. + # @!attribute [rw] system_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # System labels to apply to Model Garden deployments. + # System labels are managed by Google for internal use only. + class DeployedModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Runtime status of the deployed model. + # @!attribute [r] message + # @return [::String] + # Output only. The latest deployed model's status message (if any). + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the status was last updated. + # @!attribute [r] available_replica_count + # @return [::Integer] + # Output only. The number of available replicas of the deployed model. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class SystemLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # PrivateEndpoints proto is used to provide paths for users to send + # requests privately. + # To send request via private service access, use predict_http_uri, + # explain_http_uri or health_http_uri. To send request via private service + # connect, use service_attachment. + # @!attribute [r] predict_http_uri + # @return [::String] + # Output only. Http(s) path to send prediction requests. + # @!attribute [r] explain_http_uri + # @return [::String] + # Output only. Http(s) path to send explain requests. + # @!attribute [r] health_http_uri + # @return [::String] + # Output only. Http(s) path to send health check requests. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The name of the service attachment resource. Populated if + # private service connect is enabled. + class PrivateEndpoints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for logging request-response to a BigQuery table. + # @!attribute [rw] enabled + # @return [::Boolean] + # If logging is enabled or not. + # @!attribute [rw] sampling_rate + # @return [::Float] + # Percentage of requests to be logged, expressed as a fraction in + # range(0,1]. + # @!attribute [rw] bigquery_destination + # @return [::Google::Cloud::AIPlatform::V1::BigQueryDestination] + # BigQuery table for logging. + # If only given a project, a new dataset will be created with name + # `logging__` where + # will be made BigQuery-dataset-name compatible (e.g. + # most special characters will become underscores). If no table name is + # given, a new table will be created with name `request_response_logging` + class PredictRequestResponseLoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for faster model deployment. + # @!attribute [rw] fast_tryout_enabled + # @return [::Boolean] + # If true, enable fast tryout feature for this deployed model. + class FasterDeploymentConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configurations (e.g. inference timeout) that are applied on your endpoints. + # @!attribute [rw] inference_timeout + # @return [::Google::Protobuf::Duration] + # Customizable online prediction request timeout. + class ClientConnectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb new file mode 100644 index 000000000000..80eca8bee4b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb @@ -0,0 +1,362 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#create_endpoint EndpointService.CreateEndpoint}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the Endpoint in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] endpoint + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # Required. The Endpoint to create. + # @!attribute [rw] endpoint_id + # @return [::String] + # Immutable. The ID to use for endpoint, which will become the final + # component of the endpoint resource name. + # If not provided, Vertex AI will generate a value for this ID. + # + # If the first character is a letter, this value may be up to 63 characters, + # and valid characters are `[a-z0-9-]`. The last character must be a letter + # or number. + # + # If the first character is a number, this value may be up to 9 characters, + # and valid characters are `[0-9]` with no leading zeros. + # + # When using HTTP/JSON, this field is populated + # based on a query string argument, such as `?endpoint_id=12345`. This is the + # fallback for fields that are not included in either the URI or the body. + class CreateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#create_endpoint EndpointService.CreateEndpoint}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateEndpointOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#get_endpoint EndpointService.GetEndpoint} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Endpoint resource. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + class GetEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#list_endpoints EndpointService.ListEndpoints}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the + # Endpoints. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint + # ID, i.e. the last segment of the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#name resource name}. + # * `display_name` supports `=` and `!=`. + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:*` or `labels:key` - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports `=`. + # + # Some examples: + # + # * `endpoint=1` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListEndpointsResponse#next_page_token ListEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#list_endpoints EndpointService.ListEndpoints} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + class ListEndpointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#list_endpoints EndpointService.ListEndpoints}. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Cloud::AIPlatform::V1::Endpoint>] + # List of Endpoints in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListEndpointsRequest#page_token ListEndpointsRequest.page_token} + # to obtain that page. + class ListEndpointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint EndpointService.UpdateEndpoint}. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # Required. The Endpoint which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class UpdateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint_long_running EndpointService.UpdateEndpointLongRunning}. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::AIPlatform::V1::Endpoint] + # Required. The Endpoint which replaces the resource on the server. Currently + # we only support updating the `client_connection_config` field, all the + # other fields' update will be blocked. + class UpdateEndpointLongRunningRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint_long_running EndpointService.UpdateEndpointLongRunning}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UpdateEndpointOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#delete_endpoint EndpointService.DeleteEndpoint}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Endpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + class DeleteEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model EndpointService.DeployModel}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint resource into which to deploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] deployed_model + # @return [::Google::Cloud::AIPlatform::V1::DeployedModel] + # Required. The DeployedModel to be created within the Endpoint. Note that + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split} + # must be updated for the DeployedModel to start receiving traffic, either as + # part of this call, or via + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint EndpointService.UpdateEndpoint}. + # @!attribute [rw] traffic_split + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A map from a DeployedModel's ID to the percentage of this Endpoint's + # traffic that should be forwarded to that DeployedModel. + # + # If this field is non-empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. To refer to the ID of the just being deployed Model, a + # "0" should be used, and the actual ID of the new DeployedModel will be + # filled in its place by this method. The traffic percentage values must add + # up to 100. + # + # If this field is empty, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} is not + # updated. + class DeployModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class TrafficSplitEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model EndpointService.DeployModel}. + # @!attribute [rw] deployed_model + # @return [::Google::Cloud::AIPlatform::V1::DeployedModel] + # The DeployedModel that had been deployed in the Endpoint. + class DeployModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model EndpointService.DeployModel}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class DeployModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#undeploy_model EndpointService.UndeployModel}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint resource from which to undeploy a Model. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] deployed_model_id + # @return [::String] + # Required. The ID of the DeployedModel to be undeployed from the Endpoint. + # @!attribute [rw] traffic_split + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # If this field is provided, then the Endpoint's + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split traffic_split} will be + # overwritten with it. If last DeployedModel is being undeployed from the + # Endpoint, the [Endpoint.traffic_split] will always end up empty when this + # call returns. A DeployedModel will be successfully undeployed only if it + # doesn't have any traffic assigned to it when this method executes, or if + # this field unassigns any traffic to it. + class UndeployModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class TrafficSplitEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#undeploy_model EndpointService.UndeployModel}. + class UndeployModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#undeploy_model EndpointService.UndeployModel}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UndeployModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#mutate_deployed_model EndpointService.MutateDeployedModel}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint resource into which to mutate a + # DeployedModel. Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] deployed_model + # @return [::Google::Cloud::AIPlatform::V1::DeployedModel] + # Required. The DeployedModel to be mutated within the Endpoint. Only the + # following fields can be mutated: + # + # * `min_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * `max_replica_count` in either + # {::Google::Cloud::AIPlatform::V1::DedicatedResources DedicatedResources} or + # {::Google::Cloud::AIPlatform::V1::AutomaticResources AutomaticResources} + # * {::Google::Cloud::AIPlatform::V1::DedicatedResources#autoscaling_metric_specs autoscaling_metric_specs} + # * `disable_container_logging` (v1 only) + # * `enable_container_logging` (v1beta1 only) + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class MutateDeployedModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#mutate_deployed_model EndpointService.MutateDeployedModel}. + # @!attribute [rw] deployed_model + # @return [::Google::Cloud::AIPlatform::V1::DeployedModel] + # The DeployedModel that's being mutated. + class MutateDeployedModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::EndpointService::Client#mutate_deployed_model EndpointService.MutateDeployedModel}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class MutateDeployedModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/entity_type.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/entity_type.rb new file mode 100644 index 000000000000..a6b0328df813 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/entity_type.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # An entity type is a type of object in a system that needs to be modeled and + # have stored information about. For example, driver is an entity type, and + # driver0 is an instance of an entity type driver. + # @!attribute [rw] name + # @return [::String] + # Immutable. Name of the EntityType. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # + # The last part entity_type is assigned by the client. The entity_type can be + # up to 64 characters long and can consist only of ASCII Latin letters A-Z + # and a-z and underscore(_), and ASCII digits 0-9 starting with a letter. The + # value will be unique given a featurestore. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the EntityType. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this EntityType was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this EntityType was most recently updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # EntityTypes. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one EntityType (System + # labels are excluded)." + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform a consistent read-modify-write updates. If not + # set, a blind "overwrite" update happens. + # @!attribute [rw] monitoring_config + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig] + # Optional. The default monitoring configuration for all Features with value + # type + # ({::Google::Cloud::AIPlatform::V1::Feature::ValueType Feature.ValueType}) BOOL, + # STRING, DOUBLE or INT64 under this EntityType. + # + # If this is populated with + # [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot + # analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is + # disabled. + # @!attribute [rw] offline_storage_ttl_days + # @return [::Integer] + # Optional. Config for data retention policy in offline storage. + # TTL in days for feature values that will be stored in offline storage. + # The Feature Store offline storage periodically removes obsolete feature + # values older than `offline_storage_ttl_days` since the feature generation + # time. If unset (or explicitly set to 0), default to 4000 days TTL. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class EntityType + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/env_var.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/env_var.rb new file mode 100644 index 000000000000..147f44eca814 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/env_var.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents an environment variable present in a Container or Python Module. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the environment variable. Must be a valid C identifier. + # @!attribute [rw] value + # @return [::String] + # Required. Variables that reference a $(VAR_NAME) are expanded + # using the previous defined environment variables in the container and + # any service environment variables. If a variable cannot be resolved, + # the reference in the input string will be unchanged. The $(VAR_NAME) + # syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped + # references will never be expanded, regardless of whether the variable + # exists or not. + class EnvVar + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb new file mode 100644 index 000000000000..85ee06c8d7e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb @@ -0,0 +1,186 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # True positive, false positive, or false negative. + # + # EvaluatedAnnotation is only available under ModelEvaluationSlice with slice + # of `annotationSpec` dimension. + # @!attribute [r] type + # @return [::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation::EvaluatedAnnotationType] + # Output only. Type of the EvaluatedAnnotation. + # @!attribute [r] predictions + # @return [::Array<::Google::Protobuf::Value>] + # Output only. The model predicted annotations. + # + # For true positive, there is one and only one prediction, which matches the + # only one ground truth annotation in + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#ground_truths ground_truths}. + # + # For false positive, there is one and only one prediction, which doesn't + # match any ground truth annotation of the corresponding + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#evaluated_data_item_view_id data_item_view_id}. + # + # For false negative, there are zero or more predictions which are similar to + # the only ground truth annotation in + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#ground_truths ground_truths} + # but not enough for a match. + # + # The schema of the prediction is stored in + # {::Google::Cloud::AIPlatform::V1::ModelEvaluation#annotation_schema_uri ModelEvaluation.annotation_schema_uri} + # @!attribute [r] ground_truths + # @return [::Array<::Google::Protobuf::Value>] + # Output only. The ground truth Annotations, i.e. the Annotations that exist + # in the test data the Model is evaluated on. + # + # For true positive, there is one and only one ground truth annotation, which + # matches the only prediction in + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#predictions predictions}. + # + # For false positive, there are zero or more ground truth annotations that + # are similar to the only prediction in + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#predictions predictions}, + # but not enough for a match. + # + # For false negative, there is one and only one ground truth annotation, + # which doesn't match any predictions created by the model. + # + # The schema of the ground truth is stored in + # {::Google::Cloud::AIPlatform::V1::ModelEvaluation#annotation_schema_uri ModelEvaluation.annotation_schema_uri} + # @!attribute [r] data_item_payload + # @return [::Google::Protobuf::Value] + # Output only. The data item payload that the Model predicted this + # EvaluatedAnnotation on. + # @!attribute [r] evaluated_data_item_view_id + # @return [::String] + # Output only. ID of the EvaluatedDataItemView under the same ancestor + # ModelEvaluation. The EvaluatedDataItemView consists of all ground truths + # and predictions on + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#data_item_payload data_item_payload}. + # @!attribute [rw] explanations + # @return [::Array<::Google::Cloud::AIPlatform::V1::EvaluatedAnnotationExplanation>] + # Explanations of + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#predictions predictions}. + # Each element of the explanations indicates the explanation for one + # explanation Method. + # + # The attributions list in the + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotationExplanation#explanation EvaluatedAnnotationExplanation.explanation} + # object corresponds to the + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#predictions predictions} + # list. For example, the second element in the attributions list explains the + # second element in the predictions list. + # @!attribute [rw] error_analysis_annotations + # @return [::Array<::Google::Cloud::AIPlatform::V1::ErrorAnalysisAnnotation>] + # Annotations of model error analysis results. + class EvaluatedAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the type of the EvaluatedAnnotation. The type is determined + module EvaluatedAnnotationType + # Invalid value. + EVALUATED_ANNOTATION_TYPE_UNSPECIFIED = 0 + + # The EvaluatedAnnotation is a true positive. It has a prediction created + # by the Model and a ground truth Annotation which the prediction matches. + TRUE_POSITIVE = 1 + + # The EvaluatedAnnotation is false positive. It has a prediction created by + # the Model which does not match any ground truth annotation. + FALSE_POSITIVE = 2 + + # The EvaluatedAnnotation is false negative. It has a ground truth + # annotation which is not matched by any of the model created predictions. + FALSE_NEGATIVE = 3 + end + end + + # Explanation result of the prediction produced by the Model. + # @!attribute [rw] explanation_type + # @return [::String] + # Explanation type. + # + # For AutoML Image Classification models, possible values are: + # + # * `image-integrated-gradients` + # * `image-xrai` + # @!attribute [rw] explanation + # @return [::Google::Cloud::AIPlatform::V1::Explanation] + # Explanation attribution response details. + class EvaluatedAnnotationExplanation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Model error analysis for each annotation. + # @!attribute [rw] attributed_items + # @return [::Array<::Google::Cloud::AIPlatform::V1::ErrorAnalysisAnnotation::AttributedItem>] + # Attributed items for a given annotation, typically representing neighbors + # from the training sets constrained by the query type. + # @!attribute [rw] query_type + # @return [::Google::Cloud::AIPlatform::V1::ErrorAnalysisAnnotation::QueryType] + # The query type used for finding the attributed items. + # @!attribute [rw] outlier_score + # @return [::Float] + # The outlier score of this annotated item. Usually defined as the min of all + # distances from attributed items. + # @!attribute [rw] outlier_threshold + # @return [::Float] + # The threshold used to determine if this annotation is an outlier or not. + class ErrorAnalysisAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Attributed items for a given annotation, typically representing neighbors + # from the training sets constrained by the query type. + # @!attribute [rw] annotation_resource_name + # @return [::String] + # The unique ID for each annotation. Used by FE to allocate the annotation + # in DB. + # @!attribute [rw] distance + # @return [::Float] + # The distance of this item to the annotation. + class AttributedItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The query type used for finding the attributed items. + module QueryType + # Unspecified query type for model error analysis. + QUERY_TYPE_UNSPECIFIED = 0 + + # Query similar samples across all classes in the dataset. + ALL_SIMILAR = 1 + + # Query similar samples from the same class of the input sample. + SAME_CLASS_SIMILAR = 2 + + # Query dissimilar samples from the same class of the input sample. + SAME_CLASS_DISSIMILAR = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluation_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluation_service.rb new file mode 100644 index 000000000000..3a6e1932b026 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/evaluation_service.rb @@ -0,0 +1,1560 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for EvaluationService.EvaluateInstances. + # @!attribute [rw] exact_match_input + # @return [::Google::Cloud::AIPlatform::V1::ExactMatchInput] + # Auto metric instances. + # Instances and metric spec for exact match metric. + # @!attribute [rw] bleu_input + # @return [::Google::Cloud::AIPlatform::V1::BleuInput] + # Instances and metric spec for bleu metric. + # @!attribute [rw] rouge_input + # @return [::Google::Cloud::AIPlatform::V1::RougeInput] + # Instances and metric spec for rouge metric. + # @!attribute [rw] fluency_input + # @return [::Google::Cloud::AIPlatform::V1::FluencyInput] + # LLM-based metric instance. + # General text generation metrics, applicable to other categories. + # Input for fluency metric. + # @!attribute [rw] coherence_input + # @return [::Google::Cloud::AIPlatform::V1::CoherenceInput] + # Input for coherence metric. + # @!attribute [rw] safety_input + # @return [::Google::Cloud::AIPlatform::V1::SafetyInput] + # Input for safety metric. + # @!attribute [rw] groundedness_input + # @return [::Google::Cloud::AIPlatform::V1::GroundednessInput] + # Input for groundedness metric. + # @!attribute [rw] fulfillment_input + # @return [::Google::Cloud::AIPlatform::V1::FulfillmentInput] + # Input for fulfillment metric. + # @!attribute [rw] summarization_quality_input + # @return [::Google::Cloud::AIPlatform::V1::SummarizationQualityInput] + # Input for summarization quality metric. + # @!attribute [rw] pairwise_summarization_quality_input + # @return [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualityInput] + # Input for pairwise summarization quality metric. + # @!attribute [rw] summarization_helpfulness_input + # @return [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessInput] + # Input for summarization helpfulness metric. + # @!attribute [rw] summarization_verbosity_input + # @return [::Google::Cloud::AIPlatform::V1::SummarizationVerbosityInput] + # Input for summarization verbosity metric. + # @!attribute [rw] question_answering_quality_input + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualityInput] + # Input for question answering quality metric. + # @!attribute [rw] pairwise_question_answering_quality_input + # @return [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualityInput] + # Input for pairwise question answering quality metric. + # @!attribute [rw] question_answering_relevance_input + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceInput] + # Input for question answering relevance metric. + # @!attribute [rw] question_answering_helpfulness_input + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessInput] + # Input for question answering helpfulness + # metric. + # @!attribute [rw] question_answering_correctness_input + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessInput] + # Input for question answering correctness + # metric. + # @!attribute [rw] pointwise_metric_input + # @return [::Google::Cloud::AIPlatform::V1::PointwiseMetricInput] + # Input for pointwise metric. + # @!attribute [rw] pairwise_metric_input + # @return [::Google::Cloud::AIPlatform::V1::PairwiseMetricInput] + # Input for pairwise metric. + # @!attribute [rw] tool_call_valid_input + # @return [::Google::Cloud::AIPlatform::V1::ToolCallValidInput] + # Tool call metric instances. + # Input for tool call valid metric. + # @!attribute [rw] tool_name_match_input + # @return [::Google::Cloud::AIPlatform::V1::ToolNameMatchInput] + # Input for tool name match metric. + # @!attribute [rw] tool_parameter_key_match_input + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchInput] + # Input for tool parameter key match metric. + # @!attribute [rw] tool_parameter_kv_match_input + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchInput] + # Input for tool parameter key value match metric. + # @!attribute [rw] comet_input + # @return [::Google::Cloud::AIPlatform::V1::CometInput] + # Translation metrics. + # Input for Comet metric. + # @!attribute [rw] metricx_input + # @return [::Google::Cloud::AIPlatform::V1::MetricxInput] + # Input for Metricx metric. + # @!attribute [rw] location + # @return [::String] + # Required. The resource name of the Location to evaluate the instances. + # Format: `projects/{project}/locations/{location}` + class EvaluateInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for EvaluationService.EvaluateInstances. + # @!attribute [rw] exact_match_results + # @return [::Google::Cloud::AIPlatform::V1::ExactMatchResults] + # Auto metric evaluation results. + # Results for exact match metric. + # @!attribute [rw] bleu_results + # @return [::Google::Cloud::AIPlatform::V1::BleuResults] + # Results for bleu metric. + # @!attribute [rw] rouge_results + # @return [::Google::Cloud::AIPlatform::V1::RougeResults] + # Results for rouge metric. + # @!attribute [rw] fluency_result + # @return [::Google::Cloud::AIPlatform::V1::FluencyResult] + # LLM-based metric evaluation result. + # General text generation metrics, applicable to other categories. + # Result for fluency metric. + # @!attribute [rw] coherence_result + # @return [::Google::Cloud::AIPlatform::V1::CoherenceResult] + # Result for coherence metric. + # @!attribute [rw] safety_result + # @return [::Google::Cloud::AIPlatform::V1::SafetyResult] + # Result for safety metric. + # @!attribute [rw] groundedness_result + # @return [::Google::Cloud::AIPlatform::V1::GroundednessResult] + # Result for groundedness metric. + # @!attribute [rw] fulfillment_result + # @return [::Google::Cloud::AIPlatform::V1::FulfillmentResult] + # Result for fulfillment metric. + # @!attribute [rw] summarization_quality_result + # @return [::Google::Cloud::AIPlatform::V1::SummarizationQualityResult] + # Summarization only metrics. + # Result for summarization quality metric. + # @!attribute [rw] pairwise_summarization_quality_result + # @return [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualityResult] + # Result for pairwise summarization quality metric. + # @!attribute [rw] summarization_helpfulness_result + # @return [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessResult] + # Result for summarization helpfulness metric. + # @!attribute [rw] summarization_verbosity_result + # @return [::Google::Cloud::AIPlatform::V1::SummarizationVerbosityResult] + # Result for summarization verbosity metric. + # @!attribute [rw] question_answering_quality_result + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualityResult] + # Question answering only metrics. + # Result for question answering quality metric. + # @!attribute [rw] pairwise_question_answering_quality_result + # @return [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualityResult] + # Result for pairwise question answering quality metric. + # @!attribute [rw] question_answering_relevance_result + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceResult] + # Result for question answering relevance metric. + # @!attribute [rw] question_answering_helpfulness_result + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessResult] + # Result for question answering helpfulness metric. + # @!attribute [rw] question_answering_correctness_result + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessResult] + # Result for question answering correctness metric. + # @!attribute [rw] pointwise_metric_result + # @return [::Google::Cloud::AIPlatform::V1::PointwiseMetricResult] + # Generic metrics. + # Result for pointwise metric. + # @!attribute [rw] pairwise_metric_result + # @return [::Google::Cloud::AIPlatform::V1::PairwiseMetricResult] + # Result for pairwise metric. + # @!attribute [rw] tool_call_valid_results + # @return [::Google::Cloud::AIPlatform::V1::ToolCallValidResults] + # Tool call metrics. + # Results for tool call valid metric. + # @!attribute [rw] tool_name_match_results + # @return [::Google::Cloud::AIPlatform::V1::ToolNameMatchResults] + # Results for tool name match metric. + # @!attribute [rw] tool_parameter_key_match_results + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchResults] + # Results for tool parameter key match metric. + # @!attribute [rw] tool_parameter_kv_match_results + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchResults] + # Results for tool parameter key value match metric. + # @!attribute [rw] comet_result + # @return [::Google::Cloud::AIPlatform::V1::CometResult] + # Translation metrics. + # Result for Comet metric. + # @!attribute [rw] metricx_result + # @return [::Google::Cloud::AIPlatform::V1::MetricxResult] + # Result for Metricx metric. + class EvaluateInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for exact match metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::ExactMatchSpec] + # Required. Spec for exact match metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::ExactMatchInstance>] + # Required. Repeated exact match instances. + class ExactMatchInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for exact match instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class ExactMatchInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for exact match metric - returns 1 if prediction and reference exactly + # matches, otherwise 0. + class ExactMatchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for exact match metric. + # @!attribute [r] exact_match_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::ExactMatchMetricValue>] + # Output only. Exact match metric values. + class ExactMatchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Exact match metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Exact match score. + class ExactMatchMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for bleu metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::BleuSpec] + # Required. Spec for bleu score metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::BleuInstance>] + # Required. Repeated bleu instances. + class BleuInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for bleu instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class BleuInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for bleu score metric - calculates the precision of n-grams in the + # prediction as compared to reference - returns a score ranging between 0 to 1. + # @!attribute [rw] use_effective_order + # @return [::Boolean] + # Optional. Whether to use_effective_order to compute bleu score. + class BleuSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for bleu metric. + # @!attribute [r] bleu_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::BleuMetricValue>] + # Output only. Bleu metric values. + class BleuResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Bleu metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Bleu score. + class BleuMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for rouge metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::RougeSpec] + # Required. Spec for rouge score metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::RougeInstance>] + # Required. Repeated rouge instances. + class RougeInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for rouge instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class RougeInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for rouge score metric - calculates the recall of n-grams in prediction + # as compared to reference - returns a score ranging between 0 and 1. + # @!attribute [rw] rouge_type + # @return [::String] + # Optional. Supported rouge types are rougen[1-9], rougeL, and rougeLsum. + # @!attribute [rw] use_stemmer + # @return [::Boolean] + # Optional. Whether to use stemmer to compute rouge score. + # @!attribute [rw] split_summaries + # @return [::Boolean] + # Optional. Whether to split summaries while using rougeLsum. + class RougeSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for rouge metric. + # @!attribute [r] rouge_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::RougeMetricValue>] + # Output only. Rouge metric values. + class RougeResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rouge metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Rouge score. + class RougeMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for coherence metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::CoherenceSpec] + # Required. Spec for coherence score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::CoherenceInstance] + # Required. Coherence instance. + class CoherenceInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for coherence instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + class CoherenceInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for coherence score metric. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class CoherenceSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for coherence result. + # @!attribute [r] score + # @return [::Float] + # Output only. Coherence score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for coherence score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for coherence score. + class CoherenceResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for fluency metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::FluencySpec] + # Required. Spec for fluency score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::FluencyInstance] + # Required. Fluency instance. + class FluencyInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fluency instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + class FluencyInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fluency score metric. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class FluencySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fluency result. + # @!attribute [r] score + # @return [::Float] + # Output only. Fluency score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for fluency score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for fluency score. + class FluencyResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for safety metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::SafetySpec] + # Required. Spec for safety metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::SafetyInstance] + # Required. Safety instance. + class SafetyInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for safety instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + class SafetyInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for safety metric. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class SafetySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for safety result. + # @!attribute [r] score + # @return [::Float] + # Output only. Safety score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for safety score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for safety score. + class SafetyResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for groundedness metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::GroundednessSpec] + # Required. Spec for groundedness metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::GroundednessInstance] + # Required. Groundedness instance. + class GroundednessInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for groundedness instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] context + # @return [::String] + # Required. Background information provided in context used to compare + # against the prediction. + class GroundednessInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for groundedness metric. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class GroundednessSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for groundedness result. + # @!attribute [r] score + # @return [::Float] + # Output only. Groundedness score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for groundedness score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for groundedness score. + class GroundednessResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for fulfillment metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::FulfillmentSpec] + # Required. Spec for fulfillment score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::FulfillmentInstance] + # Required. Fulfillment instance. + class FulfillmentInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fulfillment instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] instruction + # @return [::String] + # Required. Inference instruction prompt to compare prediction with. + class FulfillmentInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fulfillment metric. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class FulfillmentSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for fulfillment result. + # @!attribute [r] score + # @return [::Float] + # Output only. Fulfillment score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for fulfillment score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for fulfillment score. + class FulfillmentResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for summarization quality metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::SummarizationQualitySpec] + # Required. Spec for summarization quality score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::SummarizationQualityInstance] + # Required. Summarization quality instance. + class SummarizationQualityInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization quality instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to be summarized. + # @!attribute [rw] instruction + # @return [::String] + # Required. Summarization prompt for LLM. + class SummarizationQualityInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization quality score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute summarization + # quality. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class SummarizationQualitySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization quality result. + # @!attribute [r] score + # @return [::Float] + # Output only. Summarization Quality score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for summarization quality score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for summarization quality score. + class SummarizationQualityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for pairwise summarization quality metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualitySpec] + # Required. Spec for pairwise summarization quality score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::PairwiseSummarizationQualityInstance] + # Required. Pairwise summarization quality instance. + class PairwiseSummarizationQualityInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise summarization quality instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the candidate model. + # @!attribute [rw] baseline_prediction + # @return [::String] + # Required. Output of the baseline model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to be summarized. + # @!attribute [rw] instruction + # @return [::String] + # Required. Summarization prompt for LLM. + class PairwiseSummarizationQualityInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise summarization quality score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute pairwise + # summarization quality. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class PairwiseSummarizationQualitySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise summarization quality result. + # @!attribute [r] pairwise_choice + # @return [::Google::Cloud::AIPlatform::V1::PairwiseChoice] + # Output only. Pairwise summarization prediction choice. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for summarization quality score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for summarization quality score. + class PairwiseSummarizationQualityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for summarization helpfulness metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessSpec] + # Required. Spec for summarization helpfulness score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::SummarizationHelpfulnessInstance] + # Required. Summarization helpfulness instance. + class SummarizationHelpfulnessInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization helpfulness instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to be summarized. + # @!attribute [rw] instruction + # @return [::String] + # Optional. Summarization prompt for LLM. + class SummarizationHelpfulnessInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization helpfulness score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute summarization + # helpfulness. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class SummarizationHelpfulnessSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization helpfulness result. + # @!attribute [r] score + # @return [::Float] + # Output only. Summarization Helpfulness score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for summarization helpfulness score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for summarization helpfulness score. + class SummarizationHelpfulnessResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for summarization verbosity metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::SummarizationVerbositySpec] + # Required. Spec for summarization verbosity score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::SummarizationVerbosityInstance] + # Required. Summarization verbosity instance. + class SummarizationVerbosityInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization verbosity instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to be summarized. + # @!attribute [rw] instruction + # @return [::String] + # Optional. Summarization prompt for LLM. + class SummarizationVerbosityInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization verbosity score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute summarization + # verbosity. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class SummarizationVerbositySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for summarization verbosity result. + # @!attribute [r] score + # @return [::Float] + # Output only. Summarization Verbosity score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for summarization verbosity score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for summarization verbosity score. + class SummarizationVerbosityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for question answering quality metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualitySpec] + # Required. Spec for question answering quality score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringQualityInstance] + # Required. Question answering quality instance. + class QuestionAnsweringQualityInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering quality instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to answer the question. + # @!attribute [rw] instruction + # @return [::String] + # Required. Question Answering prompt for LLM. + class QuestionAnsweringQualityInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering quality score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute question answering + # quality. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class QuestionAnsweringQualitySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering quality result. + # @!attribute [r] score + # @return [::Float] + # Output only. Question Answering Quality score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for question answering quality score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for question answering quality score. + class QuestionAnsweringQualityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for pairwise question answering quality metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualitySpec] + # Required. Spec for pairwise question answering quality score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::PairwiseQuestionAnsweringQualityInstance] + # Required. Pairwise question answering quality instance. + class PairwiseQuestionAnsweringQualityInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise question answering quality instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the candidate model. + # @!attribute [rw] baseline_prediction + # @return [::String] + # Required. Output of the baseline model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Required. Text to answer the question. + # @!attribute [rw] instruction + # @return [::String] + # Required. Question Answering prompt for LLM. + class PairwiseQuestionAnsweringQualityInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise question answering quality score metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute question answering + # quality. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class PairwiseQuestionAnsweringQualitySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise question answering quality result. + # @!attribute [r] pairwise_choice + # @return [::Google::Cloud::AIPlatform::V1::PairwiseChoice] + # Output only. Pairwise question answering prediction choice. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for question answering quality score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for question answering quality score. + class PairwiseQuestionAnsweringQualityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for question answering relevance metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceSpec] + # Required. Spec for question answering relevance score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringRelevanceInstance] + # Required. Question answering relevance instance. + class QuestionAnsweringRelevanceInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering relevance instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Optional. Text provided as context to answer the question. + # @!attribute [rw] instruction + # @return [::String] + # Required. The question asked and other instruction in the inference prompt. + class QuestionAnsweringRelevanceInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering relevance metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute question answering + # relevance. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class QuestionAnsweringRelevanceSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering relevance result. + # @!attribute [r] score + # @return [::Float] + # Output only. Question Answering Relevance score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for question answering relevance score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for question answering relevance score. + class QuestionAnsweringRelevanceResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for question answering helpfulness metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessSpec] + # Required. Spec for question answering helpfulness score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringHelpfulnessInstance] + # Required. Question answering helpfulness instance. + class QuestionAnsweringHelpfulnessInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering helpfulness instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Optional. Text provided as context to answer the question. + # @!attribute [rw] instruction + # @return [::String] + # Required. The question asked and other instruction in the inference prompt. + class QuestionAnsweringHelpfulnessInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering helpfulness metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute question answering + # helpfulness. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class QuestionAnsweringHelpfulnessSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering helpfulness result. + # @!attribute [r] score + # @return [::Float] + # Output only. Question Answering Helpfulness score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for question answering helpfulness score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for question answering helpfulness score. + class QuestionAnsweringHelpfulnessResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for question answering correctness metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessSpec] + # Required. Spec for question answering correctness score metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::QuestionAnsweringCorrectnessInstance] + # Required. Question answering correctness instance. + class QuestionAnsweringCorrectnessInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering correctness instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] context + # @return [::String] + # Optional. Text provided as context to answer the question. + # @!attribute [rw] instruction + # @return [::String] + # Required. The question asked and other instruction in the inference prompt. + class QuestionAnsweringCorrectnessInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering correctness metric. + # @!attribute [rw] use_reference + # @return [::Boolean] + # Optional. Whether to use instance.reference to compute question answering + # correctness. + # @!attribute [rw] version + # @return [::Integer] + # Optional. Which version to use for evaluation. + class QuestionAnsweringCorrectnessSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for question answering correctness result. + # @!attribute [r] score + # @return [::Float] + # Output only. Question Answering Correctness score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for question answering correctness score. + # @!attribute [r] confidence + # @return [::Float] + # Output only. Confidence for question answering correctness score. + class QuestionAnsweringCorrectnessResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for pointwise metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::PointwiseMetricSpec] + # Required. Spec for pointwise metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::PointwiseMetricInstance] + # Required. Pointwise metric instance. + class PointwiseMetricInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pointwise metric instance. Usually one instance corresponds to one row in an + # evaluation dataset. + # @!attribute [rw] json_instance + # @return [::String] + # Instance specified as a json string. String key-value pairs are expected + # in the json_instance to render + # PointwiseMetricSpec.instance_prompt_template. + class PointwiseMetricInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pointwise metric. + # @!attribute [rw] metric_prompt_template + # @return [::String] + # Required. Metric prompt template for pointwise metric. + class PointwiseMetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pointwise metric result. + # @!attribute [r] score + # @return [::Float] + # Output only. Pointwise metric score. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for pointwise metric score. + class PointwiseMetricResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for pairwise metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::PairwiseMetricSpec] + # Required. Spec for pairwise metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::PairwiseMetricInstance] + # Required. Pairwise metric instance. + class PairwiseMetricInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pairwise metric instance. Usually one instance corresponds to one row in an + # evaluation dataset. + # @!attribute [rw] json_instance + # @return [::String] + # Instance specified as a json string. String key-value pairs are expected + # in the json_instance to render + # PairwiseMetricSpec.instance_prompt_template. + class PairwiseMetricInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise metric. + # @!attribute [rw] metric_prompt_template + # @return [::String] + # Required. Metric prompt template for pairwise metric. + class PairwiseMetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for pairwise metric result. + # @!attribute [r] pairwise_choice + # @return [::Google::Cloud::AIPlatform::V1::PairwiseChoice] + # Output only. Pairwise metric choice. + # @!attribute [r] explanation + # @return [::String] + # Output only. Explanation for pairwise metric score. + class PairwiseMetricResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for tool call valid metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::ToolCallValidSpec] + # Required. Spec for tool call valid metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolCallValidInstance>] + # Required. Repeated tool call valid instances. + class ToolCallValidInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool call valid metric. + class ToolCallValidSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool call valid instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class ToolCallValidInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for tool call valid metric. + # @!attribute [r] tool_call_valid_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolCallValidMetricValue>] + # Output only. Tool call valid metric values. + class ToolCallValidResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool call valid metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Tool call valid score. + class ToolCallValidMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for tool name match metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::ToolNameMatchSpec] + # Required. Spec for tool name match metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolNameMatchInstance>] + # Required. Repeated tool name match instances. + class ToolNameMatchInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool name match metric. + class ToolNameMatchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool name match instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class ToolNameMatchInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for tool name match metric. + # @!attribute [r] tool_name_match_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolNameMatchMetricValue>] + # Output only. Tool name match metric values. + class ToolNameMatchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool name match metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Tool name match score. + class ToolNameMatchMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for tool parameter key match metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchSpec] + # Required. Spec for tool parameter key match metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchInstance>] + # Required. Repeated tool parameter key match instances. + class ToolParameterKeyMatchInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool parameter key match metric. + class ToolParameterKeyMatchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool parameter key match instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class ToolParameterKeyMatchInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for tool parameter key match metric. + # @!attribute [r] tool_parameter_key_match_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolParameterKeyMatchMetricValue>] + # Output only. Tool parameter key match metric values. + class ToolParameterKeyMatchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool parameter key match metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Tool parameter key match score. + class ToolParameterKeyMatchMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for tool parameter key value match metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchSpec] + # Required. Spec for tool parameter key value match metric. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchInstance>] + # Required. Repeated tool parameter key value match instances. + class ToolParameterKVMatchInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool parameter key value match metric. + # @!attribute [rw] use_strict_string_match + # @return [::Boolean] + # Optional. Whether to use STRICT string match on parameter values. + class ToolParameterKVMatchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for tool parameter key value match instance. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Required. Ground truth used to compare against the prediction. + class ToolParameterKVMatchInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for tool parameter key value match metric. + # @!attribute [r] tool_parameter_kv_match_metric_values + # @return [::Array<::Google::Cloud::AIPlatform::V1::ToolParameterKVMatchMetricValue>] + # Output only. Tool parameter key value match metric values. + class ToolParameterKVMatchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool parameter key value match metric value for an instance. + # @!attribute [r] score + # @return [::Float] + # Output only. Tool parameter key value match score. + class ToolParameterKVMatchMetricValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for Comet metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::CometSpec] + # Required. Spec for comet metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::CometInstance] + # Required. Comet instance. + class CometInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for Comet metric. + # @!attribute [rw] version + # @return [::Google::Cloud::AIPlatform::V1::CometSpec::CometVersion] + # Required. Which version to use for evaluation. + # @!attribute [rw] source_language + # @return [::String] + # Optional. Source language in BCP-47 format. + # @!attribute [rw] target_language + # @return [::String] + # Optional. Target language in BCP-47 format. Covers both prediction and + # reference. + class CometSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Comet version options. + module CometVersion + # Comet version unspecified. + COMET_VERSION_UNSPECIFIED = 0 + + # Comet 22 for translation + source + reference + # (source-reference-combined). + COMET_22_SRC_REF = 2 + end + end + + # Spec for Comet instance - The fields used for evaluation are dependent on the + # comet version. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] source + # @return [::String] + # Optional. Source text in original language. + class CometInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for Comet result - calculates the comet score for the given instance + # using the version specified in the spec. + # @!attribute [r] score + # @return [::Float] + # Output only. Comet score. Range depends on version. + class CometResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input for MetricX metric. + # @!attribute [rw] metric_spec + # @return [::Google::Cloud::AIPlatform::V1::MetricxSpec] + # Required. Spec for Metricx metric. + # @!attribute [rw] instance + # @return [::Google::Cloud::AIPlatform::V1::MetricxInstance] + # Required. Metricx instance. + class MetricxInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for MetricX metric. + # @!attribute [rw] version + # @return [::Google::Cloud::AIPlatform::V1::MetricxSpec::MetricxVersion] + # Required. Which version to use for evaluation. + # @!attribute [rw] source_language + # @return [::String] + # Optional. Source language in BCP-47 format. + # @!attribute [rw] target_language + # @return [::String] + # Optional. Target language in BCP-47 format. Covers both prediction and + # reference. + class MetricxSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # MetricX Version options. + module MetricxVersion + # MetricX version unspecified. + METRICX_VERSION_UNSPECIFIED = 0 + + # MetricX 2024 (2.6) for translation + reference (reference-based). + METRICX_24_REF = 1 + + # MetricX 2024 (2.6) for translation + source (QE). + METRICX_24_SRC = 2 + + # MetricX 2024 (2.6) for translation + source + reference + # (source-reference-combined). + METRICX_24_SRC_REF = 3 + end + end + + # Spec for MetricX instance - The fields used for evaluation are dependent on + # the MetricX version. + # @!attribute [rw] prediction + # @return [::String] + # Required. Output of the evaluated model. + # @!attribute [rw] reference + # @return [::String] + # Optional. Ground truth used to compare against the prediction. + # @!attribute [rw] source + # @return [::String] + # Optional. Source text in original language. + class MetricxInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spec for MetricX result - calculates the MetricX score for the given instance + # using the version specified in the spec. + # @!attribute [r] score + # @return [::Float] + # Output only. MetricX score. Range depends on version. + class MetricxResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pairwise prediction autorater preference. + module PairwiseChoice + # Unspecified prediction choice. + PAIRWISE_CHOICE_UNSPECIFIED = 0 + + # Baseline prediction wins + BASELINE = 1 + + # Candidate prediction wins + CANDIDATE = 2 + + # Winner cannot be determined + TIE = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/event.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/event.rb new file mode 100644 index 000000000000..fb5be03610e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/event.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # An edge describing the relationship between an Artifact and an Execution in + # a lineage graph. + # @!attribute [rw] artifact + # @return [::String] + # Required. The relative resource name of the Artifact in the Event. + # @!attribute [r] execution + # @return [::String] + # Output only. The relative resource name of the Execution in the Event. + # @!attribute [r] event_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time the Event occurred. + # @!attribute [rw] type + # @return [::Google::Cloud::AIPlatform::V1::Event::Type] + # Required. The type of the Event. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to annotate Events. + # + # 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. + # No more than 64 user labels can be associated with one Event (System + # labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + class Event + 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 + + # Describes whether an Event's Artifact is the Execution's input or output. + module Type + # Unspecified whether input or output of the Execution. + TYPE_UNSPECIFIED = 0 + + # An input of the Execution. + INPUT = 1 + + # An output of the Execution. + OUTPUT = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb new file mode 100644 index 000000000000..22d0f5ab56d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Instance of a general execution. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the Execution. + # @!attribute [rw] display_name + # @return [::String] + # User provided display name of the Execution. + # May be up to 128 Unicode characters. + # @!attribute [rw] state + # @return [::Google::Cloud::AIPlatform::V1::Execution::State] + # The state of this Execution. This is a property of the Execution, and does + # not imply or capture any ongoing process. This property is managed by + # clients (such as Vertex AI Pipelines) and the system does not prescribe + # or check the validity of state transitions. + # @!attribute [rw] etag + # @return [::String] + # An eTag used to perform consistent read-modify-write updates. If not set, a + # blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Executions. + # + # 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. + # No more than 64 user labels can be associated with one Execution (System + # labels are excluded). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Execution was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Execution was last updated. + # @!attribute [rw] schema_title + # @return [::String] + # The title of the schema describing the metadata. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] schema_version + # @return [::String] + # The version of the schema in `schema_title` to use. + # + # Schema title and version is expected to be registered in earlier Create + # Schema calls. And both are used together as unique identifiers to identify + # schemas within the local metadata store. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Properties of the Execution. + # Top level metadata keys' heading and trailing spaces will be trimmed. + # The size of this field should not exceed 200KB. + # @!attribute [rw] description + # @return [::String] + # Description of the Execution + class Execution + 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 + + # Describes the state of the Execution. + module State + # Unspecified Execution state + STATE_UNSPECIFIED = 0 + + # The Execution is new + NEW = 1 + + # The Execution is running + RUNNING = 2 + + # The Execution has finished running + COMPLETE = 3 + + # The Execution has failed + FAILED = 4 + + # The Execution completed through Cache hit. + CACHED = 5 + + # The Execution was cancelled. + CANCELLED = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation.rb new file mode 100644 index 000000000000..1a16bca1a903 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation.rb @@ -0,0 +1,647 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Explanation of a prediction (provided in + # {::Google::Cloud::AIPlatform::V1::PredictResponse#predictions PredictResponse.predictions}) + # produced by the Model on a given + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances instance}. + # @!attribute [r] attributions + # @return [::Array<::Google::Cloud::AIPlatform::V1::Attribution>] + # Output only. Feature attributions grouped by predicted outputs. + # + # For Models that predict only one output, such as regression Models that + # predict only one score, there is only one attibution that explains the + # predicted output. For Models that predict multiple outputs, such as + # multiclass Models that predict multiple classes, each element explains one + # specific item. + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index Attribution.output_index} + # can be used to identify which output this attribution is explaining. + # + # By default, we provide Shapley values for the predicted class. However, + # you can configure the explanation request to generate Shapley values for + # any other classes too. For example, if a model predicts a probability of + # `0.4` for approving a loan application, the model's decision is to reject + # the application since `p(reject) = 0.6 > p(approve) = 0.4`, and the default + # Shapley values would be computed for rejection decision and not approval, + # even though the latter might be the positive class. + # + # If users set + # {::Google::Cloud::AIPlatform::V1::ExplanationParameters#top_k ExplanationParameters.top_k}, + # the attributions are sorted by + # {::Google::Cloud::AIPlatform::V1::Attribution#instance_output_value instance_output_value} + # in descending order. If + # {::Google::Cloud::AIPlatform::V1::ExplanationParameters#output_indices ExplanationParameters.output_indices} + # is specified, the attributions are stored by + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index Attribution.output_index} + # in the same order as they appear in the output_indices. + # @!attribute [r] neighbors + # @return [::Array<::Google::Cloud::AIPlatform::V1::Neighbor>] + # Output only. List of the nearest neighbors for example-based explanations. + # + # For models deployed with the examples explanations feature enabled, the + # attributions field is empty and instead the neighbors field is populated. + class Explanation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Aggregated explanation metrics for a Model over a set of instances. + # @!attribute [r] mean_attributions + # @return [::Array<::Google::Cloud::AIPlatform::V1::Attribution>] + # Output only. Aggregated attributions explaining the Model's prediction + # outputs over the set of instances. The attributions are grouped by outputs. + # + # For Models that predict only one output, such as regression Models that + # predict only one score, there is only one attibution that explains the + # predicted output. For Models that predict multiple outputs, such as + # multiclass Models that predict multiple classes, each element explains one + # specific item. + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index Attribution.output_index} + # can be used to identify which output this attribution is explaining. + # + # The + # {::Google::Cloud::AIPlatform::V1::Attribution#baseline_output_value baselineOutputValue}, + # {::Google::Cloud::AIPlatform::V1::Attribution#instance_output_value instanceOutputValue} + # and + # {::Google::Cloud::AIPlatform::V1::Attribution#feature_attributions featureAttributions} + # fields are averaged over the test data. + # + # NOTE: Currently AutoML tabular classification Models produce only one + # attribution, which averages attributions over all the classes it predicts. + # {::Google::Cloud::AIPlatform::V1::Attribution#approximation_error Attribution.approximation_error} + # is not populated. + class ModelExplanation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Attribution that explains a particular prediction output. + # @!attribute [r] baseline_output_value + # @return [::Float] + # Output only. Model predicted output if the input instance is constructed + # from the baselines of all the features defined in + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#inputs ExplanationMetadata.inputs}. + # The field name of the output is determined by the key in + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#outputs ExplanationMetadata.outputs}. + # + # If the Model's predicted output has multiple dimensions (rank > 1), this is + # the value in the output located by + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index output_index}. + # + # If there are multiple baselines, their output values are averaged. + # @!attribute [r] instance_output_value + # @return [::Float] + # Output only. Model predicted output on the corresponding [explanation + # instance][ExplainRequest.instances]. The field name of the output is + # determined by the key in + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#outputs ExplanationMetadata.outputs}. + # + # If the Model predicted output has multiple dimensions, this is the value in + # the output located by + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index output_index}. + # @!attribute [r] feature_attributions + # @return [::Google::Protobuf::Value] + # Output only. Attributions of each explained feature. Features are extracted + # from the [prediction + # instances][google.cloud.aiplatform.v1.ExplainRequest.instances] according + # to [explanation metadata for + # inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. + # + # The value is a struct, whose keys are the name of the feature. The values + # are how much the feature in the + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances instance} contributed + # to the predicted result. + # + # The format of the value is determined by the feature's input format: + # + # * If the feature is a scalar value, the attribution value is a + # {::Google::Protobuf::Value#number_value floating number}. + # + # * If the feature is an array of scalar values, the attribution value is + # an {::Google::Protobuf::Value#list_value array}. + # + # * If the feature is a struct, the attribution value is a + # {::Google::Protobuf::Value#struct_value struct}. The keys in the + # attribution value struct are the same as the keys in the feature + # struct. The formats of the values in the attribution struct are + # determined by the formats of the values in the feature struct. + # + # The + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#feature_attributions_schema_uri ExplanationMetadata.feature_attributions_schema_uri} + # field, pointed to by the + # {::Google::Cloud::AIPlatform::V1::ExplanationSpec ExplanationSpec} field of the + # {::Google::Cloud::AIPlatform::V1::Endpoint#deployed_models Endpoint.deployed_models} + # object, points to the schema file that describes the features and their + # attribution values (if it is populated). + # @!attribute [r] output_index + # @return [::Array<::Integer>] + # Output only. The index that locates the explained prediction output. + # + # If the prediction output is a scalar value, output_index is not populated. + # If the prediction output has multiple dimensions, the length of the + # output_index list is the same as the number of dimensions of the output. + # The i-th element in output_index is the element index of the i-th dimension + # of the output vector. Indices start from 0. + # @!attribute [r] output_display_name + # @return [::String] + # Output only. The display name of the output identified by + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index output_index}. For + # example, the predicted class name by a multi-classification Model. + # + # This field is only populated iff the Model predicts display names as a + # separate field along with the explained output. The predicted display name + # must has the same shape of the explained output, and can be located using + # output_index. + # @!attribute [r] approximation_error + # @return [::Float] + # Output only. Error of + # {::Google::Cloud::AIPlatform::V1::Attribution#feature_attributions feature_attributions} + # caused by approximation used in the explanation method. Lower value means + # more precise attributions. + # + # * For Sampled Shapley + # {::Google::Cloud::AIPlatform::V1::ExplanationParameters#sampled_shapley_attribution attribution}, + # increasing + # {::Google::Cloud::AIPlatform::V1::SampledShapleyAttribution#path_count path_count} + # might reduce the error. + # * For Integrated Gradients + # {::Google::Cloud::AIPlatform::V1::ExplanationParameters#integrated_gradients_attribution attribution}, + # increasing + # {::Google::Cloud::AIPlatform::V1::IntegratedGradientsAttribution#step_count step_count} + # might reduce the error. + # * For [XRAI + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], + # increasing + # {::Google::Cloud::AIPlatform::V1::XraiAttribution#step_count step_count} might + # reduce the error. + # + # See [this introduction](/vertex-ai/docs/explainable-ai/overview) + # for more information. + # @!attribute [r] output_name + # @return [::String] + # Output only. Name of the explain output. Specified as the key in + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#outputs ExplanationMetadata.outputs}. + class Attribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Neighbors for example-based explanations. + # @!attribute [r] neighbor_id + # @return [::String] + # Output only. The neighbor id. + # @!attribute [r] neighbor_distance + # @return [::Float] + # Output only. The neighbor distance. + class Neighbor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of Model explanation. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::ExplanationParameters] + # Required. Parameters that configure explaining of the Model's predictions. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata] + # Optional. Metadata describing the Model's input and output for explanation. + class ExplanationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters to configure explaining for Model's predictions. + # @!attribute [rw] sampled_shapley_attribution + # @return [::Google::Cloud::AIPlatform::V1::SampledShapleyAttribution] + # An attribution method that approximates Shapley values for features that + # contribute to the label being predicted. A sampling strategy is used to + # approximate the value rather than considering all subsets of features. + # Refer to this paper for model details: https://arxiv.org/abs/1306.4265. + # @!attribute [rw] integrated_gradients_attribution + # @return [::Google::Cloud::AIPlatform::V1::IntegratedGradientsAttribution] + # An attribution method that computes Aumann-Shapley values taking + # advantage of the model's fully differentiable structure. Refer to this + # paper for more details: https://arxiv.org/abs/1703.01365 + # @!attribute [rw] xrai_attribution + # @return [::Google::Cloud::AIPlatform::V1::XraiAttribution] + # An attribution method that redistributes Integrated Gradients + # attribution to segmented regions, taking advantage of the model's fully + # differentiable structure. Refer to this paper for + # more details: https://arxiv.org/abs/1906.02825 + # + # XRAI currently performs better on natural images, like a picture of a + # house or an animal. If the images are taken in artificial environments, + # like a lab or manufacturing line, or from diagnostic equipment, like + # x-rays or quality-control cameras, use Integrated Gradients instead. + # @!attribute [rw] examples + # @return [::Google::Cloud::AIPlatform::V1::Examples] + # Example-based explanations that returns the nearest neighbors from the + # provided dataset. + # @!attribute [rw] top_k + # @return [::Integer] + # If populated, returns attributions for top K indices of outputs + # (defaults to 1). Only applies to Models that predicts more than one outputs + # (e,g, multi-class Models). When set to -1, returns explanations for all + # outputs. + # @!attribute [rw] output_indices + # @return [::Google::Protobuf::ListValue] + # If populated, only returns attributions that have + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index output_index} + # contained in output_indices. It must be an ndarray of integers, with the + # same shape of the output it's explaining. + # + # If not populated, returns attributions for + # {::Google::Cloud::AIPlatform::V1::ExplanationParameters#top_k top_k} indices of + # outputs. If neither top_k nor output_indices is populated, returns the + # argmax index of the outputs. + # + # Only applicable to Models that predict multiple outputs (e,g, multi-class + # Models that predict multiple classes). + class ExplanationParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An attribution method that approximates Shapley values for features that + # contribute to the label being predicted. A sampling strategy is used to + # approximate the value rather than considering all subsets of features. + # @!attribute [rw] path_count + # @return [::Integer] + # Required. The number of feature permutations to consider when approximating + # the Shapley values. + # + # Valid range of its value is [1, 50], inclusively. + class SampledShapleyAttribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An attribution method that computes the Aumann-Shapley value taking advantage + # of the model's fully differentiable structure. Refer to this paper for + # more details: https://arxiv.org/abs/1703.01365 + # @!attribute [rw] step_count + # @return [::Integer] + # Required. The number of steps for approximating the path integral. + # A good value to start is 50 and gradually increase until the + # sum to diff property is within the desired error range. + # + # Valid range of its value is [1, 100], inclusively. + # @!attribute [rw] smooth_grad_config + # @return [::Google::Cloud::AIPlatform::V1::SmoothGradConfig] + # Config for SmoothGrad approximation of gradients. + # + # When enabled, the gradients are approximated by averaging the gradients + # from noisy samples in the vicinity of the inputs. Adding + # noise can help improve the computed gradients. Refer to this paper for more + # details: https://arxiv.org/pdf/1706.03825.pdf + # @!attribute [rw] blur_baseline_config + # @return [::Google::Cloud::AIPlatform::V1::BlurBaselineConfig] + # Config for IG with blur baseline. + # + # When enabled, a linear path from the maximally blurred image to the input + # image is created. Using a blurred baseline instead of zero (black image) is + # motivated by the BlurIG approach explained here: + # https://arxiv.org/abs/2004.03383 + class IntegratedGradientsAttribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An explanation method that redistributes Integrated Gradients + # attributions to segmented regions, taking advantage of the model's fully + # differentiable structure. Refer to this paper for more details: + # https://arxiv.org/abs/1906.02825 + # + # Supported only by image Models. + # @!attribute [rw] step_count + # @return [::Integer] + # Required. The number of steps for approximating the path integral. + # A good value to start is 50 and gradually increase until the + # sum to diff property is met within the desired error range. + # + # Valid range of its value is [1, 100], inclusively. + # @!attribute [rw] smooth_grad_config + # @return [::Google::Cloud::AIPlatform::V1::SmoothGradConfig] + # Config for SmoothGrad approximation of gradients. + # + # When enabled, the gradients are approximated by averaging the gradients + # from noisy samples in the vicinity of the inputs. Adding + # noise can help improve the computed gradients. Refer to this paper for more + # details: https://arxiv.org/pdf/1706.03825.pdf + # @!attribute [rw] blur_baseline_config + # @return [::Google::Cloud::AIPlatform::V1::BlurBaselineConfig] + # Config for XRAI with blur baseline. + # + # When enabled, a linear path from the maximally blurred image to the input + # image is created. Using a blurred baseline instead of zero (black image) is + # motivated by the BlurIG approach explained here: + # https://arxiv.org/abs/2004.03383 + class XraiAttribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for SmoothGrad approximation of gradients. + # + # When enabled, the gradients are approximated by averaging the gradients from + # noisy samples in the vicinity of the inputs. Adding noise can help improve + # the computed gradients. Refer to this paper for more details: + # https://arxiv.org/pdf/1706.03825.pdf + # @!attribute [rw] noise_sigma + # @return [::Float] + # This is a single float value and will be used to add noise to all the + # features. Use this field when all features are normalized to have the + # same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where + # features are normalized to have 0-mean and 1-variance. Learn more about + # [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). + # + # For best results the recommended value is about 10% - 20% of the standard + # deviation of the input feature. Refer to section 3.2 of the SmoothGrad + # paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. + # + # If the distribution is different per feature, set + # {::Google::Cloud::AIPlatform::V1::SmoothGradConfig#feature_noise_sigma feature_noise_sigma} + # instead for each feature. + # @!attribute [rw] feature_noise_sigma + # @return [::Google::Cloud::AIPlatform::V1::FeatureNoiseSigma] + # This is similar to + # {::Google::Cloud::AIPlatform::V1::SmoothGradConfig#noise_sigma noise_sigma}, + # but provides additional flexibility. A separate noise sigma can be + # provided for each feature, which is useful if their distributions are + # different. No noise is added to features that are not set. If this field + # is unset, + # {::Google::Cloud::AIPlatform::V1::SmoothGradConfig#noise_sigma noise_sigma} + # will be used for all features. + # @!attribute [rw] noisy_sample_count + # @return [::Integer] + # The number of gradient samples to use for + # approximation. The higher this number, the more accurate the gradient + # is, but the runtime complexity increases by this factor as well. + # Valid range of its value is [1, 50]. Defaults to 3. + class SmoothGradConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Noise sigma by features. Noise sigma represents the standard deviation of the + # gaussian kernel that will be used to add noise to interpolated inputs prior + # to computing gradients. + # @!attribute [rw] noise_sigma + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureNoiseSigma::NoiseSigmaForFeature>] + # Noise sigma per feature. No noise is added to features that are not set. + class FeatureNoiseSigma + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Noise sigma for a single feature. + # @!attribute [rw] name + # @return [::String] + # The name of the input feature for which noise sigma is provided. The + # features are defined in + # [explanation metadata + # inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. + # @!attribute [rw] sigma + # @return [::Float] + # This represents the standard deviation of the Gaussian kernel that will + # be used to add noise to the feature prior to computing gradients. Similar + # to {::Google::Cloud::AIPlatform::V1::SmoothGradConfig#noise_sigma noise_sigma} + # but represents the noise added to the current feature. Defaults to 0.1. + class NoiseSigmaForFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Config for blur baseline. + # + # When enabled, a linear path from the maximally blurred image to the input + # image is created. Using a blurred baseline instead of zero (black image) is + # motivated by the BlurIG approach explained here: + # https://arxiv.org/abs/2004.03383 + # @!attribute [rw] max_blur_sigma + # @return [::Float] + # The standard deviation of the blur kernel for the blurred baseline. The + # same blurring parameter is used for both the height and the width + # dimension. If not set, the method defaults to the zero (i.e. black for + # images) baseline. + class BlurBaselineConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Example-based explainability that returns the nearest neighbors from the + # provided dataset. + # @!attribute [rw] example_gcs_source + # @return [::Google::Cloud::AIPlatform::V1::Examples::ExampleGcsSource] + # The Cloud Storage input instances. + # @!attribute [rw] nearest_neighbor_search_config + # @return [::Google::Protobuf::Value] + # The full configuration for the generated index, the semantics are the + # same as {::Google::Cloud::AIPlatform::V1::Index#metadata metadata} and should + # match + # [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). + # @!attribute [rw] presets + # @return [::Google::Cloud::AIPlatform::V1::Presets] + # Simplified preset configuration, which automatically sets configuration + # values based on the desired query speed-precision trade-off and modality. + # @!attribute [rw] neighbor_count + # @return [::Integer] + # The number of neighbors to return when querying for examples. + class Examples + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Cloud Storage input instances. + # @!attribute [rw] data_format + # @return [::Google::Cloud::AIPlatform::V1::Examples::ExampleGcsSource::DataFormat] + # The format in which instances are given, if not specified, assume it's + # JSONL format. Currently only JSONL format is supported. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # The Cloud Storage location for the input instances. + class ExampleGcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The format of the input example instances. + module DataFormat + # Format unspecified, used when unset. + DATA_FORMAT_UNSPECIFIED = 0 + + # Examples are stored in JSONL files. + JSONL = 1 + end + end + end + + # Preset configuration for example-based explanations + # @!attribute [rw] query + # @return [::Google::Cloud::AIPlatform::V1::Presets::Query] + # Preset option controlling parameters for speed-precision trade-off when + # querying for examples. If omitted, defaults to `PRECISE`. + # @!attribute [rw] modality + # @return [::Google::Cloud::AIPlatform::V1::Presets::Modality] + # The modality of the uploaded model, which automatically configures the + # distance measurement and feature normalization for the underlying example + # index and queries. If your model does not precisely fit one of these types, + # it is okay to choose the closest type. + class Presets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Preset option controlling parameters for query speed-precision trade-off + module Query + # More precise neighbors as a trade-off against slower response. + PRECISE = 0 + + # Faster response as a trade-off against less precise neighbors. + FAST = 1 + end + + # Preset option controlling parameters for different modalities + module Modality + # Should not be set. Added as a recommended best practice for enums + MODALITY_UNSPECIFIED = 0 + + # IMAGE modality + IMAGE = 1 + + # TEXT modality + TEXT = 2 + + # TABULAR modality + TABULAR = 3 + end + end + + # The {::Google::Cloud::AIPlatform::V1::ExplanationSpec ExplanationSpec} entries + # that can be overridden at [online + # explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::ExplanationParameters] + # The parameters to be overridden. Note that the + # attribution method cannot be changed. If not specified, + # no parameter is overridden. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadataOverride] + # The metadata to be overridden. If not specified, no metadata is overridden. + # @!attribute [rw] examples_override + # @return [::Google::Cloud::AIPlatform::V1::ExamplesOverride] + # The example-based explanations parameter overrides. + class ExplanationSpecOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The {::Google::Cloud::AIPlatform::V1::ExplanationMetadata ExplanationMetadata} + # entries that can be overridden at [online + # explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. + # @!attribute [rw] inputs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ExplanationMetadataOverride::InputMetadataOverride}] + # Required. Overrides the [input + # metadata][google.cloud.aiplatform.v1.ExplanationMetadata.inputs] of the + # features. The key is the name of the feature to be overridden. The keys + # specified here must exist in the input metadata to be overridden. If a + # feature is not specified here, the corresponding feature's input metadata + # is not overridden. + class ExplanationMetadataOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The [input + # metadata][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata] + # entries to be overridden. + # @!attribute [rw] input_baselines + # @return [::Array<::Google::Protobuf::Value>] + # Baseline inputs for this feature. + # + # This overrides the `input_baseline` field of the + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata ExplanationMetadata.InputMetadata} + # object of the corresponding feature's input metadata. If it's not + # specified, the original baselines are not overridden. + class InputMetadataOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadataOverride::InputMetadataOverride] + class InputsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Overrides for example-based explanations. + # @!attribute [rw] neighbor_count + # @return [::Integer] + # The number of neighbors to return. + # @!attribute [rw] crowding_count + # @return [::Integer] + # The number of neighbors to return that have the same crowding tag. + # @!attribute [rw] restrictions + # @return [::Array<::Google::Cloud::AIPlatform::V1::ExamplesRestrictionsNamespace>] + # Restrict the resulting nearest neighbors to respect these constraints. + # @!attribute [rw] return_embeddings + # @return [::Boolean] + # If true, return the embeddings instead of neighbors. + # @!attribute [rw] data_format + # @return [::Google::Cloud::AIPlatform::V1::ExamplesOverride::DataFormat] + # The format of the data being provided with each call. + class ExamplesOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Data format enum. + module DataFormat + # Unspecified format. Must not be used. + DATA_FORMAT_UNSPECIFIED = 0 + + # Provided data is a set of model inputs. + INSTANCES = 1 + + # Provided data is a set of embeddings. + EMBEDDINGS = 2 + end + end + + # Restrictions namespace for example-based explanations overrides. + # @!attribute [rw] namespace_name + # @return [::String] + # The namespace name. + # @!attribute [rw] allow + # @return [::Array<::String>] + # The list of allowed tags. + # @!attribute [rw] deny + # @return [::Array<::String>] + # The list of deny tags. + class ExamplesRestrictionsNamespace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb new file mode 100644 index 000000000000..a511f00740ab --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Metadata describing the Model's input and output for explanation. + # @!attribute [rw] inputs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata}] + # Required. Map from feature names to feature input metadata. Keys are the + # name of the features. Values are the specification of the feature. + # + # An empty InputMetadata is valid. It describes a text feature which has the + # name specified as the key in + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata#inputs ExplanationMetadata.inputs}. + # The baseline of the empty feature is chosen by Vertex AI. + # + # For Vertex AI-provided Tensorflow images, the key can be any friendly + # name of the feature. Once specified, + # {::Google::Cloud::AIPlatform::V1::Attribution#feature_attributions featureAttributions} + # are keyed by this key (if not grouped with another feature). + # + # For custom images, the key must match with the key in + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances instance}. + # @!attribute [rw] outputs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ExplanationMetadata::OutputMetadata}] + # Required. Map from output names to output metadata. + # + # For Vertex AI-provided Tensorflow images, keys can be any user defined + # string that consists of any UTF-8 characters. + # + # For custom images, keys are the name of the output field in the prediction + # to be explained. + # + # Currently only one key is allowed. + # @!attribute [rw] feature_attributions_schema_uri + # @return [::String] + # Points to a YAML file stored on Google Cloud Storage describing the format + # of the [feature + # attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions]. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # AutoML tabular Models always have this field populated by Vertex AI. + # Note: The URI given on output may be different, including the URI scheme, + # than the one given on input. The output URI will point to a location where + # the user only has a read access. + # @!attribute [rw] latent_space_source + # @return [::String] + # Name of the source to generate embeddings for example based explanations. + class ExplanationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata of the input of a feature. + # + # Fields other than + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#input_baselines InputMetadata.input_baselines} + # are applicable only for Models that are using Vertex AI-provided images for + # Tensorflow. + # @!attribute [rw] input_baselines + # @return [::Array<::Google::Protobuf::Value>] + # Baseline inputs for this feature. + # + # If no baseline is specified, Vertex AI chooses the baseline for this + # feature. If multiple baselines are specified, Vertex AI returns the + # average attributions across them in + # {::Google::Cloud::AIPlatform::V1::Attribution#feature_attributions Attribution.feature_attributions}. + # + # For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape + # of each baseline must match the shape of the input tensor. If a scalar is + # provided, we broadcast to the same shape as the input tensor. + # + # For custom images, the element of the baselines must be in the same + # format as the feature's input in the + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances instance}[]. The + # schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @!attribute [rw] input_tensor_name + # @return [::String] + # Name of the input tensor for this feature. Required and is only + # applicable to Vertex AI-provided images for Tensorflow. + # @!attribute [rw] encoding + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Encoding] + # Defines how the feature is encoded into the input tensor. Defaults to + # IDENTITY. + # @!attribute [rw] modality + # @return [::String] + # Modality of the feature. Valid values are: numeric, image. Defaults to + # numeric. + # @!attribute [rw] feature_value_domain + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::FeatureValueDomain] + # The domain details of the input feature value. Like min/max, original + # mean or standard deviation if normalized. + # @!attribute [rw] indices_tensor_name + # @return [::String] + # Specifies the index of the values of the input tensor. + # Required when the input tensor is a sparse representation. Refer to + # Tensorflow documentation for more details: + # https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + # @!attribute [rw] dense_shape_tensor_name + # @return [::String] + # Specifies the shape of the values of the input if the input is a sparse + # representation. Refer to Tensorflow documentation for more details: + # https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + # @!attribute [rw] index_feature_mapping + # @return [::Array<::String>] + # A list of feature names for each index in the input tensor. + # Required when the input + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#encoding InputMetadata.encoding} + # is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR. + # @!attribute [rw] encoded_tensor_name + # @return [::String] + # Encoded tensor is a transformation of the input tensor. Must be provided + # if choosing + # [Integrated Gradients + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution] + # or [XRAI + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution] + # and the input tensor is not differentiable. + # + # An encoded tensor is generated if the input tensor is encoded by a lookup + # table. + # @!attribute [rw] encoded_baselines + # @return [::Array<::Google::Protobuf::Value>] + # A list of baselines for the encoded tensor. + # + # The shape of each baseline should match the shape of the encoded tensor. + # If a scalar is provided, Vertex AI broadcasts to the same shape as the + # encoded tensor. + # @!attribute [rw] visualization + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization] + # Visualization configurations for image explanation. + # @!attribute [rw] group_name + # @return [::String] + # Name of the group that the input belongs to. Features with the same group + # name will be treated as one feature when computing attributions. Features + # grouped together can have different shapes in value. If provided, there + # will be one single attribution generated in + # {::Google::Cloud::AIPlatform::V1::Attribution#feature_attributions Attribution.feature_attributions}, + # keyed by the group name. + class InputMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Domain details of the input feature value. Provides numeric information + # about the feature, such as its range (min, max). If the feature has been + # pre-processed, for example with z-scoring, then it provides information + # about how to recover the original feature. For example, if the input + # feature is an image and it has been pre-processed to obtain 0-mean and + # stddev = 1 values, then original_mean, and original_stddev refer to the + # mean and stddev of the original feature (e.g. image tensor) from which + # input feature (with mean = 0 and stddev = 1) was obtained. + # @!attribute [rw] min_value + # @return [::Float] + # The minimum permissible value for this feature. + # @!attribute [rw] max_value + # @return [::Float] + # The maximum permissible value for this feature. + # @!attribute [rw] original_mean + # @return [::Float] + # If this input feature has been normalized to a mean value of 0, + # the original_mean specifies the mean value of the domain prior to + # normalization. + # @!attribute [rw] original_stddev + # @return [::Float] + # If this input feature has been normalized to a standard deviation of + # 1.0, the original_stddev specifies the standard deviation of the domain + # prior to normalization. + class FeatureValueDomain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Visualization configurations for image explanation. + # @!attribute [rw] type + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::Type] + # Type of the image visualization. Only applicable to + # [Integrated Gradients + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. + # OUTLINES shows regions of attribution, while PIXELS shows per-pixel + # attribution. Defaults to OUTLINES. + # @!attribute [rw] polarity + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::Polarity] + # Whether to only highlight pixels with positive contributions, negative + # or both. Defaults to POSITIVE. + # @!attribute [rw] color_map + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::ColorMap] + # The color scheme used for the highlighted areas. + # + # Defaults to PINK_GREEN for + # [Integrated Gradients + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], + # which shows positive attributions in green and negative in pink. + # + # Defaults to VIRIDIS for + # [XRAI + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], + # which highlights the most influential regions in yellow and the least + # influential in blue. + # @!attribute [rw] clip_percent_upperbound + # @return [::Float] + # Excludes attributions above the specified percentile from the + # highlighted areas. Using the clip_percent_upperbound and + # clip_percent_lowerbound together can be useful for filtering out noise + # and making it easier to see areas of strong attribution. Defaults to + # 99.9. + # @!attribute [rw] clip_percent_lowerbound + # @return [::Float] + # Excludes attributions below the specified percentile, from the + # highlighted areas. Defaults to 62. + # @!attribute [rw] overlay_type + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::OverlayType] + # How the original image is displayed in the visualization. + # Adjusting the overlay can help increase visual clarity if the original + # image makes it difficult to view the visualization. Defaults to NONE. + class Visualization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the image visualization. Only applicable to + # [Integrated Gradients + # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. + module Type + # Should not be used. + TYPE_UNSPECIFIED = 0 + + # Shows which pixel contributed to the image prediction. + PIXELS = 1 + + # Shows which region contributed to the image prediction by outlining + # the region. + OUTLINES = 2 + end + + # Whether to only highlight pixels with positive contributions, negative + # or both. Defaults to POSITIVE. + module Polarity + # Default value. This is the same as POSITIVE. + POLARITY_UNSPECIFIED = 0 + + # Highlights the pixels/outlines that were most influential to the + # model's prediction. + POSITIVE = 1 + + # Setting polarity to negative highlights areas that does not lead to + # the models's current prediction. + NEGATIVE = 2 + + # Shows both positive and negative attributions. + BOTH = 3 + end + + # The color scheme used for highlighting areas. + module ColorMap + # Should not be used. + COLOR_MAP_UNSPECIFIED = 0 + + # Positive: green. Negative: pink. + PINK_GREEN = 1 + + # Viridis color map: A perceptually uniform color mapping which is + # easier to see by those with colorblindness and progresses from yellow + # to green to blue. Positive: yellow. Negative: blue. + VIRIDIS = 2 + + # Positive: red. Negative: red. + RED = 3 + + # Positive: green. Negative: green. + GREEN = 4 + + # Positive: green. Negative: red. + RED_GREEN = 6 + + # PiYG palette. + PINK_WHITE_GREEN = 5 + end + + # How the original image is displayed in the visualization. + module OverlayType + # Default value. This is the same as NONE. + OVERLAY_TYPE_UNSPECIFIED = 0 + + # No overlay. + NONE = 1 + + # The attributions are shown on top of the original image. + ORIGINAL = 2 + + # The attributions are shown on top of grayscaled version of the + # original image. + GRAYSCALE = 3 + + # The attributions are used as a mask to reveal predictive parts of + # the image and hide the un-predictive parts. + MASK_BLACK = 4 + end + end + + # Defines how a feature is encoded. Defaults to IDENTITY. + module Encoding + # Default value. This is the same as IDENTITY. + ENCODING_UNSPECIFIED = 0 + + # The tensor represents one feature. + IDENTITY = 1 + + # The tensor represents a bag of features where each index maps to + # a feature. + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#index_feature_mapping InputMetadata.index_feature_mapping} + # must be provided for this encoding. For example: + # ``` + # input = [27, 6.0, 150] + # index_feature_mapping = ["age", "height", "weight"] + # ``` + BAG_OF_FEATURES = 2 + + # The tensor represents a bag of features where each index maps to a + # feature. Zero values in the tensor indicates feature being + # non-existent. + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#index_feature_mapping InputMetadata.index_feature_mapping} + # must be provided for this encoding. For example: + # ``` + # input = [2, 0, 5, 0, 1] + # index_feature_mapping = ["a", "b", "c", "d", "e"] + # ``` + BAG_OF_FEATURES_SPARSE = 3 + + # The tensor is a list of binaries representing whether a feature exists + # or not (1 indicates existence). + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#index_feature_mapping InputMetadata.index_feature_mapping} + # must be provided for this encoding. For example: + # ``` + # input = [1, 0, 1, 0, 1] + # index_feature_mapping = ["a", "b", "c", "d", "e"] + # ``` + INDICATOR = 4 + + # The tensor is encoded into a 1-dimensional array represented by an + # encoded tensor. + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#encoded_tensor_name InputMetadata.encoded_tensor_name} + # must be provided for this encoding. For example: + # ``` + # input = ["This", "is", "a", "test", "."] + # encoded = [0.1, 0.2, 0.3, 0.4, 0.5] + # ``` + COMBINED_EMBEDDING = 5 + + # Select this encoding when the input tensor is encoded into a + # 2-dimensional array represented by an encoded tensor. + # {::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata#encoded_tensor_name InputMetadata.encoded_tensor_name} + # must be provided for this encoding. The first dimension of the encoded + # tensor's shape is the same as the input tensor's shape. For example: + # ``` + # input = ["This", "is", "a", "test", "."] + # encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], + # [0.2, 0.1, 0.4, 0.3, 0.5], + # [0.5, 0.1, 0.3, 0.5, 0.4], + # [0.5, 0.3, 0.1, 0.2, 0.4], + # [0.4, 0.3, 0.2, 0.5, 0.1]] + # ``` + CONCAT_EMBEDDING = 6 + end + end + + # Metadata of the prediction output to be explained. + # @!attribute [rw] index_display_name_mapping + # @return [::Google::Protobuf::Value] + # Static mapping between the index and display name. + # + # Use this if the outputs are a deterministic n-dimensional array, e.g. a + # list of scores of all the classes in a pre-defined order for a + # multi-classification Model. It's not feasible if the outputs are + # non-deterministic, e.g. the Model produces top-k classes or sort the + # outputs by their values. + # + # The shape of the value must be an n-dimensional array of strings. The + # number of dimensions must match that of the outputs to be explained. + # The + # {::Google::Cloud::AIPlatform::V1::Attribution#output_display_name Attribution.output_display_name} + # is populated by locating in the mapping with + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index Attribution.output_index}. + # @!attribute [rw] display_name_mapping_key + # @return [::String] + # Specify a field name in the prediction to look for the display name. + # + # Use this if the prediction contains the display names for the outputs. + # + # The display names in the prediction must have the same shape of the + # outputs, so that it can be located by + # {::Google::Cloud::AIPlatform::V1::Attribution#output_index Attribution.output_index} + # for a specific output. + # @!attribute [rw] output_tensor_name + # @return [::String] + # Name of the output tensor. Required and is only applicable to Vertex + # AI provided images for Tensorflow. + class OutputMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata] + class InputsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ExplanationMetadata::OutputMetadata] + class OutputsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature.rb new file mode 100644 index 000000000000..fe002e9ac2b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Feature Metadata information. + # For example, color is a feature that describes an apple. + # @!attribute [rw] name + # @return [::String] + # Immutable. Name of the Feature. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # + # The last part feature is assigned by the client. The feature can be up to + # 64 characters long and can consist only of ASCII Latin letters A-Z and a-z, + # underscore(_), and ASCII digits 0-9 starting with a letter. The value will + # be unique given an entity type. + # @!attribute [rw] description + # @return [::String] + # Description of the Feature. + # @!attribute [rw] value_type + # @return [::Google::Cloud::AIPlatform::V1::Feature::ValueType] + # Immutable. Only applicable for Vertex AI Feature Store (Legacy). + # Type of Feature value. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Only applicable for Vertex AI Feature Store (Legacy). + # Timestamp when this EntityType was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Only applicable for Vertex AI Feature Store (Legacy). + # Timestamp when this EntityType was most recently updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your Features. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one Feature (System + # labels are excluded)." + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] etag + # @return [::String] + # Used to perform a consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] disable_monitoring + # @return [::Boolean] + # Optional. Only applicable for Vertex AI Feature Store (Legacy). + # If not set, use the monitoring_config defined for the EntityType this + # Feature belongs to. + # Only Features with type + # ({::Google::Cloud::AIPlatform::V1::Feature::ValueType Feature.ValueType}) BOOL, + # STRING, DOUBLE or INT64 can enable monitoring. + # + # If set to true, all types of data monitoring are disabled despite the + # config on EntityType. + # @!attribute [r] monitoring_stats_anomalies + # @return [::Array<::Google::Cloud::AIPlatform::V1::Feature::MonitoringStatsAnomaly>] + # Output only. Only applicable for Vertex AI Feature Store (Legacy). + # The list of historical stats and anomalies with specified objectives. + # @!attribute [rw] version_column_name + # @return [::String] + # Only applicable for Vertex AI Feature Store. + # The name of the BigQuery Table/View column hosting data for this version. + # If no value is provided, will use feature_id. + # @!attribute [rw] point_of_contact + # @return [::String] + # Entity responsible for maintaining this feature. Can be comma separated + # list of email addresses or URIs. + class Feature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A list of historical + # {::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::SnapshotAnalysis SnapshotAnalysis} + # or + # {::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ImportFeaturesAnalysis ImportFeaturesAnalysis} + # stats requested by user, sorted by + # {::Google::Cloud::AIPlatform::V1::FeatureStatsAnomaly#start_time FeatureStatsAnomaly.start_time} + # descending. + # @!attribute [r] objective + # @return [::Google::Cloud::AIPlatform::V1::Feature::MonitoringStatsAnomaly::Objective] + # Output only. The objective for each stats. + # @!attribute [r] feature_stats_anomaly + # @return [::Google::Cloud::AIPlatform::V1::FeatureStatsAnomaly] + # Output only. The stats and anomalies generated at specific timestamp. + class MonitoringStatsAnomaly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # If the objective in the request is both + # Import Feature Analysis and Snapshot Analysis, this objective could be + # one of them. Otherwise, this objective should be the same as the + # objective in the request. + module Objective + # If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty. + OBJECTIVE_UNSPECIFIED = 0 + + # Stats are generated by Import Feature Analysis. + IMPORT_FEATURE_ANALYSIS = 1 + + # Stats are generated by Snapshot Analysis. + SNAPSHOT_ANALYSIS = 2 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Only applicable for Vertex AI Legacy Feature Store. + # An enum representing the value type of a feature. + module ValueType + # The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0 + + # Used for Feature that is a boolean. + BOOL = 1 + + # Used for Feature that is a list of boolean. + BOOL_ARRAY = 2 + + # Used for Feature that is double. + DOUBLE = 3 + + # Used for Feature that is a list of double. + DOUBLE_ARRAY = 4 + + # Used for Feature that is INT64. + INT64 = 9 + + # Used for Feature that is a list of INT64. + INT64_ARRAY = 10 + + # Used for Feature that is string. + STRING = 11 + + # Used for Feature that is a list of String. + STRING_ARRAY = 12 + + # Used for Feature that is bytes. + BYTES = 13 + + # Used for Feature that is struct. + STRUCT = 14 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_group.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_group.rb new file mode 100644 index 000000000000..d1d568c4ffb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_group.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Vertex AI Feature Group. + # @!attribute [rw] big_query + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup::BigQuery] + # Indicates that features for this group come from BigQuery Table/View. + # By default treats the source as a sparse time series source. The BigQuery + # source table or view must have at least one entity ID column and a column + # named `feature_timestamp`. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the FeatureGroup. Format: + # `projects/{project}/locations/{location}/featureGroups/{featureGroup}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureGroup was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureGroup was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # FeatureGroup. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one + # FeatureGroup(System labels are excluded)." System reserved label keys + # are prefixed with "aiplatform.googleapis.com/" and are immutable. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the FeatureGroup. + class FeatureGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Input source type for BigQuery Tables and Views. + # @!attribute [rw] big_query_source + # @return [::Google::Cloud::AIPlatform::V1::BigQuerySource] + # Required. Immutable. The BigQuery source URI that points to either a + # BigQuery Table or View. + # @!attribute [rw] entity_id_columns + # @return [::Array<::String>] + # Optional. Columns to construct entity_id / row keys. + # If not provided defaults to `entity_id`. + # @!attribute [rw] static_data_source + # @return [::Boolean] + # Optional. Set if the data source is not a time-series. + # @!attribute [rw] time_series + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup::BigQuery::TimeSeries] + # Optional. If the source is a time-series source, this can be set to + # control how downstream sources (ex: + # {::Google::Cloud::AIPlatform::V1::FeatureView FeatureView} ) will treat + # time-series sources. If not set, will treat the source as a time-series + # source with `feature_timestamp` as timestamp column and no scan boundary. + # @!attribute [rw] dense + # @return [::Boolean] + # Optional. If set, all feature values will be fetched + # from a single row per unique entityId including nulls. + # If not set, will collapse all rows for each unique entityId into a singe + # row with any non-null values if present, if no non-null values are + # present will sync null. + # ex: If source has schema + # `(entity_id, feature_timestamp, f0, f1)` and the following rows: + # `(e1, 2020-01-01T10:00:00.123Z, 10, 15)` + # `(e1, 2020-02-01T10:00:00.123Z, 20, null)` + # If dense is set, `(e1, 20, null)` is synced to online stores. If dense is + # not set, `(e1, 20, 15)` is synced to online stores. + class BigQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] timestamp_column + # @return [::String] + # Optional. Column hosting timestamp values for a time-series source. + # Will be used to determine the latest `feature_values` for each entity. + # Optional. If not provided, column named `feature_timestamp` of + # type `TIMESTAMP` will be used. + class TimeSeries + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_monitoring_stats.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_monitoring_stats.rb new file mode 100644 index 000000000000..3271b33f9796 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_monitoring_stats.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Stats and Anomaly generated at specific timestamp for specific Feature. + # The start_time and end_time are used to define the time range of the dataset + # that current stats belongs to, e.g. prediction traffic is bucketed into + # prediction datasets by time window. If the Dataset is not defined by time + # window, start_time = end_time. Timestamp of the stats and anomalies always + # refers to end_time. Raw stats and anomalies are stored in stats_uri or + # anomaly_uri in the tensorflow defined protos. Field data_stats contains + # almost identical information with the raw stats in Vertex AI + # defined proto, for UI to display. + # @!attribute [rw] score + # @return [::Float] + # Feature importance score, only populated when cross-feature monitoring is + # enabled. For now only used to represent feature attribution score within + # range [0, 1] for + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringObjectiveType::FEATURE_ATTRIBUTION_SKEW ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW} + # and + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringObjectiveType::FEATURE_ATTRIBUTION_DRIFT ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT}. + # @!attribute [rw] stats_uri + # @return [::String] + # Path of the stats file for current feature values in Cloud Storage bucket. + # Format: gs:////stats. + # Example: gs://monitoring_bucket/feature_name/stats. + # Stats are stored as binary format with Protobuf message + # [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto). + # @!attribute [rw] anomaly_uri + # @return [::String] + # Path of the anomaly file for current feature values in Cloud Storage + # bucket. + # Format: gs:////anomalies. + # Example: gs://monitoring_bucket/feature_name/anomalies. + # Stats are stored as binary format with Protobuf message + # Anoamlies are stored as binary format with Protobuf message + # [tensorflow.metadata.v0.AnomalyInfo] + # (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto). + # @!attribute [rw] distribution_deviation + # @return [::Float] + # Deviation from the current stats to baseline stats. + # 1. For categorical feature, the distribution distance is calculated by + # L-inifinity norm. + # 2. For numerical feature, the distribution distance is calculated by + # Jensen–Shannon divergence. + # @!attribute [rw] anomaly_detection_threshold + # @return [::Float] + # This is the threshold used when detecting anomalies. + # The threshold can be changed by user, so this one might be different from + # {::Google::Cloud::AIPlatform::V1::ThresholdConfig#value ThresholdConfig.value}. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start timestamp of window where stats were generated. + # For objectives where time window doesn't make sense (e.g. Featurestore + # Snapshot Monitoring), start_time is only used to indicate the monitoring + # intervals, so it always equals to (end_time - monitoring_interval). + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The end timestamp of window where stats were generated. + # For objectives where time window doesn't make sense (e.g. Featurestore + # Snapshot Monitoring), end_time indicates the timestamp of the data used to + # generate stats (e.g. timestamp we take snapshots for feature values). + class FeatureStatsAnomaly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb new file mode 100644 index 000000000000..03c58c26b47e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Vertex AI Feature Online Store provides a centralized repository for serving + # ML features and embedding indexes at low latency. The Feature Online Store is + # a top-level container. + # @!attribute [rw] bigtable + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore::Bigtable] + # Contains settings for the Cloud Bigtable instance that will be created + # to serve featureValues for all FeatureViews under this + # FeatureOnlineStore. + # @!attribute [rw] optimized + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore::Optimized] + # Contains settings for the Optimized store that will be created + # to serve featureValues for all FeatureViews under this + # FeatureOnlineStore. When choose Optimized storage type, need to set + # {::Google::Cloud::AIPlatform::V1::PrivateServiceConnectConfig#enable_private_service_connect PrivateServiceConnectConfig.enable_private_service_connect} + # to use private endpoint. Otherwise will use public endpoint by default. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the FeatureOnlineStore. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureOnlineStore was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureOnlineStore was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # FeatureOnlineStore. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one + # FeatureOnlineStore(System labels are excluded)." System reserved label keys + # are prefixed with "aiplatform.googleapis.com/" and are immutable. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore::State] + # Output only. State of the featureOnlineStore. + # @!attribute [rw] dedicated_serving_endpoint + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore::DedicatedServingEndpoint] + # Optional. The dedicated serving endpoint for this FeatureOnlineStore, which + # is different from common Vertex service endpoint. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Optional. Customer-managed encryption key spec for data storage. If set, + # online store will be secured by this key. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class FeatureOnlineStore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] auto_scaling + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore::Bigtable::AutoScaling] + # Required. Autoscaling config applied to Bigtable Instance. + class Bigtable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] min_node_count + # @return [::Integer] + # Required. The minimum number of nodes to scale down to. Must be greater + # than or equal to 1. + # @!attribute [rw] max_node_count + # @return [::Integer] + # Required. The maximum number of nodes to scale up to. Must be greater + # than or equal to min_node_count, and less than or equal to 10 times of + # 'min_node_count'. + # @!attribute [rw] cpu_utilization_target + # @return [::Integer] + # Optional. A percentage of the cluster's CPU capacity. Can be from 10% + # to 80%. When a cluster's CPU utilization exceeds the target that you + # have set, Bigtable immediately adds nodes to the cluster. When CPU + # utilization is substantially lower than the target, Bigtable removes + # nodes. If not set will default to 50%. + class AutoScaling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Optimized storage type + class Optimized + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The dedicated serving endpoint for this FeatureOnlineStore. Only need to + # set when you choose Optimized storage type. Public endpoint is provisioned + # by default. + # @!attribute [r] public_endpoint_domain_name + # @return [::String] + # Output only. This field will be populated with the domain name to use for + # this FeatureOnlineStore + # @!attribute [rw] private_service_connect_config + # @return [::Google::Cloud::AIPlatform::V1::PrivateServiceConnectConfig] + # Optional. Private service connect config. The private service connection + # is available only for Optimized storage type, not for embedding + # management now. If + # {::Google::Cloud::AIPlatform::V1::PrivateServiceConnectConfig#enable_private_service_connect PrivateServiceConnectConfig.enable_private_service_connect} + # set to true, customers will use private service connection to send + # request. Otherwise, the connection will set to public endpoint. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The name of the service attachment resource. Populated if + # private service connect is enabled and after FeatureViewSync is created. + class DedicatedServingEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states a featureOnlineStore can have. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # State when the featureOnlineStore configuration is not being updated and + # the fields reflect the current configuration of the featureOnlineStore. + # The featureOnlineStore is usable in this state. + STABLE = 1 + + # The state of the featureOnlineStore configuration when it is being + # updated. During an update, the fields reflect either the original + # configuration or the updated configuration of the featureOnlineStore. The + # featureOnlineStore is still usable in this state. + UPDATING = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb new file mode 100644 index 000000000000..40714b955814 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb @@ -0,0 +1,470 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#create_feature_online_store FeatureOnlineStoreAdminService.CreateFeatureOnlineStore}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] feature_online_store + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # Required. The FeatureOnlineStore to create. + # @!attribute [rw] feature_online_store_id + # @return [::String] + # Required. The ID to use for this FeatureOnlineStore, which will become the + # final component of the FeatureOnlineStore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + class CreateFeatureOnlineStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#get_feature_online_store FeatureOnlineStoreAdminService.GetFeatureOnlineStore}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureOnlineStore resource. + class GetFeatureOnlineStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list FeatureOnlineStores. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the FeatureOnlineStores that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureOnlineStores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureOnlineStores with label "env" set to "prod". + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of FeatureOnlineStores to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureOnlineStores will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # 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` + class ListFeatureOnlineStoresRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_online_stores FeatureOnlineStoreAdminService.ListFeatureOnlineStores}. + # @!attribute [rw] feature_online_stores + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureOnlineStore>] + # The FeatureOnlineStores matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeatureOnlineStoresRequest#page_token ListFeatureOnlineStoresRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeatureOnlineStoresResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#update_feature_online_store FeatureOnlineStoreAdminService.UpdateFeatureOnlineStore}. + # @!attribute [rw] feature_online_store + # @return [::Google::Cloud::AIPlatform::V1::FeatureOnlineStore] + # Required. The FeatureOnlineStore's `name` field is used to identify the + # FeatureOnlineStore to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # FeatureOnlineStore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `bigtable` + # * `bigtable.auto_scaling` + # * `bigtable.enable_multi_region_replica` + class UpdateFeatureOnlineStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#delete_feature_online_store FeatureOnlineStoreAdminService.DeleteFeatureOnlineStore}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureOnlineStore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, any FeatureViews and Features for this FeatureOnlineStore + # will also be deleted. (Otherwise, the request will only work if the + # FeatureOnlineStore has no FeatureViews.) + class DeleteFeatureOnlineStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#create_feature_view FeatureOnlineStoreAdminService.CreateFeatureView}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the FeatureOnlineStore to create + # FeatureViews. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @!attribute [rw] feature_view + # @return [::Google::Cloud::AIPlatform::V1::FeatureView] + # Required. The FeatureView to create. + # @!attribute [rw] feature_view_id + # @return [::String] + # Required. The ID to use for the FeatureView, which will become the final + # component of the FeatureView's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a FeatureOnlineStore. + # @!attribute [rw] run_sync_immediately + # @return [::Boolean] + # Immutable. If set to true, one on demand sync will be run immediately, + # regardless whether the + # {::Google::Cloud::AIPlatform::V1::FeatureView#sync_config FeatureView.sync_config} + # is configured or not. + class CreateFeatureViewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#get_feature_view FeatureOnlineStoreAdminService.GetFeatureView}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureView resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + class GetFeatureViewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the FeatureOnlineStore to list FeatureViews. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}` + # @!attribute [rw] filter + # @return [::String] + # Lists the FeatureViews that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViews + # created or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> FeatureViews having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any FeatureView which has a label with 'env' as the + # key. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of FeatureViews to return. The service may return fewer + # than this value. If unspecified, at most 1000 FeatureViews will be + # returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `feature_view_id` + # * `create_time` + # * `update_time` + class ListFeatureViewsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_views FeatureOnlineStoreAdminService.ListFeatureViews}. + # @!attribute [rw] feature_views + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureView>] + # The FeatureViews matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewsRequest#page_token ListFeatureViewsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeatureViewsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#update_feature_view FeatureOnlineStoreAdminService.UpdateFeatureView}. + # @!attribute [rw] feature_view + # @return [::Google::Cloud::AIPlatform::V1::FeatureView] + # Required. The FeatureView's `name` field is used to identify the + # FeatureView to be updated. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # FeatureView resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `service_agent_type` + # * `big_query_source` + # * `big_query_source.uri` + # * `big_query_source.entity_id_columns` + # * `feature_registry_source` + # * `feature_registry_source.feature_groups` + # * `sync_config` + # * `sync_config.cron` + # * `optimized_config.automatic_resources` + class UpdateFeatureViewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#delete_feature_view FeatureOnlineStoreAdminService.DeleteFeatureView}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureView to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + class DeleteFeatureViewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create FeatureOnlineStore. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureOnlineStore. + class CreateFeatureOnlineStoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update FeatureOnlineStore. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureOnlineStore. + class UpdateFeatureOnlineStoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create FeatureView. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureView Create. + class CreateFeatureViewOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update FeatureView. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureView Update. + class UpdateFeatureViewOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#sync_feature_view FeatureOnlineStoreAdminService.SyncFeatureView}. + # @!attribute [rw] feature_view + # @return [::String] + # Required. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + class SyncFeatureViewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#sync_feature_view FeatureOnlineStoreAdminService.SyncFeatureView}. + # @!attribute [rw] feature_view_sync + # @return [::String] + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` + class SyncFeatureViewResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#get_feature_view_sync FeatureOnlineStoreAdminService.GetFeatureViewSync}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureViewSync resource. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` + class GetFeatureViewSyncRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the FeatureView to list FeatureViewSyncs. + # Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @!attribute [rw] filter + # @return [::String] + # Lists the FeatureViewSyncs that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\"` --> FeatureViewSyncs + # created after 2020-01-31T15:30:00.000000Z. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of FeatureViewSyncs to return. The service may return + # fewer than this value. If unspecified, at most 1000 FeatureViewSyncs will + # be returned. The maximum value is 1000; any value greater than 1000 will be + # coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # 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` + class ListFeatureViewSyncsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client#list_feature_view_syncs FeatureOnlineStoreAdminService.ListFeatureViewSyncs}. + # @!attribute [rw] feature_view_syncs + # @return [::Array<::Google::Cloud::Aiplatform::V1::FeatureViewSync>] + # The FeatureViewSyncs matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeatureViewSyncsRequest#page_token ListFeatureViewSyncsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeatureViewSyncsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb new file mode 100644 index 000000000000..3fedd62441c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb @@ -0,0 +1,314 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Lookup key for a feature view. + # @!attribute [rw] key + # @return [::String] + # String key to use for lookup. + # @!attribute [rw] composite_key + # @return [::Google::Cloud::AIPlatform::V1::FeatureViewDataKey::CompositeKey] + # The actual Entity ID will be composed from this struct. This should match + # with the way ID is defined in the FeatureView spec. + class FeatureViewDataKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # ID that is comprised from several parts (columns). + # @!attribute [rw] parts + # @return [::Array<::String>] + # Parts to construct Entity ID. Should match with the same ID columns as + # defined in FeatureView in the same order. + class CompositeKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client#fetch_feature_values FeatureOnlineStoreService.FetchFeatureValues}. + # All the features under the requested feature view will be returned. + # @!attribute [rw] feature_view + # @return [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @!attribute [rw] data_key + # @return [::Google::Cloud::AIPlatform::V1::FeatureViewDataKey] + # Optional. The request key to fetch feature values for. + # @!attribute [rw] data_format + # @return [::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat] + # Optional. Response data format. If not set, + # {::Google::Cloud::AIPlatform::V1::FeatureViewDataFormat::KEY_VALUE FeatureViewDataFormat.KEY_VALUE} + # will be used. + class FetchFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client#fetch_feature_values FeatureOnlineStoreService.FetchFeatureValues} + # @!attribute [rw] key_values + # @return [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse::FeatureNameValuePairList] + # Feature values in KeyValue format. + # @!attribute [rw] proto_struct + # @return [::Google::Protobuf::Struct] + # Feature values in proto Struct format. + # @!attribute [rw] data_key + # @return [::Google::Cloud::AIPlatform::V1::FeatureViewDataKey] + # The data key associated with this response. + # Will only be populated for + # [FeatureOnlineStoreService.StreamingFetchFeatureValues][] RPCs. + class FetchFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Response structure in the format of key (feature name) and (feature) value + # pair. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse::FeatureNameValuePairList::FeatureNameValuePair>] + # List of feature names and values. + class FeatureNameValuePairList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Feature name & value pair. + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::FeatureValue] + # Feature value. + # @!attribute [rw] name + # @return [::String] + # Feature short name. + class FeatureNameValuePair + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A query to find a number of similar entities. + # @!attribute [rw] entity_id + # @return [::String] + # Optional. The entity id whose similar entities should be searched for. + # If embedding is set, search will use embedding instead of + # entity_id. + # @!attribute [rw] embedding + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery::Embedding] + # Optional. The embedding vector that be used for similar search. + # @!attribute [rw] neighbor_count + # @return [::Integer] + # Optional. The number of similar entities to be retrieved from feature view + # for each query. + # @!attribute [rw] string_filters + # @return [::Array<::Google::Cloud::AIPlatform::V1::NearestNeighborQuery::StringFilter>] + # Optional. The list of string filters. + # @!attribute [rw] numeric_filters + # @return [::Array<::Google::Cloud::AIPlatform::V1::NearestNeighborQuery::NumericFilter>] + # Optional. The list of numeric filters. + # @!attribute [rw] per_crowding_attribute_neighbor_count + # @return [::Integer] + # Optional. Crowding is a constraint on a neighbor list produced by nearest + # neighbor search requiring that no more than + # sper_crowding_attribute_neighbor_count of the k neighbors returned have the + # same value of crowding_attribute. It's used for improving result diversity. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery::Parameters] + # Optional. Parameters that can be set to tune query on the fly. + class NearestNeighborQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The embedding vector. + # @!attribute [rw] value + # @return [::Array<::Float>] + # Optional. Individual value in the embedding. + class Embedding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # String filter is used to search a subset of the entities by using boolean + # rules on string columns. + # For example: if a query specifies string filter + # with 'name = color, allow_tokens = \\{red, blue}, deny_tokens = \\{purple}',' + # then that query will match entities that are red or blue, but if those + # points are also purple, then they will be excluded even if they are + # red/blue. Only string filter is supported for now, numeric filter will be + # supported in the near future. + # @!attribute [rw] name + # @return [::String] + # Required. Column names in BigQuery that used as filters. + # @!attribute [rw] allow_tokens + # @return [::Array<::String>] + # Optional. The allowed tokens. + # @!attribute [rw] deny_tokens + # @return [::Array<::String>] + # Optional. The denied tokens. + class StringFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Numeric filter is used to search a subset of the entities by using boolean + # rules on numeric columns. + # For example: + # Database Point 0: \\{name: “a” value_int: 42} \\{name: “b” value_float: 1.0} + # Database Point 1: \\{name: “a” value_int: 10} \\{name: “b” value_float: 2.0} + # Database Point 2: \\{name: “a” value_int: -1} \\{name: “b” value_float: 3.0} + # Query: \\{name: “a” value_int: 12 operator: LESS} // Matches Point 1, 2 + # \\{name: “b” value_float: 2.0 operator: EQUAL} // Matches Point 1 + # @!attribute [rw] value_int + # @return [::Integer] + # int value type. + # @!attribute [rw] value_float + # @return [::Float] + # float value type. + # @!attribute [rw] value_double + # @return [::Float] + # double value type. + # @!attribute [rw] name + # @return [::String] + # Required. Column name in BigQuery that used as filters. + # @!attribute [rw] op + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery::NumericFilter::Operator] + # Optional. This MUST be specified for queries and must NOT be specified + # for database points. + class NumericFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Datapoints for which Operator is true relative to the query’s Value + # field will be allowlisted. + module Operator + # Unspecified operator. + OPERATOR_UNSPECIFIED = 0 + + # Entities are eligible if their value is < the query's. + LESS = 1 + + # Entities are eligible if their value is <= the query's. + LESS_EQUAL = 2 + + # Entities are eligible if their value is == the query's. + EQUAL = 3 + + # Entities are eligible if their value is >= the query's. + GREATER_EQUAL = 4 + + # Entities are eligible if their value is > the query's. + GREATER = 5 + + # Entities are eligible if their value is != the query's. + NOT_EQUAL = 6 + end + end + + # Parameters that can be overrided in each query to tune query latency and + # recall. + # @!attribute [rw] approximate_neighbor_candidates + # @return [::Integer] + # Optional. The number of neighbors to find via approximate search before + # exact reordering is performed; if set, this value must be > + # neighbor_count. + # @!attribute [rw] leaf_nodes_search_fraction + # @return [::Float] + # Optional. The fraction of the number of leaves to search, set at query + # time allows user to tune search performance. This value increase result + # in both search accuracy and latency increase. The value should be between + # 0.0 and 1.0. + class Parameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client#search_nearest_entities FeatureOnlineStoreService.SearchNearestEntities}. + # @!attribute [rw] feature_view + # @return [::String] + # Required. FeatureView resource format + # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}` + # @!attribute [rw] query + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery] + # Required. The query. + # @!attribute [rw] return_full_entity + # @return [::Boolean] + # Optional. If set to true, the full entities (including all vector values + # and metadata) of the nearest neighbors are returned; otherwise only entity + # id of the nearest neighbors will be returned. Note that returning full + # entities will significantly increase the latency and cost of the query. + class SearchNearestEntitiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Nearest neighbors for one query. + # @!attribute [rw] neighbors + # @return [::Array<::Google::Cloud::AIPlatform::V1::NearestNeighbors::Neighbor>] + # All its neighbors. + class NearestNeighbors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A neighbor of the query vector. + # @!attribute [rw] entity_id + # @return [::String] + # The id of the similar entity. + # @!attribute [rw] distance + # @return [::Float] + # The distance between the neighbor and the query vector. + # @!attribute [rw] entity_key_values + # @return [::Google::Cloud::AIPlatform::V1::FetchFeatureValuesResponse] + # The attributes of the neighbor, e.g. filters, crowding and metadata + # Note that full entities are returned only when "return_full_entity" + # is set to true. Otherwise, only the "entity_id" and "distance" fields + # are populated. + class Neighbor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client#search_nearest_entities FeatureOnlineStoreService.SearchNearestEntities} + # @!attribute [rw] nearest_neighbors + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighbors] + # The nearest neighbors of the query entity. + class SearchNearestEntitiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Format of the data in the Feature View. + module FeatureViewDataFormat + # Not set. Will be treated as the KeyValue format. + FEATURE_VIEW_DATA_FORMAT_UNSPECIFIED = 0 + + # Return response data in key-value format. + KEY_VALUE = 1 + + # Return response data in proto Struct format. + PROTO_STRUCT = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb new file mode 100644 index 000000000000..41eabccc485f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#create_feature_group FeatureRegistryService.CreateFeatureGroup}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] feature_group + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # Required. The FeatureGroup to create. + # @!attribute [rw] feature_group_id + # @return [::String] + # Required. The ID to use for this FeatureGroup, which will become the final + # component of the FeatureGroup's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + class CreateFeatureGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#get_feature_group FeatureRegistryService.GetFeatureGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureGroup resource. + class GetFeatureGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list FeatureGroups. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the FeatureGroups that match the filter expression. The + # following fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # FeatureGroups created or updated after 2020-01-01. + # * `labels.env = "prod"` + # FeatureGroups with label "env" set to "prod". + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of FeatureGroups to return. The service may return + # fewer than this value. If unspecified, at most 100 FeatureGroups will + # be returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # 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` + class ListFeatureGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_feature_groups FeatureRegistryService.ListFeatureGroups}. + # @!attribute [rw] feature_groups + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureGroup>] + # The FeatureGroups matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeatureGroupsRequest#page_token ListFeatureGroupsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeatureGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#update_feature_group FeatureRegistryService.UpdateFeatureGroup}. + # @!attribute [rw] feature_group + # @return [::Google::Cloud::AIPlatform::V1::FeatureGroup] + # Required. The FeatureGroup's `name` field is used to identify the + # FeatureGroup to be updated. Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # FeatureGroup resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `description` + # * `big_query` + # * `big_query.entity_id_columns` + class UpdateFeatureGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#delete_feature_group FeatureRegistryService.DeleteFeatureGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the FeatureGroup to be deleted. + # Format: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, any Features under this FeatureGroup + # will also be deleted. (Otherwise, the request will only work if the + # FeatureGroup has no Features.) + class DeleteFeatureGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create FeatureGroup. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureGroup. + class CreateFeatureGroupOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update FeatureGroup. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for FeatureGroup. + class UpdateFeatureGroupOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create FeatureGroup. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Feature. + class CreateRegistryFeatureOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update Feature. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Feature Update. + class UpdateFeatureOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_selector.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_selector.rb new file mode 100644 index 000000000000..a19a9d5a0129 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_selector.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Matcher for Features of an EntityType by Feature ID. + # @!attribute [rw] ids + # @return [::Array<::String>] + # Required. The following are accepted as `ids`: + # + # * A single-element list containing only `*`, which selects all Features + # in the target EntityType, or + # * A list containing only Feature IDs, which selects only Features with + # those IDs in the target EntityType. + class IdMatcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Selector for Features of an EntityType. + # @!attribute [rw] id_matcher + # @return [::Google::Cloud::AIPlatform::V1::IdMatcher] + # Required. Matches Features based on ID. + class FeatureSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view.rb new file mode 100644 index 000000000000..3ec1a0e248b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view.rb @@ -0,0 +1,255 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # FeatureView is representation of values that the FeatureOnlineStore will + # serve based on its syncConfig. + # @!attribute [rw] big_query_source + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::BigQuerySource] + # Optional. Configures how data is supposed to be extracted from a BigQuery + # source to be loaded onto the FeatureOnlineStore. + # @!attribute [rw] feature_registry_source + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::FeatureRegistrySource] + # Optional. Configures the features from a Feature Registry source that + # need to be loaded onto the FeatureOnlineStore. + # @!attribute [rw] vertex_rag_source + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::VertexRagSource] + # Optional. The Vertex RAG Source that the FeatureView is linked to. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the FeatureView. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureView was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this FeatureView was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # FeatureViews. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one + # FeatureOnlineStore(System labels are excluded)." System reserved label keys + # are prefixed with "aiplatform.googleapis.com/" and are immutable. + # @!attribute [rw] sync_config + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::SyncConfig] + # Configures when data is to be synced/updated for this FeatureView. At the + # end of the sync the latest featureValues for each entityId of this + # FeatureView are made ready for online serving. + # @!attribute [rw] index_config + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::IndexConfig] + # Optional. Configuration for index preparation for vector search. It + # contains the required configurations to create an index from source data, + # so that approximate nearest neighbor (a.k.a ANN) algorithms search can be + # performed during online serving. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class FeatureView + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] uri + # @return [::String] + # Required. The BigQuery view URI that will be materialized on each sync + # trigger based on FeatureView.SyncConfig. + # @!attribute [rw] entity_id_columns + # @return [::Array<::String>] + # Required. Columns to construct entity_id / row keys. + class BigQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for Sync. Only one option is set. + # @!attribute [rw] cron + # @return [::String] + # Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled + # runs. To explicitly set a timezone to the cron tab, apply a prefix in + # the cron tab: "CRON_TZ=$\\{IANA_TIME_ZONE}" or "TZ=$\\{IANA_TIME_ZONE}". + # The $\\{IANA_TIME_ZONE} may only be a valid string from IANA time zone + # database. For example, "CRON_TZ=America/New_York 1 * * * *", or + # "TZ=America/New_York 1 * * * *". + # @!attribute [rw] continuous + # @return [::Boolean] + # Optional. If true, syncs the FeatureView in a continuous manner to Online + # Store. + class SyncConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for vector indexing. + # @!attribute [rw] tree_ah_config + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::IndexConfig::TreeAHConfig] + # Optional. Configuration options for the tree-AH algorithm (Shallow tree + # + Asymmetric Hashing). Please refer to this paper for more details: + # https://arxiv.org/abs/1908.10396 + # @!attribute [rw] brute_force_config + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::IndexConfig::BruteForceConfig] + # Optional. Configuration options for using brute force search, which + # simply implements the standard linear search in the database for each + # query. It is primarily meant for benchmarking and to generate the + # ground truth for approximate search. + # @!attribute [rw] embedding_column + # @return [::String] + # Optional. Column of embedding. This column contains the source data to + # create index for vector search. embedding_column must be set when using + # vector search. + # @!attribute [rw] filter_columns + # @return [::Array<::String>] + # Optional. Columns of features that're used to filter vector search + # results. + # @!attribute [rw] crowding_column + # @return [::String] + # Optional. Column of crowding. This column contains crowding attribute + # which is a constraint on a neighbor list produced by + # {::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client#search_nearest_entities FeatureOnlineStoreService.SearchNearestEntities} + # to diversify search results. If + # {::Google::Cloud::AIPlatform::V1::NearestNeighborQuery#per_crowding_attribute_neighbor_count NearestNeighborQuery.per_crowding_attribute_neighbor_count} + # is set to K in + # {::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest SearchNearestEntitiesRequest}, + # it's guaranteed that no more than K entities of the same crowding + # attribute are returned in the response. + # @!attribute [rw] embedding_dimension + # @return [::Integer] + # Optional. The number of dimensions of the input embedding. + # @!attribute [rw] distance_measure_type + # @return [::Google::Cloud::AIPlatform::V1::FeatureView::IndexConfig::DistanceMeasureType] + # Optional. The distance measure used in nearest neighbor search. + class IndexConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration options for using brute force search. + class BruteForceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration options for the tree-AH algorithm. + # @!attribute [rw] leaf_node_embedding_count + # @return [::Integer] + # Optional. Number of embeddings on each leaf node. The default value is + # 1000 if not set. + class TreeAHConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The distance measure used in nearest neighbor search. + module DistanceMeasureType + # Should not be set. + DISTANCE_MEASURE_TYPE_UNSPECIFIED = 0 + + # Euclidean (L_2) Distance. + SQUARED_L2_DISTANCE = 1 + + # Cosine Distance. Defined as 1 - cosine similarity. + # + # We strongly suggest using DOT_PRODUCT_DISTANCE + UNIT_L2_NORM instead + # of COSINE distance. Our algorithms have been more optimized for + # DOT_PRODUCT distance which, when combined with UNIT_L2_NORM, is + # mathematically equivalent to COSINE distance and results in the same + # ranking. + COSINE_DISTANCE = 2 + + # Dot Product Distance. Defined as a negative of the dot product. + DOT_PRODUCT_DISTANCE = 3 + end + end + + # A Feature Registry source for features that need to be synced to Online + # Store. + # @!attribute [rw] feature_groups + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureView::FeatureRegistrySource::FeatureGroup>] + # Required. List of features that need to be synced to Online Store. + # @!attribute [rw] project_number + # @return [::Integer] + # Optional. The project number of the parent project of the Feature Groups. + class FeatureRegistrySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Features belonging to a single feature group that will be + # synced to Online Store. + # @!attribute [rw] feature_group_id + # @return [::String] + # Required. Identifier of the feature group. + # @!attribute [rw] feature_ids + # @return [::Array<::String>] + # Required. Identifiers of features under the feature group. + class FeatureGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Vertex Rag source for features that need to be synced to Online + # Store. + # @!attribute [rw] uri + # @return [::String] + # Required. The BigQuery view/table URI that will be materialized on each + # manual sync trigger. The table/view is expected to have the following + # columns and types at least: + # - `corpus_id` (STRING, NULLABLE/REQUIRED) + # - `file_id` (STRING, NULLABLE/REQUIRED) + # - `chunk_id` (STRING, NULLABLE/REQUIRED) + # - `chunk_data_type` (STRING, NULLABLE/REQUIRED) + # - `chunk_data` (STRING, NULLABLE/REQUIRED) + # - `embeddings` (FLOAT, REPEATED) + # - `file_original_uri` (STRING, NULLABLE/REQUIRED) + # @!attribute [rw] rag_corpus_id + # @return [::Integer] + # Optional. The RAG corpus id corresponding to this FeatureView. + class VertexRagSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb new file mode 100644 index 000000000000..52baba41b047 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Aiplatform + module V1 + # FeatureViewSync is a representation of sync operation which copies data from + # data source to Feature View in Online Store. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the FeatureViewSync. Format: + # `projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/{feature_view_sync}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this FeatureViewSync is created. Creation of a + # FeatureViewSync means that the job is pending / waiting for sufficient + # resources but may not have started the actual data transfer yet. + # @!attribute [r] run_time + # @return [::Google::Type::Interval] + # Output only. Time when this FeatureViewSync is finished. + # @!attribute [r] final_status + # @return [::Google::Rpc::Status] + # Output only. Final status of the FeatureViewSync. + # @!attribute [r] sync_summary + # @return [::Google::Cloud::Aiplatform::V1::FeatureViewSync::SyncSummary] + # Output only. Summary of the sync job. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class FeatureViewSync + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Summary from the Sync job. For continuous syncs, the summary is updated + # periodically. For batch syncs, it gets updated on completion of the sync. + # @!attribute [r] row_synced + # @return [::Integer] + # Output only. Total number of rows synced. + # @!attribute [r] total_slot + # @return [::Integer] + # Output only. BigQuery slot milliseconds consumed for the sync job. + # @!attribute [rw] system_watermark_time + # @return [::Google::Protobuf::Timestamp] + # Lower bound of the system time watermark for the sync job. This is only + # set for continuously syncing feature views. + class SyncSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb new file mode 100644 index 000000000000..65d0ed768541 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Vertex AI Feature Store provides a centralized repository for organizing, + # storing, and serving ML features. The Featurestore is a top-level container + # for your features and their values. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the Featurestore. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Featurestore was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Featurestore was last updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize your + # Featurestore. + # + # 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 on and examples of labels. + # No more than 64 user labels can be associated with one Featurestore(System + # labels are excluded)." + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] online_serving_config + # @return [::Google::Cloud::AIPlatform::V1::Featurestore::OnlineServingConfig] + # Optional. Config for online storage resources. The field should not + # co-exist with the field of `OnlineStoreReplicationConfig`. If both of it + # and OnlineStoreReplicationConfig are unset, the feature store will not have + # an online store and cannot be used for online serving. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::Featurestore::State] + # Output only. State of the featurestore. + # @!attribute [rw] online_storage_ttl_days + # @return [::Integer] + # Optional. TTL in days for feature values that will be stored in online + # serving storage. The Feature Store online storage periodically removes + # obsolete feature values older than `online_storage_ttl_days` since the + # feature generation time. Note that `online_storage_ttl_days` should be less + # than or equal to `offline_storage_ttl_days` for each EntityType under a + # featurestore. If not set, default to 4000 days + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Optional. Customer-managed encryption key spec for data storage. If set, + # both of the online and offline data storage will be secured by this key. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Featurestore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # OnlineServingConfig specifies the details for provisioning online serving + # resources. + # @!attribute [rw] fixed_node_count + # @return [::Integer] + # The number of nodes for the online store. The number of nodes doesn't + # scale automatically, but you can manually update the number of + # nodes. If set to 0, the featurestore will not have an + # online store and cannot be used for online serving. + # @!attribute [rw] scaling + # @return [::Google::Cloud::AIPlatform::V1::Featurestore::OnlineServingConfig::Scaling] + # Online serving scaling configuration. + # Only one of `fixed_node_count` and `scaling` can be set. Setting one will + # reset the other. + class OnlineServingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Online serving scaling configuration. If min_node_count and + # max_node_count are set to the same value, the cluster will be configured + # with the fixed number of node (no auto-scaling). + # @!attribute [rw] min_node_count + # @return [::Integer] + # Required. The minimum number of nodes to scale down to. Must be greater + # than or equal to 1. + # @!attribute [rw] max_node_count + # @return [::Integer] + # The maximum number of nodes to scale up to. Must be greater than + # min_node_count, and less than or equal to 10 times of 'min_node_count'. + # @!attribute [rw] cpu_utilization_target + # @return [::Integer] + # Optional. The cpu utilization that the Autoscaler should be trying to + # achieve. This number is on a scale from 0 (no utilization) to 100 + # (total utilization), and is limited between 10 and 80. When a cluster's + # CPU utilization exceeds the target that you have set, Bigtable + # immediately adds nodes to the cluster. When CPU utilization is + # substantially lower than the target, Bigtable removes nodes. If not set + # or set to 0, default to 50. + class Scaling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states a featurestore can have. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # State when the featurestore configuration is not being updated and the + # fields reflect the current configuration of the featurestore. The + # featurestore is usable in this state. + STABLE = 1 + + # The state of the featurestore configuration when it is being updated. + # During an update, the fields reflect either the original configuration + # or the updated configuration of the featurestore. For example, + # `online_serving_config.fixed_node_count` can take minutes to update. + # While the update is in progress, the featurestore is in the UPDATING + # state, and the value of `fixed_node_count` can be the original value or + # the updated value, depending on the progress of the operation. Until the + # update completes, the actual number of nodes can still be the original + # value of `fixed_node_count`. The featurestore is still usable in this + # state. + UPDATING = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_monitoring.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_monitoring.rb new file mode 100644 index 000000000000..108defa06396 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_monitoring.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Configuration of how features in Featurestore are monitored. + # @!attribute [rw] snapshot_analysis + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::SnapshotAnalysis] + # The config for Snapshot Analysis Based Feature Monitoring. + # @!attribute [rw] import_features_analysis + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ImportFeaturesAnalysis] + # The config for ImportFeatures Analysis Based Feature Monitoring. + # @!attribute [rw] numerical_threshold_config + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ThresholdConfig] + # Threshold for numerical features of anomaly detection. + # This is shared by all objectives of Featurestore Monitoring for numerical + # features (i.e. Features with type + # ({::Google::Cloud::AIPlatform::V1::Feature::ValueType Feature.ValueType}) DOUBLE + # or INT64). + # @!attribute [rw] categorical_threshold_config + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ThresholdConfig] + # Threshold for categorical features of anomaly detection. + # This is shared by all types of Featurestore Monitoring for categorical + # features (i.e. Features with type + # ({::Google::Cloud::AIPlatform::V1::Feature::ValueType Feature.ValueType}) BOOL or + # STRING). + class FeaturestoreMonitoringConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the Featurestore's Snapshot Analysis Based Monitoring. + # This type of analysis generates statistics for each Feature based on a + # snapshot of the latest feature value of each entities every + # monitoring_interval. + # @!attribute [rw] disabled + # @return [::Boolean] + # The monitoring schedule for snapshot analysis. + # For EntityType-level config: + # unset / disabled = true indicates disabled by + # default for Features under it; otherwise by default enable snapshot + # analysis monitoring with monitoring_interval for Features under it. + # Feature-level config: + # disabled = true indicates disabled regardless of the EntityType-level + # config; unset monitoring_interval indicates going with EntityType-level + # config; otherwise run snapshot analysis monitoring with + # monitoring_interval regardless of the EntityType-level config. + # Explicitly Disable the snapshot analysis based monitoring. + # @!attribute [rw] monitoring_interval_days + # @return [::Integer] + # Configuration of the snapshot analysis based monitoring pipeline + # running interval. The value indicates number of days. + # @!attribute [rw] staleness_days + # @return [::Integer] + # Customized export features time window for snapshot analysis. Unit is one + # day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is + # 4000 days. + class SnapshotAnalysis + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of the Featurestore's ImportFeature Analysis Based + # Monitoring. This type of analysis generates statistics for values of each + # Feature imported by every + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#import_feature_values ImportFeatureValues} + # operation. + # @!attribute [rw] state + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ImportFeaturesAnalysis::State] + # Whether to enable / disable / inherite default hebavior for import + # features analysis. + # @!attribute [rw] anomaly_detection_baseline + # @return [::Google::Cloud::AIPlatform::V1::FeaturestoreMonitoringConfig::ImportFeaturesAnalysis::Baseline] + # The baseline used to do anomaly detection for the statistics generated by + # import features analysis. + class ImportFeaturesAnalysis + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state defines whether to enable ImportFeature analysis. + module State + # Should not be used. + STATE_UNSPECIFIED = 0 + + # The default behavior of whether to enable the monitoring. + # EntityType-level config: disabled. + # Feature-level config: inherited from the configuration of EntityType + # this Feature belongs to. + DEFAULT = 1 + + # Explicitly enables import features analysis. + # EntityType-level config: by default enables import features analysis + # for all Features under it. Feature-level config: enables import + # features analysis regardless of the EntityType-level config. + ENABLED = 2 + + # Explicitly disables import features analysis. + # EntityType-level config: by default disables import features analysis + # for all Features under it. Feature-level config: disables import + # features analysis regardless of the EntityType-level config. + DISABLED = 3 + end + + # Defines the baseline to do anomaly detection for feature values imported + # by each + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#import_feature_values ImportFeatureValues} + # operation. + module Baseline + # Should not be used. + BASELINE_UNSPECIFIED = 0 + + # Choose the later one statistics generated by either most recent + # snapshot analysis or previous import features analysis. If non of them + # exists, skip anomaly detection and only generate a statistics. + LATEST_STATS = 1 + + # Use the statistics generated by the most recent snapshot analysis if + # exists. + MOST_RECENT_SNAPSHOT_STATS = 2 + + # Use the statistics generated by the previous import features analysis + # if exists. + PREVIOUS_IMPORT_FEATURES_STATS = 3 + end + end + + # The config for Featurestore Monitoring threshold. + # @!attribute [rw] value + # @return [::Float] + # Specify a threshold value that can trigger the alert. + # 1. For categorical feature, the distribution distance is calculated by + # L-inifinity norm. + # 2. For numerical feature, the distribution distance is calculated by + # Jensen–Shannon divergence. Each feature must have a non-zero threshold + # if they need to be monitored. Otherwise no alert will be triggered for + # that feature. + class ThresholdConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb new file mode 100644 index 000000000000..fca2e80d8175 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb @@ -0,0 +1,281 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#write_feature_values FeaturestoreOnlineServingService.WriteFeatureValues}. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the EntityType for the entities being + # written. Value format: + # `projects/{project}/locations/{location}/featurestores/ + # \\{featurestore}/entityTypes/\\{entityType}`. For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @!attribute [rw] payloads + # @return [::Array<::Google::Cloud::AIPlatform::V1::WriteFeatureValuesPayload>] + # Required. The entities to be written. Up to 100,000 feature values can be + # written across all `payloads`. + class WriteFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains Feature values to be written for a specific entity. + # @!attribute [rw] entity_id + # @return [::String] + # Required. The ID of the entity. + # @!attribute [rw] feature_values + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::FeatureValue}] + # Required. Feature values to be written, mapping from Feature ID to value. + # Up to 100,000 `feature_values` entries may be written across all payloads. + # The feature generation time, aligned by days, must be no older than five + # years (1825 days) and no later than one year (366 days) in the future. + class WriteFeatureValuesPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::FeatureValue] + class FeatureValuesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#write_feature_values FeaturestoreOnlineServingService.WriteFeatureValues}. + class WriteFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#read_feature_values FeaturestoreOnlineServingService.ReadFeatureValues}. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the EntityType for the entity being read. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, for a machine learning model predicting user clicks on a + # website, an EntityType ID could be `user`. + # @!attribute [rw] entity_id + # @return [::String] + # Required. ID for a specific entity. For example, + # for a machine learning model predicting user clicks on a website, an entity + # ID could be `user_123`. + # @!attribute [rw] feature_selector + # @return [::Google::Cloud::AIPlatform::V1::FeatureSelector] + # Required. Selector choosing Features of the target EntityType. + class ReadFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#read_feature_values FeaturestoreOnlineServingService.ReadFeatureValues}. + # @!attribute [rw] header + # @return [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse::Header] + # Response header. + # @!attribute [rw] entity_view + # @return [::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse::EntityView] + # Entity view with Feature values. This may be the entity in the + # Featurestore if values for all Features were requested, or a projection + # of the entity in the Featurestore if values for only some Features were + # requested. + class ReadFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata for requested Features. + # @!attribute [rw] id + # @return [::String] + # Feature ID. + class FeatureDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response header with metadata for the requested + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest#entity_type ReadFeatureValuesRequest.entity_type} + # and Features. + # @!attribute [rw] entity_type + # @return [::String] + # The resource name of the EntityType from the + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest ReadFeatureValuesRequest}. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # @!attribute [rw] feature_descriptors + # @return [::Array<::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse::FeatureDescriptor>] + # List of Feature metadata corresponding to each piece of + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse::EntityView#data ReadFeatureValuesResponse.EntityView.data}. + class Header + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Entity view with Feature values. + # @!attribute [rw] entity_id + # @return [::String] + # ID of the requested entity. + # @!attribute [rw] data + # @return [::Array<::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse::EntityView::Data>] + # Each piece of data holds the k + # requested values for one requested Feature. If no values + # for the requested Feature exist, the corresponding cell will be empty. + # This has the same size and is in the same order as the features from the + # header + # {::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse#header ReadFeatureValuesResponse.header}. + class EntityView + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Container to hold value(s), successive in time, for one Feature from the + # request. + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::FeatureValue] + # Feature value if a single value is requested. + # @!attribute [rw] values + # @return [::Google::Cloud::AIPlatform::V1::FeatureValueList] + # Feature values list if values, successive in time, are requested. + # If the requested number of values is greater than the number of + # existing Feature values, nonexistent values are omitted instead of + # being returned as empty. + class Data + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#streaming_read_feature_values FeaturestoreOnlineServingService.StreamingReadFeatureValues}. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the entities' type. + # Value format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + # For example, + # for a machine learning model predicting user clicks on a website, an + # EntityType ID could be `user`. + # @!attribute [rw] entity_ids + # @return [::Array<::String>] + # Required. IDs of entities to read Feature values of. The maximum number of + # IDs is 100. For example, for a machine learning model predicting user + # clicks on a website, an entity ID could be `user_123`. + # @!attribute [rw] feature_selector + # @return [::Google::Cloud::AIPlatform::V1::FeatureSelector] + # Required. Selector choosing Features of the target EntityType. Feature IDs + # will be deduplicated. + class StreamingReadFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Value for a feature. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Bool type feature value. + # @!attribute [rw] double_value + # @return [::Float] + # Double type feature value. + # @!attribute [rw] int64_value + # @return [::Integer] + # Int64 feature value. + # @!attribute [rw] string_value + # @return [::String] + # String feature value. + # @!attribute [rw] bool_array_value + # @return [::Google::Cloud::AIPlatform::V1::BoolArray] + # A list of bool type feature value. + # @!attribute [rw] double_array_value + # @return [::Google::Cloud::AIPlatform::V1::DoubleArray] + # A list of double type feature value. + # @!attribute [rw] int64_array_value + # @return [::Google::Cloud::AIPlatform::V1::Int64Array] + # A list of int64 type feature value. + # @!attribute [rw] string_array_value + # @return [::Google::Cloud::AIPlatform::V1::StringArray] + # A list of string type feature value. + # @!attribute [rw] bytes_value + # @return [::String] + # Bytes feature value. + # @!attribute [rw] struct_value + # @return [::Google::Cloud::AIPlatform::V1::StructValue] + # A struct type feature value. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::FeatureValue::Metadata] + # Metadata of feature value. + class FeatureValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata of feature value. + # @!attribute [rw] generate_time + # @return [::Google::Protobuf::Timestamp] + # Feature generation timestamp. Typically, it is provided by user at + # feature ingestion time. If not, feature store + # will use the system timestamp when the data is ingested into feature + # store. For streaming ingestion, the time, aligned by days, must be no + # older than five years (1825 days) and no later than one year (366 days) + # in the future. + class Metadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Struct (or object) type feature value. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::AIPlatform::V1::StructFieldValue>] + # A list of field values. + class StructValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One field of a Struct (or object) type feature value. + # @!attribute [rw] name + # @return [::String] + # Name of the field in the struct feature. + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::FeatureValue] + # The value for this field. + class StructFieldValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Container for list of values. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureValue>] + # A list of feature values. All of them should be the same data type. + class FeatureValueList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb new file mode 100644 index 000000000000..088ec100328e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb @@ -0,0 +1,1201 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_featurestore FeaturestoreService.CreateFeaturestore}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] featurestore + # @return [::Google::Cloud::AIPlatform::V1::Featurestore] + # Required. The Featurestore to create. + # @!attribute [rw] featurestore_id + # @return [::String] + # Required. The ID to use for this Featurestore, which will become the final + # component of the Featurestore's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within the project and location. + class CreateFeaturestoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_featurestore FeaturestoreService.GetFeaturestore}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Featurestore resource. + class GetFeaturestoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list Featurestores. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the featurestores that match the filter expression. The following + # fields are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be + # in RFC 3339 format. + # * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + # `<=`, and `>=` comparisons. + # * `labels`: Supports key-value equality and key presence. + # + # Examples: + # + # * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + # Featurestores created or updated after 2020-01-01. + # * `labels.env = "prod"` + # Featurestores with label "env" set to "prod". + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Featurestores to return. The service may return fewer + # than this value. If unspecified, at most 100 Featurestores will be + # returned. The maximum value is 100; any value greater than 100 will be + # coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # 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` + # * `online_serving_config.fixed_node_count` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListFeaturestoresRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores FeaturestoreService.ListFeaturestores}. + # @!attribute [rw] featurestores + # @return [::Array<::Google::Cloud::AIPlatform::V1::Featurestore>] + # The Featurestores matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest#page_token ListFeaturestoresRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeaturestoresResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_featurestore FeaturestoreService.UpdateFeaturestore}. + # @!attribute [rw] featurestore + # @return [::Google::Cloud::AIPlatform::V1::Featurestore] + # Required. The Featurestore's `name` field is used to identify the + # Featurestore to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Featurestore resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `labels` + # * `online_serving_config.fixed_node_count` + # * `online_serving_config.scaling` + # * `online_storage_ttl_days` + class UpdateFeaturestoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_featurestore FeaturestoreService.DeleteFeaturestore}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Featurestore to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, any EntityTypes and Features for this Featurestore will + # also be deleted. (Otherwise, the request will only work if the Featurestore + # has no EntityTypes.) + class DeleteFeaturestoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#import_feature_values FeaturestoreService.ImportFeatureValues}. + # @!attribute [rw] avro_source + # @return [::Google::Cloud::AIPlatform::V1::AvroSource] + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::AIPlatform::V1::BigQuerySource] + # @!attribute [rw] csv_source + # @return [::Google::Cloud::AIPlatform::V1::CsvSource] + # @!attribute [rw] feature_time_field + # @return [::String] + # Source column that holds the Feature timestamp for all Feature + # values in each entity. + # @!attribute [rw] feature_time + # @return [::Google::Protobuf::Timestamp] + # Single Feature timestamp for all entities being imported. The + # timestamp must not have higher than millisecond precision. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being imported. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + # @!attribute [rw] entity_id_field + # @return [::String] + # Source column that holds entity IDs. If not provided, entity IDs are + # extracted from the column named entity_id. + # @!attribute [rw] feature_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest::FeatureSpec>] + # Required. Specifications defining which Feature values to import from the + # entity. The request fails if no feature_specs are provided, and having + # multiple feature_specs for one Feature is not allowed. + # @!attribute [rw] disable_online_serving + # @return [::Boolean] + # If set, data will not be imported for online serving. This + # is typically used for backfilling, where Feature generation timestamps are + # not in the timestamp range needed for online serving. + # @!attribute [rw] worker_count + # @return [::Integer] + # Specifies the number of workers that are used to write data to the + # Featurestore. Consider the online serving capacity that you require to + # achieve the desired import throughput without interfering with online + # serving. The value must be positive, and less than or equal to 100. + # If not set, defaults to using 1 worker. The low count ensures minimal + # impact on online serving performance. + # @!attribute [rw] disable_ingestion_analysis + # @return [::Boolean] + # If true, API doesn't start ingestion analysis pipeline. + class ImportFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the Feature value(s) to import. + # @!attribute [rw] id + # @return [::String] + # Required. ID of the Feature to import values of. This Feature must exist + # in the target EntityType, or the request will fail. + # @!attribute [rw] source_field + # @return [::String] + # Source column to get the Feature values from. If not set, uses the column + # with the same name as the Feature ID. + class FeatureSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#import_feature_values FeaturestoreService.ImportFeatureValues}. + # @!attribute [rw] imported_entity_count + # @return [::Integer] + # Number of entities that have been imported by the operation. + # @!attribute [rw] imported_feature_value_count + # @return [::Integer] + # Number of Feature values that have been imported by the operation. + # @!attribute [rw] invalid_row_count + # @return [::Integer] + # The number of rows in input source that weren't imported due to either + # * Not having any featureValues. + # * Having a null entityId. + # * Having a null timestamp. + # * Not being parsable (applicable for CSV sources). + # @!attribute [rw] timestamp_outside_retention_rows_count + # @return [::Integer] + # The number rows that weren't ingested due to having feature timestamps + # outside the retention boundary. + class ImportFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_read_feature_values FeaturestoreService.BatchReadFeatureValues}. + # @!attribute [rw] csv_read_instances + # @return [::Google::Cloud::AIPlatform::V1::CsvSource] + # Each read instance consists of exactly one read timestamp and one or more + # entity IDs identifying entities of the corresponding EntityTypes whose + # Features are requested. + # + # Each output instance contains Feature values of requested entities + # concatenated together as of the read time. + # + # An example read instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z`. + # + # An example output instance may be `foo_entity_id, bar_entity_id, + # 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + # bar_entity_feature2_value`. + # + # Timestamp in each read instance must be millisecond-aligned. + # + # `csv_read_instances` are read instances stored in a plain-text CSV file. + # The header should be: + # [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + # + # The columns can be in any order. + # + # Values in the timestamp column must use the RFC 3339 format, e.g. + # `2012-07-30T10:43:17.123Z`. + # @!attribute [rw] bigquery_read_instances + # @return [::Google::Cloud::AIPlatform::V1::BigQuerySource] + # Similar to csv_read_instances, but from BigQuery source. + # @!attribute [rw] featurestore + # @return [::String] + # Required. The resource name of the Featurestore from which to query Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [rw] destination + # @return [::Google::Cloud::AIPlatform::V1::FeatureValueDestination] + # Required. Specifies output location and format. + # @!attribute [rw] pass_through_fields + # @return [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::PassThroughField>] + # When not empty, the specified fields in the *_read_instances source will be + # joined as-is in the output, in addition to those fields from the + # Featurestore Entity. + # + # For BigQuery source, the type of the pass-through values will be + # automatically inferred. For CSV source, the pass-through values will be + # passed as opaque bytes. + # @!attribute [rw] entity_type_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::EntityTypeSpec>] + # Required. Specifies EntityType grouping Features to read values of and + # settings. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Excludes Feature values with feature generation timestamp before + # this timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. + class BatchReadFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describe pass-through fields in read_instance source. + # @!attribute [rw] field_name + # @return [::String] + # Required. The name of the field in the CSV header or the name of the + # column in BigQuery table. The naming restriction is the same as + # {::Google::Cloud::AIPlatform::V1::Feature#name Feature.name}. + class PassThroughField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Selects Features of an EntityType to read values of and specifies read + # settings. + # @!attribute [rw] entity_type_id + # @return [::String] + # Required. ID of the EntityType to select Features. The EntityType id is + # the + # {::Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest#entity_type_id entity_type_id} + # specified during EntityType creation. + # @!attribute [rw] feature_selector + # @return [::Google::Cloud::AIPlatform::V1::FeatureSelector] + # Required. Selectors choosing which Feature values to read from the + # EntityType. + # @!attribute [rw] settings + # @return [::Array<::Google::Cloud::AIPlatform::V1::DestinationFeatureSetting>] + # Per-Feature settings for the batch read. + class EntityTypeSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#export_feature_values FeaturestoreService.ExportFeatureValues}. + # @!attribute [rw] snapshot_export + # @return [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::SnapshotExport] + # Exports the latest Feature values of all entities of the EntityType + # within a time range. + # @!attribute [rw] full_export + # @return [::Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest::FullExport] + # Exports all historical values of all entities of the EntityType within a + # time range + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the EntityType from which to export Feature + # values. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @!attribute [rw] destination + # @return [::Google::Cloud::AIPlatform::V1::FeatureValueDestination] + # Required. Specifies destination location and format. + # @!attribute [rw] feature_selector + # @return [::Google::Cloud::AIPlatform::V1::FeatureSelector] + # Required. Selects Features to export values of. + # @!attribute [rw] settings + # @return [::Array<::Google::Cloud::AIPlatform::V1::DestinationFeatureSetting>] + # Per-Feature export settings. + class ExportFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes exporting the latest Feature values of all entities of the + # EntityType between [start_time, snapshot_time]. + # @!attribute [rw] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # Exports Feature values as of this timestamp. If not set, + # retrieve values as of now. Timestamp, if present, must not have higher + # than millisecond precision. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Excludes Feature values with feature generation timestamp before this + # timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. + class SnapshotExport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes exporting all historical Feature values of all entities of the + # EntityType between [start_time, end_time]. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Excludes Feature values with feature generation timestamp before this + # timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Exports Feature values as of this timestamp. If not set, + # retrieve values as of now. Timestamp, if present, must not have higher + # than millisecond precision. + class FullExport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] feature_id + # @return [::String] + # Required. The ID of the Feature to apply the setting to. + # @!attribute [rw] destination_field + # @return [::String] + # Specify the field name in the export destination. If not specified, + # Feature ID is used. + class DestinationFeatureSetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A destination location for Feature values and format. + # @!attribute [rw] bigquery_destination + # @return [::Google::Cloud::AIPlatform::V1::BigQueryDestination] + # Output in BigQuery format. + # {::Google::Cloud::AIPlatform::V1::BigQueryDestination#output_uri BigQueryDestination.output_uri} + # in + # {::Google::Cloud::AIPlatform::V1::FeatureValueDestination#bigquery_destination FeatureValueDestination.bigquery_destination} + # must refer to a table. + # @!attribute [rw] tfrecord_destination + # @return [::Google::Cloud::AIPlatform::V1::TFRecordDestination] + # Output in TFRecord format. + # + # Below are the mapping from Feature value type + # in Featurestore to Feature value type in TFRecord: + # + # Value type in Featurestore | Value type in TFRecord + # DOUBLE, DOUBLE_ARRAY | FLOAT_LIST + # INT64, INT64_ARRAY | INT64_LIST + # STRING, STRING_ARRAY, BYTES | BYTES_LIST + # true -> byte_string("true"), false -> byte_string("false") + # BOOL, BOOL_ARRAY (true, false) | BYTES_LIST + # @!attribute [rw] csv_destination + # @return [::Google::Cloud::AIPlatform::V1::CsvDestination] + # Output in CSV format. Array Feature value types are not allowed in CSV + # format. + class FeatureValueDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#export_feature_values FeaturestoreService.ExportFeatureValues}. + class ExportFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_read_feature_values FeaturestoreService.BatchReadFeatureValues}. + class BatchReadFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_entity_type FeaturestoreService.CreateEntityType}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Featurestore to create EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [rw] entity_type + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # The EntityType to create. + # @!attribute [rw] entity_type_id + # @return [::String] + # Required. The ID to use for the EntityType, which will become the final + # component of the EntityType's resource name. + # + # This value may be up to 60 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within a featurestore. + class CreateEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_entity_type FeaturestoreService.GetEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the EntityType resource. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + class GetEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Featurestore to list EntityTypes. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}` + # @!attribute [rw] filter + # @return [::String] + # Lists the EntityTypes that match the filter expression. The following + # filters are supported: + # + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any EntityType which has a label with 'env' as the + # key. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of EntityTypes to return. The service may return fewer + # than this value. If unspecified, at most 1000 EntityTypes will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # + # Supported fields: + # + # * `entity_type_id` + # * `create_time` + # * `update_time` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types FeaturestoreService.ListEntityTypes}. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::AIPlatform::V1::EntityType>] + # The EntityTypes matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListEntityTypesRequest#page_token ListEntityTypesRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_entity_type FeaturestoreService.UpdateEntityType}. + # @!attribute [rw] entity_type + # @return [::Google::Cloud::AIPlatform::V1::EntityType] + # Required. The EntityType's `name` field is used to identify the EntityType + # to be updated. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # EntityType resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `monitoring_config.snapshot_analysis.disabled` + # * `monitoring_config.snapshot_analysis.monitoring_interval_days` + # * `monitoring_config.snapshot_analysis.staleness_days` + # * `monitoring_config.import_features_analysis.state` + # * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + # * `monitoring_config.numerical_threshold_config.value` + # * `monitoring_config.categorical_threshold_config.value` + # * `offline_storage_ttl_days` + class UpdateEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_entity_type FeaturestoreService.DeleteEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the EntityType to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, any Features for this EntityType will also be deleted. + # (Otherwise, the request will only work if the EntityType has no Features.) + class DeleteEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_feature FeaturestoreService.CreateFeature}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#create_feature FeatureRegistryService.CreateFeature}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the EntityType or FeatureGroup to create a + # Feature. Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @!attribute [rw] feature + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # Required. The Feature to create. + # @!attribute [rw] feature_id + # @return [::String] + # Required. The ID to use for the Feature, which will become the final + # component of the Feature's resource name. + # + # This value may be up to 128 characters, and valid characters are + # `[a-z0-9_]`. The first character cannot be a number. + # + # The value must be unique within an EntityType/FeatureGroup. + class CreateFeatureRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_create_features FeaturestoreService.BatchCreateFeatures}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#batch_create_features FeatureRegistryService.BatchCreateFeatures}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the EntityType/FeatureGroup to create the + # batch of Features under. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::AIPlatform::V1::CreateFeatureRequest>] + # Required. The request message specifying the Features to create. All + # Features must be created under the same parent EntityType / FeatureGroup. + # The `parent` field in each child request message can be omitted. If + # `parent` is set in a child request, then the value must match the `parent` + # value in this request message. + class BatchCreateFeaturesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_create_features FeaturestoreService.BatchCreateFeatures}. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::AIPlatform::V1::Feature>] + # The Features created. + class BatchCreateFeaturesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_feature FeaturestoreService.GetFeature}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#get_feature FeatureRegistryService.GetFeature}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Feature resource. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + class GetFeatureRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list Features. + # Format for entity_type as parent: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + # Format for feature_group as parent: + # `projects/{project}/locations/{location}/featureGroups/{feature_group}` + # @!attribute [rw] filter + # @return [::String] + # Lists the Features that match the filter expression. The following + # filters are supported: + # + # * `value_type`: Supports = and != comparisons. + # * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + # be in RFC 3339 format. + # * `labels`: Supports key-value equality as well as key presence. + # + # Examples: + # + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + # update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + # or updated after 2020-01-31T15:30:00.000000Z. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with 'env' as the + # key. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 1000 Features will be returned. + # The maximum value is 1000; any value greater than 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # call or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures} + # or + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `feature_id` + # * `value_type` (Not supported for FeatureRegistry Feature) + # * `create_time` + # * `update_time` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] latest_stats_count + # @return [::Integer] + # Only applicable for Vertex AI Feature Store (Legacy). + # If set, return the most recent + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count} + # of stats for each Feature in response. Valid value is [0, 10]. If number of + # stats exists < + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#latest_stats_count ListFeaturesRequest.latest_stats_count}, + # return all existing stats. + class ListFeaturesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures}. + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures}. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::AIPlatform::V1::Feature>] + # The Features matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListFeaturesRequest#page_token ListFeaturesRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListFeaturesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures}. + # @!attribute [rw] location + # @return [::String] + # Required. The resource name of the Location to search Features. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] query + # @return [::String] + # Query string that is a conjunction of field-restricted queries and/or + # field-restricted filters. Field-restricted queries and filters can be + # combined using `AND` to form a conjunction. + # + # A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + # exists as a substring within Feature's FIELD. The QUERY + # and the FIELD are converted to a sequence of words (i.e. tokens) for + # comparison. This is done by: + # + # * Removing leading/trailing whitespace and tokenizing the search value. + # Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + # `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + # as a wildcard that matches characters within a token. + # * Ignoring case. + # * Prepending an asterisk to the first and appending an asterisk to the + # last token in QUERY. + # + # A QUERY must be either a singular token or a phrase. A phrase is one or + # multiple words enclosed in double quotation marks ("). With phrases, the + # order of the words is important. Words in the phrase must be matching in + # order and consecutively. + # + # Supported FIELDs for field-restricted queries: + # + # * `feature_id` + # * `description` + # * `entity_type_id` + # + # Examples: + # + # * `feature_id: foo` --> Matches a Feature with ID containing the substring + # `foo` (eg. `foo`, `foofeature`, `barfoo`). + # * `feature_id: foo*feature` --> Matches a Feature with ID containing the + # substring `foo*feature` (eg. `foobarfeature`). + # * `feature_id: foo AND description: bar` --> Matches a Feature with ID + # containing the substring `foo` and description containing the substring + # `bar`. + # + # + # Besides field queries, the following exact-match filters are + # supported. The exact-match filters do not support wildcards. Unlike + # field-restricted queries, exact-match filters are case-sensitive. + # + # * `feature_id`: Supports = comparisons. + # * `description`: Supports = comparisons. Multi-token filters should be + # enclosed in quotes. + # * `entity_type_id`: Supports = comparisons. + # * `value_type`: Supports = and != comparisons. + # * `labels`: Supports key-value equality as well as key presence. + # * `featurestore_id`: Supports = comparisons. + # + # Examples: + # + # * `description = "foo bar"` --> Any Feature with description exactly equal + # to `foo bar` + # * `value_type = DOUBLE` --> Features whose type is DOUBLE. + # * `labels.active = yes AND labels.env = prod` --> Features having both + # (active: yes) and (env: prod) labels. + # * `labels.env: *` --> Any Feature which has a label with `env` as the + # key. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Features to return. The service may return fewer + # than this value. If unspecified, at most 100 Features will be returned. + # The maximum value is 100; any value greater than 100 will be coerced to + # 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures}, + # except `page_size`, must match the call that provided the page token. + class SearchFeaturesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features FeaturestoreService.SearchFeatures}. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::AIPlatform::V1::Feature>] + # The Features matching the request. + # + # Fields returned: + # + # * `name` + # * `description` + # * `labels` + # * `create_time` + # * `update_time` + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::SearchFeaturesRequest#page_token SearchFeaturesRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class SearchFeaturesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_feature FeaturestoreService.UpdateFeature}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#update_feature FeatureRegistryService.UpdateFeature}. + # @!attribute [rw] feature + # @return [::Google::Cloud::AIPlatform::V1::Feature] + # Required. The Feature's `name` field is used to identify the Feature to be + # updated. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Features resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then only the non-empty fields present in the + # request will be overwritten. Set the update_mask to `*` to override all + # fields. + # + # Updatable fields: + # + # * `description` + # * `labels` + # * `disable_monitoring` (Not supported for FeatureRegistryService Feature) + # * `point_of_contact` (Not supported for FeaturestoreService FeatureStore) + class UpdateFeatureRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_feature FeaturestoreService.DeleteFeature}. + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#delete_feature FeatureRegistryService.DeleteFeature}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Features to be deleted. + # Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + # `projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}` + class DeleteFeatureRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create Featurestore. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore. + class CreateFeaturestoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update Featurestore. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore. + class UpdateFeaturestoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform import Feature values. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore import Feature values. + # @!attribute [rw] imported_entity_count + # @return [::Integer] + # Number of entities that have been imported by the operation. + # @!attribute [rw] imported_feature_value_count + # @return [::Integer] + # Number of Feature values that have been imported by the operation. + # @!attribute [rw] source_uris + # @return [::Array<::String>] + # The source URI from where Feature values are imported. + # @!attribute [rw] invalid_row_count + # @return [::Integer] + # The number of rows in input source that weren't imported due to either + # * Not having any featureValues. + # * Having a null entityId. + # * Having a null timestamp. + # * Not being parsable (applicable for CSV sources). + # @!attribute [rw] timestamp_outside_retention_rows_count + # @return [::Integer] + # The number rows that weren't ingested due to having timestamps outside the + # retention boundary. + # @!attribute [rw] blocking_operation_ids + # @return [::Array<::Integer>] + # List of ImportFeatureValues operations running under a single EntityType + # that are blocking this operation. + class ImportFeatureValuesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that exports Features values. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore export Feature values. + class ExportFeatureValuesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that batch reads Feature values. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore batch read Features values. + class BatchReadFeatureValuesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that delete Feature values. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Featurestore delete Features values. + class DeleteFeatureValuesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create EntityType. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for EntityType. + class CreateEntityTypeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create Feature. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Feature. + class CreateFeatureOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform batch create Features. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Feature. + class BatchCreateFeaturesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_feature_values FeaturestoreService.DeleteFeatureValues}. + # @!attribute [rw] select_entity + # @return [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectEntity] + # Select feature values to be deleted by specifying entities. + # @!attribute [rw] select_time_range_and_feature + # @return [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesRequest::SelectTimeRangeAndFeature] + # Select feature values to be deleted by specifying time range and + # features. + # @!attribute [rw] entity_type + # @return [::String] + # Required. The resource name of the EntityType grouping the Features for + # which values are being deleted from. Format: + # `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + class DeleteFeatureValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message to select entity. + # If an entity id is selected, all the feature values corresponding to the + # entity id will be deleted, including the entityId. + # @!attribute [rw] entity_id_selector + # @return [::Google::Cloud::AIPlatform::V1::EntityIdSelector] + # Required. Selectors choosing feature values of which entity id to be + # deleted from the EntityType. + class SelectEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message to select time range and feature. + # Values of the selected feature generated within an inclusive time range + # will be deleted. Using this option permanently deletes the feature values + # from the specified feature IDs within the specified time range. + # This might include data from the online storage. If you want to retain + # any deleted historical data in the online storage, you must re-ingest it. + # @!attribute [rw] time_range + # @return [::Google::Type::Interval] + # Required. Select feature generated within a half-inclusive time range. + # The time range is lower inclusive and upper exclusive. + # @!attribute [rw] feature_selector + # @return [::Google::Cloud::AIPlatform::V1::FeatureSelector] + # Required. Selectors choosing which feature values to be deleted from the + # EntityType. + # @!attribute [rw] skip_online_storage_delete + # @return [::Boolean] + # If set, data will not be deleted from online storage. + # When time range is older than the data in online storage, setting this to + # be true will make the deletion have no impact on online serving. + class SelectTimeRangeAndFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_feature_values FeaturestoreService.DeleteFeatureValues}. + # @!attribute [rw] select_entity + # @return [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesResponse::SelectEntity] + # Response for request specifying the entities to delete + # @!attribute [rw] select_time_range_and_feature + # @return [::Google::Cloud::AIPlatform::V1::DeleteFeatureValuesResponse::SelectTimeRangeAndFeature] + # Response for request specifying time range and feature + class DeleteFeatureValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Response message if the request uses the SelectEntity option. + # @!attribute [rw] offline_storage_deleted_entity_row_count + # @return [::Integer] + # The count of deleted entity rows in the offline storage. + # Each row corresponds to the combination of an entity ID and a timestamp. + # One entity ID can have multiple rows in the offline storage. + # @!attribute [rw] online_storage_deleted_entity_count + # @return [::Integer] + # The count of deleted entities in the online storage. + # Each entity ID corresponds to one entity. + class SelectEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message if the request uses the SelectTimeRangeAndFeature option. + # @!attribute [rw] impacted_feature_count + # @return [::Integer] + # The count of the features or columns impacted. + # This is the same as the feature count in the request. + # @!attribute [rw] offline_storage_modified_entity_row_count + # @return [::Integer] + # The count of modified entity rows in the offline storage. + # Each row corresponds to the combination of an entity ID and a timestamp. + # One entity ID can have multiple rows in the offline storage. + # Within each row, only the features specified in the request are + # deleted. + # @!attribute [rw] online_storage_modified_entity_count + # @return [::Integer] + # The count of modified entities in the online storage. + # Each entity ID corresponds to one entity. + # Within each entity, only the features specified in the request are + # deleted. + class SelectTimeRangeAndFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Selector for entityId. Getting ids from the given source. + # @!attribute [rw] csv_source + # @return [::Google::Cloud::AIPlatform::V1::CsvSource] + # Source of Csv + # @!attribute [rw] entity_id_field + # @return [::String] + # Source column that holds entity IDs. If not provided, entity IDs are + # extracted from the column named entity_id. + class EntityIdSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/gen_ai_cache_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/gen_ai_cache_service.rb new file mode 100644 index 000000000000..a1a3113a61e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/gen_ai_cache_service.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client#create_cached_content GenAiCacheService.CreateCachedContent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where the cached content will be created + # @!attribute [rw] cached_content + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # Required. The cached content to create + class CreateCachedContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client#get_cached_content GenAiCacheService.GetCachedContent}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name referring to the cached content + class GetCachedContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client#update_cached_content GenAiCacheService.UpdateCachedContent}. + # Only expire_time or ttl can be updated. + # @!attribute [rw] cached_content + # @return [::Google::Cloud::AIPlatform::V1::CachedContent] + # Required. The cached content to update + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. + class UpdateCachedContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client#delete_cached_content GenAiCacheService.DeleteCachedContent}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name referring to the cached content + class DeleteCachedContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list CachedContents. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of cached contents. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of cached contents to return. The service may + # return fewer than this value. If unspecified, some default (under maximum) + # number of items will be returned. The maximum value is 1000; values above + # 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListCachedContents` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCachedContents` must + # match the call that provided the page token. + class ListCachedContentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response with a list of CachedContents. + # @!attribute [rw] cached_contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::CachedContent>] + # List of cached contents. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListCachedContentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb new file mode 100644 index 000000000000..2e520f6df35d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#create_tuning_job GenAiTuningService.CreateTuningJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the TuningJob in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] tuning_job + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # Required. The TuningJob to create. + class CreateTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#get_tuning_job GenAiTuningService.GetTuningJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TuningJob resource. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + class GetTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#list_tuning_jobs GenAiTuningService.ListTuningJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the TuningJobs from. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsResponse#next_page_token ListTuningJobsResponse.next_page_token} + # of the previous GenAiTuningService.ListTuningJob][] call. + class ListTuningJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#list_tuning_jobs GenAiTuningService.ListTuningJobs} + # @!attribute [rw] tuning_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::TuningJob>] + # List of TuningJobs in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListTuningJobsRequest#page_token ListTuningJobsRequest.page_token} + # to obtain that page. + class ListTuningJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#cancel_tuning_job GenAiTuningService.CancelTuningJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TuningJob to cancel. Format: + # `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + class CancelTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#rebase_tuned_model GenAiTuningService.RebaseTunedModel}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location into which to rebase the Model. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] tuned_model_ref + # @return [::Google::Cloud::AIPlatform::V1::TunedModelRef] + # Required. TunedModel reference to retrieve the legacy model information. + # @!attribute [rw] tuning_job + # @return [::Google::Cloud::AIPlatform::V1::TuningJob] + # Optional. The TuningJob to be updated. Users can use this TuningJob field + # to overwrite tuning configs. + # @!attribute [rw] artifact_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # Optional. The Google Cloud Storage location to write the artifacts. + # @!attribute [rw] deploy_to_same_endpoint + # @return [::Boolean] + # Optional. By default, bison to gemini migration will always create new + # model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default + # deploy to the same endpoint. See details in this Section. + class RebaseTunedModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::GenAiTuningService::Client#rebase_tuned_model GenAiTuningService.RebaseTunedModel}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation generic information. + class RebaseTunedModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/hyperparameter_tuning_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/hyperparameter_tuning_job.rb new file mode 100644 index 000000000000..6502cdbf2274 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/hyperparameter_tuning_job.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a HyperparameterTuningJob. A HyperparameterTuningJob + # has a Study specification and multiple CustomJobs with identical + # CustomJob specification. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the HyperparameterTuningJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the HyperparameterTuningJob. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] study_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec] + # Required. Study configuration of the HyperparameterTuningJob. + # @!attribute [rw] max_trial_count + # @return [::Integer] + # Required. The desired total number of Trials. + # @!attribute [rw] parallel_trial_count + # @return [::Integer] + # Required. The desired number of Trials to run in parallel. + # @!attribute [rw] max_failed_trial_count + # @return [::Integer] + # The number of failed Trials that need to be seen before failing + # the HyperparameterTuningJob. + # + # If set to 0, Vertex AI decides how many Trials must fail + # before the whole job fails. + # @!attribute [rw] trial_job_spec + # @return [::Google::Cloud::AIPlatform::V1::CustomJobSpec] + # Required. The spec of a trial job. The same spec applies to the CustomJobs + # created in all the trials. + # @!attribute [r] trials + # @return [::Array<::Google::Cloud::AIPlatform::V1::Trial>] + # Output only. Trials of the HyperparameterTuningJob. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the job. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the HyperparameterTuningJob was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the HyperparameterTuningJob for the first time + # entered the `JOB_STATE_RUNNING` state. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the HyperparameterTuningJob entered any of the + # following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, + # `JOB_STATE_CANCELLED`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the HyperparameterTuningJob was most recently + # updated. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when job's state is JOB_STATE_FAILED or + # JOB_STATE_CANCELLED. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize HyperparameterTuningJobs. + # + # 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] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key options for a HyperparameterTuningJob. + # If this is set, then all resources created by the HyperparameterTuningJob + # will be encrypted with the provided encryption key. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class HyperparameterTuningJob + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index.rb new file mode 100644 index 000000000000..412ac225672f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A representation of a collection of database items organized in a way that + # allows for approximate nearest neighbor (a.k.a ANN) algorithms search. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the Index. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the Index. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the Index. + # @!attribute [rw] metadata_schema_uri + # @return [::String] + # Immutable. Points to a YAML file stored on Google Cloud Storage describing + # additional information about the Index, that is specific to it. Unset if + # the Index does not have any additional information. The schema is defined + # as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Value] + # An additional information about the Index; the schema of the metadata can + # be found in + # {::Google::Cloud::AIPlatform::V1::Index#metadata_schema_uri metadata_schema}. + # @!attribute [r] deployed_indexes + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedIndexRef>] + # Output only. The pointers to DeployedIndexes created from this Index. + # An Index can be only deleted if all its DeployedIndexes had been undeployed + # first. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Indexes. + # + # 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 [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Index was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Index was most recently updated. + # This also includes any update to the contents of the Index. + # Note that Operations working on this Index may have their + # [Operations.metadata.generic_metadata.update_time] + # [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] a little + # after the value of this timestamp, yet that does not mean their results are + # not already reflected in the Index. Result of any successfully completed + # Operation on the Index is reflected in it. + # @!attribute [r] index_stats + # @return [::Google::Cloud::AIPlatform::V1::IndexStats] + # Output only. Stats of the index resource. + # @!attribute [rw] index_update_method + # @return [::Google::Cloud::AIPlatform::V1::Index::IndexUpdateMethod] + # Immutable. The update method to use with this Index. If not set, + # BATCH_UPDATE will be used by default. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Immutable. Customer-managed encryption key spec for an Index. If set, this + # Index and all sub-resources of this Index will be secured by this key. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Index + 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 + + # The update method of an Index. + module IndexUpdateMethod + # Should not be used. + INDEX_UPDATE_METHOD_UNSPECIFIED = 0 + + # BatchUpdate: user can call UpdateIndex with files on Cloud Storage of + # Datapoints to update. + BATCH_UPDATE = 1 + + # StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update + # the Index and the updates will be applied in corresponding + # DeployedIndexes in nearly real-time. + STREAM_UPDATE = 2 + end + end + + # A datapoint of Index. + # @!attribute [rw] datapoint_id + # @return [::String] + # Required. Unique identifier of the datapoint. + # @!attribute [rw] feature_vector + # @return [::Array<::Float>] + # Required. Feature embedding vector for dense index. An array of numbers + # with the length of [NearestNeighborSearchConfig.dimensions]. + # @!attribute [rw] sparse_embedding + # @return [::Google::Cloud::AIPlatform::V1::IndexDatapoint::SparseEmbedding] + # Optional. Feature embedding vector for sparse index. + # @!attribute [rw] restricts + # @return [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint::Restriction>] + # Optional. List of Restrict of the datapoint, used to perform "restricted + # searches" where boolean rule are used to filter the subset of the database + # eligible for matching. This uses categorical tokens. See: + # https://cloud.google.com/vertex-ai/docs/matching-engine/filtering + # @!attribute [rw] numeric_restricts + # @return [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint::NumericRestriction>] + # Optional. List of Restrict of the datapoint, used to perform "restricted + # searches" where boolean rule are used to filter the subset of the database + # eligible for matching. This uses numeric comparisons. + # @!attribute [rw] crowding_tag + # @return [::Google::Cloud::AIPlatform::V1::IndexDatapoint::CrowdingTag] + # Optional. CrowdingTag of the datapoint, the number of neighbors to return + # in each crowding can be configured during query. + class IndexDatapoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Feature embedding vector for sparse index. An array of numbers whose values + # are located in the specified dimensions. + # @!attribute [rw] values + # @return [::Array<::Float>] + # Required. The list of embedding values of the sparse vector. + # @!attribute [rw] dimensions + # @return [::Array<::Integer>] + # Required. The list of indexes for the embedding values of the sparse + # vector. + class SparseEmbedding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Restriction of a datapoint which describe its attributes(tokens) from each + # of several attribute categories(namespaces). + # @!attribute [rw] namespace + # @return [::String] + # The namespace of this restriction. e.g.: color. + # @!attribute [rw] allow_list + # @return [::Array<::String>] + # The attributes to allow in this namespace. e.g.: 'red' + # @!attribute [rw] deny_list + # @return [::Array<::String>] + # The attributes to deny in this namespace. e.g.: 'blue' + class Restriction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This field allows restricts to be based on numeric comparisons rather + # than categorical tokens. + # @!attribute [rw] value_int + # @return [::Integer] + # Represents 64 bit integer. + # @!attribute [rw] value_float + # @return [::Float] + # Represents 32 bit float. + # @!attribute [rw] value_double + # @return [::Float] + # Represents 64 bit float. + # @!attribute [rw] namespace + # @return [::String] + # The namespace of this restriction. e.g.: cost. + # @!attribute [rw] op + # @return [::Google::Cloud::AIPlatform::V1::IndexDatapoint::NumericRestriction::Operator] + # This MUST be specified for queries and must NOT be specified for + # datapoints. + class NumericRestriction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Which comparison operator to use. Should be specified for queries only; + # specifying this for a datapoint is an error. + # + # Datapoints for which Operator is true relative to the query's Value + # field will be allowlisted. + module Operator + # Default value of the enum. + OPERATOR_UNSPECIFIED = 0 + + # Datapoints are eligible iff their value is < the query's. + LESS = 1 + + # Datapoints are eligible iff their value is <= the query's. + LESS_EQUAL = 2 + + # Datapoints are eligible iff their value is == the query's. + EQUAL = 3 + + # Datapoints are eligible iff their value is >= the query's. + GREATER_EQUAL = 4 + + # Datapoints are eligible iff their value is > the query's. + GREATER = 5 + + # Datapoints are eligible iff their value is != the query's. + NOT_EQUAL = 6 + end + end + + # Crowding tag is a constraint on a neighbor list produced by nearest + # neighbor search requiring that no more than some value k' of the k + # neighbors returned have the same value of crowding_attribute. + # @!attribute [rw] crowding_attribute + # @return [::String] + # The attribute value used for crowding. The maximum number of neighbors + # to return per crowding attribute value + # (per_crowding_attribute_num_neighbors) is configured per-query. This + # field is ignored if per_crowding_attribute_num_neighbors is larger than + # the total number of neighbors to return for a given query. + class CrowdingTag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Stats of the Index. + # @!attribute [r] vectors_count + # @return [::Integer] + # Output only. The number of dense vectors in the Index. + # @!attribute [r] sparse_vectors_count + # @return [::Integer] + # Output only. The number of sparse vectors in the Index. + # @!attribute [r] shards_count + # @return [::Integer] + # Output only. The number of shards in the Index. + class IndexStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb new file mode 100644 index 000000000000..89fe45edefa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb @@ -0,0 +1,305 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Indexes are deployed into it. An IndexEndpoint can have multiple + # DeployedIndexes. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the IndexEndpoint. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the IndexEndpoint. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the IndexEndpoint. + # @!attribute [r] deployed_indexes + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedIndex>] + # Output only. The indexes deployed in this endpoint. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your IndexEndpoints. + # + # 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 [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this IndexEndpoint was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this IndexEndpoint was last updated. + # This timestamp is not updated when the endpoint's DeployedIndexes are + # updated, e.g. due to updates of the original Indexes they are the + # deployments of. + # @!attribute [rw] network + # @return [::String] + # Optional. The full name of the Google Compute Engine + # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + # to which the IndexEndpoint should be peered. + # + # Private services access must already be configured for the network. If left + # unspecified, the Endpoint is not peered with any network. + # + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#network network} and + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#private_service_connect_config private_service_connect_config} + # are mutually exclusive. + # + # [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + # `projects/{project}/global/networks/{network}`. + # Where \\{project} is a project number, as in '12345', and \\{network} is + # network name. + # @!attribute [rw] enable_private_service_connect + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Deprecated: If true, expose the IndexEndpoint via private service + # connect. + # + # Only one of the fields, + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#network network} or + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#enable_private_service_connect enable_private_service_connect}, + # can be set. + # @!attribute [rw] private_service_connect_config + # @return [::Google::Cloud::AIPlatform::V1::PrivateServiceConnectConfig] + # Optional. Configuration for private service connect. + # + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#network network} and + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#private_service_connect_config private_service_connect_config} + # are mutually exclusive. + # @!attribute [rw] public_endpoint_enabled + # @return [::Boolean] + # Optional. If true, the deployed index will be accessible through public + # endpoint. + # @!attribute [r] public_endpoint_domain_name + # @return [::String] + # Output only. If + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#public_endpoint_enabled public_endpoint_enabled} + # is true, this field will be populated with the domain name to use for this + # index endpoint. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Immutable. Customer-managed encryption key spec for an IndexEndpoint. If + # set, this IndexEndpoint and all sub-resources of this IndexEndpoint will be + # secured by this key. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class IndexEndpoint + 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 + + # A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. + # @!attribute [rw] id + # @return [::String] + # Required. The user specified ID of the DeployedIndex. + # The ID can be up to 128 characters long and must start with a letter and + # only contain letters, numbers, and underscores. + # The ID must be unique within the project it is created in. + # @!attribute [rw] index + # @return [::String] + # Required. The name of the Index this is the deployment of. + # We may refer to this Index as the DeployedIndex's "original" Index. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the DeployedIndex. If not provided upon creation, + # the Index's display_name is used. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the DeployedIndex was created. + # @!attribute [r] private_endpoints + # @return [::Google::Cloud::AIPlatform::V1::IndexPrivateEndpoints] + # Output only. Provides paths for users to send requests directly to the + # deployed index services running on Cloud via private services access. This + # field is populated if + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#network network} is configured. + # @!attribute [r] index_sync_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The DeployedIndex may depend on various data on its original + # Index. Additionally when certain changes to the original Index are being + # done (e.g. when what the Index contains is being changed) the DeployedIndex + # may be asynchronously updated in the background to reflect these changes. + # If this timestamp's value is at least the + # {::Google::Cloud::AIPlatform::V1::Index#update_time Index.update_time} of the + # original Index, it means that this DeployedIndex and the original Index are + # in sync. If this timestamp is older, then to see which updates this + # DeployedIndex already contains (and which it does not), one must + # list the operations that + # are running on the original Index. Only the successfully completed + # Operations with + # {::Google::Cloud::AIPlatform::V1::GenericOperationMetadata#update_time update_time} + # equal or before this sync time are contained in this DeployedIndex. + # @!attribute [rw] automatic_resources + # @return [::Google::Cloud::AIPlatform::V1::AutomaticResources] + # Optional. A description of resources that the DeployedIndex uses, which to + # large degree are decided by Vertex AI, and optionally allows only a modest + # additional configuration. + # If min_replica_count is not set, the default value is 2 (we don't provide + # SLA when min_replica_count=1). If max_replica_count is not set, the + # default value is min_replica_count. The max allowed replica count is + # 1000. + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::AIPlatform::V1::DedicatedResources] + # Optional. A description of resources that are dedicated to the + # DeployedIndex, and that need a higher degree of manual configuration. The + # field min_replica_count must be set to a value strictly greater than 0, or + # else validation will fail. We don't provide SLA when min_replica_count=1. + # If max_replica_count is not set, the default value is min_replica_count. + # The max allowed replica count is 1000. + # + # Available machine types for SMALL shard: + # e2-standard-2 and all machine types available for MEDIUM and LARGE shard. + # + # Available machine types for MEDIUM shard: + # e2-standard-16 and all machine types available for LARGE shard. + # + # Available machine types for LARGE shard: + # e2-highmem-16, n2d-standard-32. + # + # n1-standard-16 and n1-standard-32 are still available, but we recommend + # e2-standard-16 and e2-highmem-16 for cost efficiency. + # @!attribute [rw] enable_access_logging + # @return [::Boolean] + # Optional. If true, private endpoint's access logs are sent to Cloud + # Logging. + # + # These logs are like standard server access logs, containing + # information like timestamp and latency for each MatchRequest. + # + # Note that logs may incur a cost, especially if the deployed + # index receives a high queries per second rate (QPS). + # Estimate your costs before enabling this option. + # @!attribute [rw] deployed_index_auth_config + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndexAuthConfig] + # Optional. If set, the authentication is enabled for the private endpoint. + # @!attribute [rw] reserved_ip_ranges + # @return [::Array<::String>] + # Optional. A list of reserved ip ranges under the VPC network that can be + # used for this DeployedIndex. + # + # If set, we will deploy the index within the provided ip ranges. Otherwise, + # the index might be deployed to any ip ranges under the provided VPC + # network. + # + # The value should be the name of the address + # (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) + # Example: ['vertex-ai-ip-range']. + # + # For more information about subnets and network IP ranges, please see + # https://cloud.google.com/vpc/docs/subnets#manually_created_subnet_ip_ranges. + # @!attribute [rw] deployment_group + # @return [::String] + # Optional. The deployment group can be no longer than 64 characters (eg: + # 'test', 'prod'). If not set, we will use the 'default' deployment group. + # + # Creating `deployment_groups` with `reserved_ip_ranges` is a recommended + # practice when the peered network has multiple peering ranges. This creates + # your deployments from predictable IP spaces for easier traffic + # administration. Also, one deployment_group (except 'default') can only be + # used with the same reserved_ip_ranges which means if the deployment_group + # has been used with reserved_ip_ranges: [a, b, c], using it with [a, b] or + # [d, e] is disallowed. + # + # Note: we only support up to 5 deployment groups(not including 'default'). + # @!attribute [rw] psc_automation_configs + # @return [::Array<::Google::Cloud::AIPlatform::V1::PSCAutomationConfig>] + # Optional. If set for PSC deployed index, PSC connection will be + # automatically created after deployment is done and the endpoint information + # is populated in private_endpoints.psc_automated_endpoints. + class DeployedIndex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used to set up the auth on the DeployedIndex's private endpoint. + # @!attribute [rw] auth_provider + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndexAuthConfig::AuthProvider] + # Defines the authentication provider that the DeployedIndex uses. + class DeployedIndexAuthConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for an authentication provider, including support for + # [JSON Web Token + # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + # @!attribute [rw] audiences + # @return [::Array<::String>] + # The list of JWT + # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + # that are allowed to access. A JWT containing any of these audiences will + # be accepted. + # @!attribute [rw] allowed_issuers + # @return [::Array<::String>] + # A list of allowed JWT issuers. Each entry must be a valid Google + # service account, in the following format: + # + # `service-account-name@project-id.iam.gserviceaccount.com` + class AuthProvider + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # IndexPrivateEndpoints proto is used to provide paths for users to send + # requests via private endpoints (e.g. private service access, private service + # connect). + # To send request via private service access, use match_grpc_address. + # To send request via private service connect, use service_attachment. + # @!attribute [r] match_grpc_address + # @return [::String] + # Output only. The ip address used to send match gRPC requests. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The name of the service attachment resource. Populated if + # private service connect is enabled. + # @!attribute [r] psc_automated_endpoints + # @return [::Array<::Google::Cloud::AIPlatform::V1::PscAutomatedEndpoints>] + # Output only. PscAutomatedEndpoints is populated if private service connect + # is enabled if PscAutomatedConfig is set. + class IndexPrivateEndpoints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint_service.rb new file mode 100644 index 000000000000..aaa033fc6733 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint_service.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#create_index_endpoint IndexEndpointService.CreateIndexEndpoint}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the IndexEndpoint in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] index_endpoint + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # Required. The IndexEndpoint to create. + class CreateIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#create_index_endpoint IndexEndpointService.CreateIndexEndpoint}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateIndexEndpointOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#get_index_endpoint IndexEndpointService.GetIndexEndpoint} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the IndexEndpoint resource. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + class GetIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#list_index_endpoints IndexEndpointService.ListIndexEndpoints}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the + # IndexEndpoints. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `index_endpoint` supports = and !=. `index_endpoint` represents the + # IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + # {::Google::Cloud::AIPlatform::V1::IndexEndpoint#name resourcename}. + # * `display_name` supports =, != and regex() + # (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* or labels:key - key existence + # A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # * `index_endpoint="1"` + # * `display_name="myDisplayName"` + # * `regex(display_name, "^A") -> The display name starts with an A. + # * `labels.myKey="myValue"` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsResponse#next_page_token ListIndexEndpointsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#list_index_endpoints IndexEndpointService.ListIndexEndpoints} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to read. + class ListIndexEndpointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#list_index_endpoints IndexEndpointService.ListIndexEndpoints}. + # @!attribute [rw] index_endpoints + # @return [::Array<::Google::Cloud::AIPlatform::V1::IndexEndpoint>] + # List of IndexEndpoints in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest#page_token ListIndexEndpointsRequest.page_token} + # to obtain that page. + class ListIndexEndpointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#update_index_endpoint IndexEndpointService.UpdateIndexEndpoint}. + # @!attribute [rw] index_endpoint + # @return [::Google::Cloud::AIPlatform::V1::IndexEndpoint] + # Required. The IndexEndpoint which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class UpdateIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#delete_index_endpoint IndexEndpointService.DeleteIndexEndpoint}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the IndexEndpoint resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + class DeleteIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#deploy_index IndexEndpointService.DeployIndex}. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndex] + # Required. The DeployedIndex to be created within the IndexEndpoint. + class DeployIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#deploy_index IndexEndpointService.DeployIndex}. + # @!attribute [rw] deployed_index + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndex] + # The DeployedIndex that had been deployed in the IndexEndpoint. + class DeployIndexResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#deploy_index IndexEndpointService.DeployIndex}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] deployed_index_id + # @return [::String] + # The unique index id specified by user + class DeployIndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#undeploy_index IndexEndpointService.UndeployIndex}. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The name of the IndexEndpoint resource from which to undeploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index_id + # @return [::String] + # Required. The ID of the DeployedIndex to be undeployed from the + # IndexEndpoint. + class UndeployIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#undeploy_index IndexEndpointService.UndeployIndex}. + class UndeployIndexResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#undeploy_index IndexEndpointService.UndeployIndex}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UndeployIndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#mutate_deployed_index IndexEndpointService.MutateDeployedIndex}. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The name of the IndexEndpoint resource into which to deploy an + # Index. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndex] + # Required. The DeployedIndex to be updated within the IndexEndpoint. + # Currently, the updatable fields are + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#automatic_resources DeployedIndex.automatic_resources} + # and + # {::Google::Cloud::AIPlatform::V1::DeployedIndex#dedicated_resources DeployedIndex.dedicated_resources} + class MutateDeployedIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#mutate_deployed_index IndexEndpointService.MutateDeployedIndex}. + # @!attribute [rw] deployed_index + # @return [::Google::Cloud::AIPlatform::V1::DeployedIndex] + # The DeployedIndex that had been updated in the IndexEndpoint. + class MutateDeployedIndexResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#mutate_deployed_index IndexEndpointService.MutateDeployedIndex}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] deployed_index_id + # @return [::String] + # The unique index id specified by user + class MutateDeployedIndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_service.rb new file mode 100644 index 000000000000..36b7f9d883a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_service.rb @@ -0,0 +1,324 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#create_index IndexService.CreateIndex}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the Index in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] index + # @return [::Google::Cloud::AIPlatform::V1::Index] + # Required. The Index to create. + class CreateIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#create_index IndexService.CreateIndex}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] nearest_neighbor_search_operation_metadata + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborSearchOperationMetadata] + # The operation metadata with regard to Matching Engine Index operation. + class CreateIndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#get_index IndexService.GetIndex} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Index resource. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + class GetIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#list_indexes IndexService.ListIndexes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the Indexes. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListIndexesResponse#next_page_token ListIndexesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#list_indexes IndexService.ListIndexes} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListIndexesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#list_indexes IndexService.ListIndexes}. + # @!attribute [rw] indexes + # @return [::Array<::Google::Cloud::AIPlatform::V1::Index>] + # List of indexes in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListIndexesRequest#page_token ListIndexesRequest.page_token} + # to obtain that page. + class ListIndexesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#update_index IndexService.UpdateIndex}. + # @!attribute [rw] index + # @return [::Google::Cloud::AIPlatform::V1::Index] + # Required. The Index which updates the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class UpdateIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#update_index IndexService.UpdateIndex}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] nearest_neighbor_search_operation_metadata + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborSearchOperationMetadata] + # The operation metadata with regard to Matching Engine Index operation. + class UpdateIndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#delete_index IndexService.DeleteIndex}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Index resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + class DeleteIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#upsert_datapoints IndexService.UpsertDatapoints} + # @!attribute [rw] index + # @return [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @!attribute [rw] datapoints + # @return [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint>] + # A list of datapoints to be created/updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Update mask is used to specify the fields to be overwritten in + # the datapoints by the update. The fields specified in the update_mask are + # relative to each IndexDatapoint inside datapoints, not the full request. + # + # Updatable fields: + # + # * Use `all_restricts` to update both restricts and numeric_restricts. + class UpsertDatapointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#upsert_datapoints IndexService.UpsertDatapoints} + class UpsertDatapointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#remove_datapoints IndexService.RemoveDatapoints} + # @!attribute [rw] index + # @return [::String] + # Required. The name of the Index resource to be updated. + # Format: + # `projects/{project}/locations/{location}/indexes/{index}` + # @!attribute [rw] datapoint_ids + # @return [::Array<::String>] + # A list of datapoint ids to be deleted. + class RemoveDatapointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::IndexService::Client#remove_datapoints IndexService.RemoveDatapoints} + class RemoveDatapointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation metadata with regard to Matching Engine Index. + # @!attribute [rw] content_validation_stats + # @return [::Array<::Google::Cloud::AIPlatform::V1::NearestNeighborSearchOperationMetadata::ContentValidationStats>] + # The validation stats of the content (per file) to be inserted or + # updated on the Matching Engine Index resource. Populated if + # contentsDeltaUri is provided as part of + # {::Google::Cloud::AIPlatform::V1::Index#metadata Index.metadata}. Please note + # that, currently for those files that are broken or has unsupported file + # format, we will not have the stats for those files. + # @!attribute [rw] data_bytes_count + # @return [::Integer] + # The ingested data size in bytes. + class NearestNeighborSearchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] error_type + # @return [::Google::Cloud::AIPlatform::V1::NearestNeighborSearchOperationMetadata::RecordError::RecordErrorType] + # The error type of this record. + # @!attribute [rw] error_message + # @return [::String] + # A human-readable message that is shown to the user to help them fix the + # error. Note that this message may change from time to time, your code + # should check against error_type as the source of truth. + # @!attribute [rw] source_gcs_uri + # @return [::String] + # Cloud Storage URI pointing to the original file in user's bucket. + # @!attribute [rw] embedding_id + # @return [::String] + # Empty if the embedding id is failed to parse. + # @!attribute [rw] raw_record + # @return [::String] + # The original content of this record. + class RecordError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module RecordErrorType + # Default, shall not be used. + ERROR_TYPE_UNSPECIFIED = 0 + + # The record is empty. + EMPTY_LINE = 1 + + # Invalid json format. + INVALID_JSON_SYNTAX = 2 + + # Invalid csv format. + INVALID_CSV_SYNTAX = 3 + + # Invalid avro format. + INVALID_AVRO_SYNTAX = 4 + + # The embedding id is not valid. + INVALID_EMBEDDING_ID = 5 + + # The size of the dense embedding vectors does not match with the + # specified dimension. + EMBEDDING_SIZE_MISMATCH = 6 + + # The `namespace` field is missing. + NAMESPACE_MISSING = 7 + + # Generic catch-all error. Only used for validation failure where the + # root cause cannot be easily retrieved programmatically. + PARSING_ERROR = 8 + + # There are multiple restricts with the same `namespace` value. + DUPLICATE_NAMESPACE = 9 + + # Numeric restrict has operator specified in datapoint. + OP_IN_DATAPOINT = 10 + + # Numeric restrict has multiple values specified. + MULTIPLE_VALUES = 11 + + # Numeric restrict has invalid numeric value specified. + INVALID_NUMERIC_VALUE = 12 + + # File is not in UTF_8 format. + INVALID_ENCODING = 13 + + # Error parsing sparse dimensions field. + INVALID_SPARSE_DIMENSIONS = 14 + + # Token restrict value is invalid. + INVALID_TOKEN_VALUE = 15 + + # Invalid sparse embedding. + INVALID_SPARSE_EMBEDDING = 16 + + # Invalid dense embedding. + INVALID_EMBEDDING = 17 + end + end + + # @!attribute [rw] source_gcs_uri + # @return [::String] + # Cloud Storage URI pointing to the original file in user's bucket. + # @!attribute [rw] valid_record_count + # @return [::Integer] + # Number of records in this file that were successfully processed. + # @!attribute [rw] invalid_record_count + # @return [::Integer] + # Number of records in this file we skipped due to validate errors. + # @!attribute [rw] partial_errors + # @return [::Array<::Google::Cloud::AIPlatform::V1::NearestNeighborSearchOperationMetadata::RecordError>] + # The detail information of the partial failures encountered for those + # invalid records that couldn't be parsed. + # Up to 50 partial errors will be reported. + # @!attribute [rw] valid_sparse_record_count + # @return [::Integer] + # Number of sparse records in this file that were successfully processed. + # @!attribute [rw] invalid_sparse_record_count + # @return [::Integer] + # Number of sparse records in this file we skipped due to validate errors. + class ContentValidationStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/io.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/io.rb new file mode 100644 index 000000000000..2c2297cc91d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/io.rb @@ -0,0 +1,293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The storage details for Avro input content. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # Required. Google Cloud Storage location. + class AvroSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The storage details for CSV input content. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # Required. Google Cloud Storage location. + class CsvSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for the input content. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Required. Google Cloud Storage URI(-s) to the input file(s). May contain + # wildcards. For more information on wildcards, see + # https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location where the output is to be written to. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Required. Google Cloud Storage URI to output directory. If the uri doesn't + # end with + # '/', a '/' will be automatically appended. The directory is created if it + # doesn't exist. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The BigQuery location for the input content. + # @!attribute [rw] input_uri + # @return [::String] + # Required. BigQuery URI to a table, up to 2000 characters long. + # Accepted forms: + # + # * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. + class BigQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The BigQuery location for the output content. + # @!attribute [rw] output_uri + # @return [::String] + # Required. BigQuery URI to a project or table, up to 2000 characters long. + # + # When only the project is specified, the Dataset and Table is created. + # When the full table reference is specified, the Dataset must exist and + # table must not exist. + # + # Accepted forms: + # + # * BigQuery path. For example: + # `bq://projectId` or `bq://projectId.bqDatasetId` or + # `bq://projectId.bqDatasetId.bqTableId`. + class BigQueryDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The storage details for CSV output content. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # Required. Google Cloud Storage location. + class CsvDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The storage details for TFRecord output content. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # Required. Google Cloud Storage location. + class TFRecordDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Container Registry location for the container image. + # @!attribute [rw] output_uri + # @return [::String] + # Required. Container Registry URI of a container image. + # Only Google Container Registry and Artifact Registry are supported now. + # Accepted forms: + # + # * Google Container Registry path. For example: + # `gcr.io/projectId/imageName:tag`. + # + # * Artifact Registry path. For example: + # `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. + # + # If a tag is not specified, "latest" will be used as the default tag. + class ContainerRegistryDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Drive location for the input content. + # @!attribute [rw] resource_ids + # @return [::Array<::Google::Cloud::AIPlatform::V1::GoogleDriveSource::ResourceId>] + # Required. Google Drive resource IDs. + class GoogleDriveSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type and ID of the Google Drive resource. + # @!attribute [rw] resource_type + # @return [::Google::Cloud::AIPlatform::V1::GoogleDriveSource::ResourceId::ResourceType] + # Required. The type of the Google Drive resource. + # @!attribute [rw] resource_id + # @return [::String] + # Required. The ID of the Google Drive resource. + class ResourceId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the Google Drive resource. + module ResourceType + # Unspecified resource type. + RESOURCE_TYPE_UNSPECIFIED = 0 + + # File resource type. + RESOURCE_TYPE_FILE = 1 + + # Folder resource type. + RESOURCE_TYPE_FOLDER = 2 + end + end + end + + # The input content is encapsulated and uploaded in the request. + class DirectUploadSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Slack source for the ImportRagFilesRequest. + # @!attribute [rw] channels + # @return [::Array<::Google::Cloud::AIPlatform::V1::SlackSource::SlackChannels>] + # Required. The Slack channels. + class SlackSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # SlackChannels contains the Slack channels and corresponding access token. + # @!attribute [rw] channels + # @return [::Array<::Google::Cloud::AIPlatform::V1::SlackSource::SlackChannels::SlackChannel>] + # Required. The Slack channel IDs. + # @!attribute [rw] api_key_config + # @return [::Google::Cloud::AIPlatform::V1::ApiAuth::ApiKeyConfig] + # Required. The SecretManager secret version resource name (e.g. + # projects/\\{project}/secrets/\\{secret}/versions/\\{version}) storing the + # Slack channel access token that has access to the slack channel IDs. + # See: https://api.slack.com/tutorials/tracks/getting-a-token. + class SlackChannels + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # SlackChannel contains the Slack channel ID and the time range to import. + # @!attribute [rw] channel_id + # @return [::String] + # Required. The Slack channel ID. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The starting timestamp for messages to import. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The ending timestamp for messages to import. + class SlackChannel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The Jira source for the ImportRagFilesRequest. + # @!attribute [rw] jira_queries + # @return [::Array<::Google::Cloud::AIPlatform::V1::JiraSource::JiraQueries>] + # Required. The Jira queries. + class JiraSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # JiraQueries contains the Jira queries and corresponding authentication. + # @!attribute [rw] projects + # @return [::Array<::String>] + # A list of Jira projects to import in their entirety. + # @!attribute [rw] custom_queries + # @return [::Array<::String>] + # A list of custom Jira queries to import. For information about JQL (Jira + # Query Language), see + # https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/ + # @!attribute [rw] email + # @return [::String] + # Required. The Jira email address. + # @!attribute [rw] server_uri + # @return [::String] + # Required. The Jira server URI. + # @!attribute [rw] api_key_config + # @return [::Google::Cloud::AIPlatform::V1::ApiAuth::ApiKeyConfig] + # Required. The SecretManager secret version resource name (e.g. + # projects/\\{project}/secrets/\\{secret}/versions/\\{version}) storing the + # Jira API key. See [Manage API tokens for your Atlassian + # account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). + class JiraQueries + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The SharePointSources to pass to ImportRagFiles. + # @!attribute [rw] share_point_sources + # @return [::Array<::Google::Cloud::AIPlatform::V1::SharePointSources::SharePointSource>] + # The SharePoint sources. + class SharePointSources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An individual SharePointSource. + # @!attribute [rw] sharepoint_folder_path + # @return [::String] + # The path of the SharePoint folder to download from. + # @!attribute [rw] sharepoint_folder_id + # @return [::String] + # The ID of the SharePoint folder to download from. + # @!attribute [rw] drive_name + # @return [::String] + # The name of the drive to download from. + # @!attribute [rw] drive_id + # @return [::String] + # The ID of the drive to download from. + # @!attribute [rw] client_id + # @return [::String] + # The Application ID for the app registered in Microsoft Azure Portal. + # The application must also be configured with MS Graph permissions + # "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All. + # @!attribute [rw] client_secret + # @return [::Google::Cloud::AIPlatform::V1::ApiAuth::ApiKeyConfig] + # The application secret for the app registered in Azure. + # @!attribute [rw] tenant_id + # @return [::String] + # Unique identifier of the Azure Active Directory Instance. + # @!attribute [rw] sharepoint_site_name + # @return [::String] + # The name of the SharePoint site to download from. This can be the site + # name or the site id. + # @!attribute [r] file_id + # @return [::String] + # Output only. The SharePoint file id. Output only. + class SharePointSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_service.rb new file mode 100644 index 000000000000..d89fa36d1145 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_service.rb @@ -0,0 +1,893 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_custom_job JobService.CreateCustomJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the CustomJob in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] custom_job + # @return [::Google::Cloud::AIPlatform::V1::CustomJob] + # Required. The CustomJob to create. + class CreateCustomJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_custom_job JobService.GetCustomJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomJob resource. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + class GetCustomJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_custom_jobs JobService.ListCustomJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the CustomJobs from. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsResponse#next_page_token ListCustomJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_custom_jobs JobService.ListCustomJobs} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListCustomJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_custom_jobs JobService.ListCustomJobs} + # @!attribute [rw] custom_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::CustomJob>] + # List of CustomJobs in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest#page_token ListCustomJobsRequest.page_token} + # to obtain that page. + class ListCustomJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_custom_job JobService.DeleteCustomJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + class DeleteCustomJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#cancel_custom_job JobService.CancelCustomJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomJob to cancel. + # Format: + # `projects/{project}/locations/{location}/customJobs/{custom_job}` + class CancelCustomJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_data_labeling_job JobService.CreateDataLabelingJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] data_labeling_job + # @return [::Google::Cloud::AIPlatform::V1::DataLabelingJob] + # Required. The DataLabelingJob to create. + class CreateDataLabelingJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_data_labeling_job JobService.GetDataLabelingJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + class GetDataLabelingJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_data_labeling_jobs JobService.ListDataLabelingJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the DataLabelingJob. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. FieldMask represents a set of + # symbolic field paths. For example, the mask can be `paths: "name"`. The + # "name" here is a field in DataLabelingJob. + # If this field is not set, all fields of the DataLabelingJob are returned. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order by + # default. + # Use `desc` after a field name for descending. + class ListDataLabelingJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_data_labeling_jobs JobService.ListDataLabelingJobs}. + # @!attribute [rw] data_labeling_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::DataLabelingJob>] + # A list of DataLabelingJobs that matches the specified filter in the + # request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListDataLabelingJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_data_labeling_job JobService.DeleteDataLabelingJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DataLabelingJob to be deleted. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + class DeleteDataLabelingJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#cancel_data_labeling_job JobService.CancelDataLabelingJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DataLabelingJob. + # Format: + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + class CancelDataLabelingJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_hyperparameter_tuning_job JobService.CreateHyperparameterTuningJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the + # HyperparameterTuningJob in. Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] hyperparameter_tuning_job + # @return [::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob] + # Required. The HyperparameterTuningJob to create. + class CreateHyperparameterTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_hyperparameter_tuning_job JobService.GetHyperparameterTuningJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the HyperparameterTuningJob resource. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + class GetHyperparameterTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_hyperparameter_tuning_jobs JobService.ListHyperparameterTuningJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the + # HyperparameterTuningJobs from. Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsResponse#next_page_token ListHyperparameterTuningJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_hyperparameter_tuning_jobs JobService.ListHyperparameterTuningJobs} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListHyperparameterTuningJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_hyperparameter_tuning_jobs JobService.ListHyperparameterTuningJobs} + # @!attribute [rw] hyperparameter_tuning_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>] + # List of HyperparameterTuningJobs in the requested page. + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob#trials HyperparameterTuningJob.trials} + # of the jobs will be not be returned. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest#page_token ListHyperparameterTuningJobsRequest.page_token} + # to obtain that page. + class ListHyperparameterTuningJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_hyperparameter_tuning_job JobService.DeleteHyperparameterTuningJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the HyperparameterTuningJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + class DeleteHyperparameterTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#cancel_hyperparameter_tuning_job JobService.CancelHyperparameterTuningJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the HyperparameterTuningJob to cancel. + # Format: + # `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + class CancelHyperparameterTuningJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_nas_job JobService.CreateNasJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the NasJob in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] nas_job + # @return [::Google::Cloud::AIPlatform::V1::NasJob] + # Required. The NasJob to create. + class CreateNasJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_nas_job JobService.GetNasJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + class GetNasJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_jobs JobService.ListNasJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the NasJobs + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasJobsResponse#next_page_token ListNasJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_jobs JobService.ListNasJobs} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListNasJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_jobs JobService.ListNasJobs} + # @!attribute [rw] nas_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::NasJob>] + # List of NasJobs in the requested page. + # {::Google::Cloud::AIPlatform::V1::NasJob#nas_job_output NasJob.nas_job_output} + # of the jobs will not be returned. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListNasJobsRequest#page_token ListNasJobsRequest.page_token} + # to obtain that page. + class ListNasJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_nas_job JobService.DeleteNasJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NasJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + class DeleteNasJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#cancel_nas_job JobService.CancelNasJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NasJob to cancel. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + class CancelNasJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_nas_trial_detail JobService.GetNasTrialDetail}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NasTrialDetail resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + class GetNasTrialDetailRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_trial_details JobService.ListNasTrialDetails}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the NasJob resource. + # Format: + # `projects/{project}/locations/{location}/nasJobs/{nas_job}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsResponse#next_page_token ListNasTrialDetailsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_trial_details JobService.ListNasTrialDetails} + # call. + class ListNasTrialDetailsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_nas_trial_details JobService.ListNasTrialDetails} + # @!attribute [rw] nas_trial_details + # @return [::Array<::Google::Cloud::AIPlatform::V1::NasTrialDetail>] + # List of top NasTrials in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListNasTrialDetailsRequest#page_token ListNasTrialDetailsRequest.page_token} + # to obtain that page. + class ListNasTrialDetailsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_batch_prediction_job JobService.CreateBatchPredictionJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the + # BatchPredictionJob in. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] batch_prediction_job + # @return [::Google::Cloud::AIPlatform::V1::BatchPredictionJob] + # Required. The BatchPredictionJob to create. + class CreateBatchPredictionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_batch_prediction_job JobService.GetBatchPredictionJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the BatchPredictionJob resource. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + class GetBatchPredictionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_batch_prediction_jobs JobService.ListBatchPredictionJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the BatchPredictionJobs + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `model_display_name` supports `=`, `!=` comparisons. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsResponse#next_page_token ListBatchPredictionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_batch_prediction_jobs JobService.ListBatchPredictionJobs} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListBatchPredictionJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_batch_prediction_jobs JobService.ListBatchPredictionJobs} + # @!attribute [rw] batch_prediction_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>] + # List of BatchPredictionJobs in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest#page_token ListBatchPredictionJobsRequest.page_token} + # to obtain that page. + class ListBatchPredictionJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_batch_prediction_job JobService.DeleteBatchPredictionJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the BatchPredictionJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + class DeleteBatchPredictionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#cancel_batch_prediction_job JobService.CancelBatchPredictionJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the BatchPredictionJob to cancel. + # Format: + # `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + class CancelBatchPredictionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#create_model_deployment_monitoring_job JobService.CreateModelDeploymentMonitoringJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] model_deployment_monitoring_job + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # Required. The ModelDeploymentMonitoringJob to create + class CreateModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies}. + # @!attribute [rw] model_deployment_monitoring_job + # @return [::String] + # Required. ModelDeploymentMonitoring Job resource name. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + # @!attribute [rw] deployed_model_id + # @return [::String] + # Required. The DeployedModel ID of the + # [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + # @!attribute [rw] feature_display_name + # @return [::String] + # The feature display name. If specified, only return the stats belonging to + # this feature. Format: + # {::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies#feature_display_name ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + # example: "user_destination". + # @!attribute [rw] objectives + # @return [::Array<::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest::StatsAnomaliesObjective>] + # Required. Objectives of the stats to retrieve. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # A page token received from a previous + # {::Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies} + # call. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The earliest timestamp of stats being generated. + # If not set, indicates fetching stats till the earliest possible one. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The latest timestamp of stats being generated. + # If not set, indicates feching stats till the latest possible one. + class SearchModelDeploymentMonitoringStatsAnomaliesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Stats requested for specific objective. + # @!attribute [rw] type + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringObjectiveType] + # @!attribute [rw] top_feature_count + # @return [::Integer] + # If set, all attribution scores between + # {::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest#start_time SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time} + # and + # {::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest#end_time SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time} + # are fetched, and page token doesn't take effect in this case. Only used + # to retrieve attribution score for the top Features which has the highest + # attribution score in the latest monitoring run. + class StatsAnomaliesObjective + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies}. + # @!attribute [rw] monitoring_stats + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>] + # Stats retrieved for requested objectives. + # There are at most 1000 + # {::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies#prediction_stats ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats} + # in the response. + # @!attribute [rw] next_page_token + # @return [::String] + # The page token that can be used by the next + # {::Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies JobService.SearchModelDeploymentMonitoringStatsAnomalies} + # call. + class SearchModelDeploymentMonitoringStatsAnomaliesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#get_model_deployment_monitoring_job JobService.GetModelDeploymentMonitoringJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ModelDeploymentMonitoringJob. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + class GetModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_model_deployment_monitoring_jobs JobService.ListModelDeploymentMonitoringJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the ModelDeploymentMonitoringJob. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + # * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + # * `NOT display_name="my_job"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `labels.keyA=valueA` + # * `labels.keyB:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read + class ListModelDeploymentMonitoringJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#list_model_deployment_monitoring_jobs JobService.ListModelDeploymentMonitoringJobs}. + # @!attribute [rw] model_deployment_monitoring_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>] + # A list of ModelDeploymentMonitoringJobs that matches the specified filter + # in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListModelDeploymentMonitoringJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#update_model_deployment_monitoring_job JobService.UpdateModelDeploymentMonitoringJob}. + # @!attribute [rw] model_deployment_monitoring_job + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob] + # Required. The model monitoring configuration which replaces the resource on + # the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask is used to specify the fields to be overwritten + # in the ModelDeploymentMonitoringJob resource by the update. The fields + # specified in the update_mask are relative to the resource, not the full + # request. A field will be overwritten if it is in the mask. If the user does + # not provide a mask then only the non-empty fields present in the request + # will be overwritten. Set the update_mask to `*` to override all fields. For + # the objective config, the user can either provide the update mask for + # model_deployment_monitoring_objective_configs or any combination of its + # nested fields, such as: + # model_deployment_monitoring_objective_configs.objective_config.training_dataset. + # + # Updatable fields: + # + # * `display_name` + # * `model_deployment_monitoring_schedule_config` + # * `model_monitoring_alert_config` + # * `logging_sampling_strategy` + # * `labels` + # * `log_ttl` + # * `enable_monitoring_pipeline_logs` + # . and + # * `model_deployment_monitoring_objective_configs` + # . or + # * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + # * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + # * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + class UpdateModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#delete_model_deployment_monitoring_job JobService.DeleteModelDeploymentMonitoringJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the model monitoring job to delete. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + class DeleteModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#pause_model_deployment_monitoring_job JobService.PauseModelDeploymentMonitoringJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ModelDeploymentMonitoringJob to pause. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + class PauseModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#resume_model_deployment_monitoring_job JobService.ResumeModelDeploymentMonitoringJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ModelDeploymentMonitoringJob to resume. + # Format: + # `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + class ResumeModelDeploymentMonitoringJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::JobService::Client#update_model_deployment_monitoring_job JobService.UpdateModelDeploymentMonitoringJob}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UpdateModelDeploymentMonitoringJobOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_state.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_state.rb new file mode 100644 index 000000000000..96c15273f4a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/job_state.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Describes the state of a job. + module JobState + # The job state is unspecified. + JOB_STATE_UNSPECIFIED = 0 + + # The job has been just created or resumed and processing has not yet begun. + JOB_STATE_QUEUED = 1 + + # The service is preparing to run the job. + JOB_STATE_PENDING = 2 + + # The job is in progress. + JOB_STATE_RUNNING = 3 + + # The job completed successfully. + JOB_STATE_SUCCEEDED = 4 + + # The job failed. + JOB_STATE_FAILED = 5 + + # The job is being cancelled. From this state the job may only go to + # either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + JOB_STATE_CANCELLING = 6 + + # The job has been cancelled. + JOB_STATE_CANCELLED = 7 + + # The job has been stopped, and can be resumed. + JOB_STATE_PAUSED = 8 + + # The job has expired. + JOB_STATE_EXPIRED = 9 + + # The job is being updated. Only jobs in the `RUNNING` state can be updated. + # After updating, the job goes back to the `RUNNING` state. + JOB_STATE_UPDATING = 10 + + # The job is partially succeeded, some results may be missing due to errors. + JOB_STATE_PARTIALLY_SUCCEEDED = 11 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/lineage_subgraph.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/lineage_subgraph.rb new file mode 100644 index 000000000000..f6e47962be6d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/lineage_subgraph.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A subgraph of the overall lineage graph. Event edges connect Artifact and + # Execution nodes. + # @!attribute [rw] artifacts + # @return [::Array<::Google::Cloud::AIPlatform::V1::Artifact>] + # The Artifact nodes in the subgraph. + # @!attribute [rw] executions + # @return [::Array<::Google::Cloud::AIPlatform::V1::Execution>] + # The Execution nodes in the subgraph. + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::AIPlatform::V1::Event>] + # The Event edges between Artifacts and Executions in the subgraph. + class LineageSubgraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/llm_utility_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/llm_utility_service.rb new file mode 100644 index 000000000000..f1605df4b766 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/llm_utility_service.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for ComputeTokens RPC call. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to get lists of tokens and + # token ids. + # @!attribute [rw] instances + # @return [::Array<::Google::Protobuf::Value>] + # Optional. The instances that are the input to token computing API call. + # Schema is identical to the prediction schema of the text model, even for + # the non-text models, like chat models, or Codey models. + # @!attribute [rw] model + # @return [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # projects/\\{project}/locations/\\{location}/publishers/*/models/* + # @!attribute [rw] contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::Content>] + # Optional. Input content. + class ComputeTokensRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tokens info with a list of tokens and the corresponding list of token ids. + # @!attribute [rw] tokens + # @return [::Array<::String>] + # A list of tokens from the input. + # @!attribute [rw] token_ids + # @return [::Array<::Integer>] + # A list of token ids from the input. + # @!attribute [rw] role + # @return [::String] + # Optional. Optional fields for the role from the corresponding Content. + class TokensInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ComputeTokens RPC call. + # @!attribute [rw] tokens_info + # @return [::Array<::Google::Cloud::AIPlatform::V1::TokensInfo>] + # Lists of tokens info from the input. A ComputeTokensRequest could have + # multiple instances with a prompt in each instance. We also need to return + # lists of tokens info for the request with multiple instances. + class ComputeTokensResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb new file mode 100644 index 000000000000..4ecfeaa5f95e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb @@ -0,0 +1,281 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Specification of a single machine. + # @!attribute [rw] machine_type + # @return [::String] + # Immutable. The type of the machine. + # + # See the [list of machine types supported for + # prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + # + # See the [list of machine types supported for custom + # training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + # + # For {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} this field is + # optional, and the default value is `n1-standard-2`. For + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob} or as + # part of {::Google::Cloud::AIPlatform::V1::WorkerPoolSpec WorkerPoolSpec} this + # field is required. + # @!attribute [rw] accelerator_type + # @return [::Google::Cloud::AIPlatform::V1::AcceleratorType] + # Immutable. The type of accelerator(s) that may be attached to the machine + # as per + # {::Google::Cloud::AIPlatform::V1::MachineSpec#accelerator_count accelerator_count}. + # @!attribute [rw] accelerator_count + # @return [::Integer] + # The number of accelerators to attach to the machine. + # @!attribute [rw] tpu_topology + # @return [::String] + # Immutable. The topology of the TPUs. Corresponds to the TPU topologies + # available from GKE. (Example: tpu_topology: "2x2x1"). + # @!attribute [rw] reservation_affinity + # @return [::Google::Cloud::AIPlatform::V1::ReservationAffinity] + # Optional. Immutable. Configuration controlling how this resource pool + # consumes reservation. + class MachineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A description of resources that are dedicated to a DeployedModel, and + # that need a higher degree of manual configuration. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # Required. Immutable. The specification of a single machine used by the + # prediction. + # @!attribute [rw] min_replica_count + # @return [::Integer] + # Required. Immutable. The minimum number of machine replicas this + # DeployedModel will be always deployed on. This value must be greater than + # or equal to 1. + # + # If traffic against the DeployedModel increases, it may dynamically be + # deployed onto more replicas, and as traffic decreases, some of these extra + # replicas may be freed. + # @!attribute [rw] max_replica_count + # @return [::Integer] + # Immutable. The maximum number of replicas this DeployedModel may be + # deployed on when the traffic against it increases. If the requested value + # is too large, the deployment will error, but if deployment succeeds then + # the ability to scale the model to that many replicas is guaranteed (barring + # service outages). If traffic against the DeployedModel increases beyond + # what its replicas at maximum may handle, a portion of the traffic will be + # dropped. If this value is not provided, will use + # {::Google::Cloud::AIPlatform::V1::DedicatedResources#min_replica_count min_replica_count} + # as the default value. + # + # The value of this field impacts the charge against Vertex CPU and GPU + # quotas. Specifically, you will be charged for (max_replica_count * + # number of cores in the selected machine type) and (max_replica_count * + # number of GPUs per replica in the selected machine type). + # @!attribute [rw] required_replica_count + # @return [::Integer] + # Optional. Number of required available replicas for the deployment to + # succeed. This field is only needed when partial model deployment/mutation + # is desired. If set, the model deploy/mutate operation will succeed once + # available_replica_count reaches required_replica_count, and the rest of + # the replicas will be retried. If not set, the default + # required_replica_count will be min_replica_count. + # @!attribute [rw] autoscaling_metric_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::AutoscalingMetricSpec>] + # Immutable. The metric specifications that overrides a resource + # utilization metric (CPU utilization, accelerator's duty cycle, and so on) + # target value (default to 60 if not set). At most one entry is allowed per + # metric. + # + # If + # {::Google::Cloud::AIPlatform::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} + # is above 0, the autoscaling will be based on both CPU utilization and + # accelerator's duty cycle metrics and scale up when either metrics exceeds + # its target value while scale down if both metrics are under their target + # value. The default target value is 60 for both metrics. + # + # If + # {::Google::Cloud::AIPlatform::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} + # is 0, the autoscaling will be based on CPU utilization metric only with + # default target value 60 if not explicitly set. + # + # For example, in the case of Online Prediction, if you want to override + # target CPU utilization to 80, you should set + # {::Google::Cloud::AIPlatform::V1::AutoscalingMetricSpec#metric_name autoscaling_metric_specs.metric_name} + # to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + # {::Google::Cloud::AIPlatform::V1::AutoscalingMetricSpec#target autoscaling_metric_specs.target} + # to `80`. + # @!attribute [rw] spot + # @return [::Boolean] + # Optional. If true, schedule the deployment workload on [spot + # VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms). + class DedicatedResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A description of resources that to large degree are decided by Vertex AI, + # and require only a modest additional configuration. + # Each Model supporting these resources documents its specific guidelines. + # @!attribute [rw] min_replica_count + # @return [::Integer] + # Immutable. The minimum number of replicas this DeployedModel will be always + # deployed on. If traffic against it increases, it may dynamically be + # deployed onto more replicas up to + # {::Google::Cloud::AIPlatform::V1::AutomaticResources#max_replica_count max_replica_count}, + # and as traffic decreases, some of these extra replicas may be freed. If the + # requested value is too large, the deployment will error. + # @!attribute [rw] max_replica_count + # @return [::Integer] + # Immutable. The maximum number of replicas this DeployedModel may be + # deployed on when the traffic against it increases. If the requested value + # is too large, the deployment will error, but if deployment succeeds then + # the ability to scale the model to that many replicas is guaranteed (barring + # service outages). If traffic against the DeployedModel increases beyond + # what its replicas at maximum may handle, a portion of the traffic will be + # dropped. If this value is not provided, a no upper bound for scaling under + # heavy traffic will be assume, though Vertex AI may be unable to scale + # beyond certain replica number. + class AutomaticResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A description of resources that are used for performing batch operations, are + # dedicated to a Model, and need manual configuration. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # Required. Immutable. The specification of a single machine. + # @!attribute [rw] starting_replica_count + # @return [::Integer] + # Immutable. The number of machine replicas used at the start of the batch + # operation. If not set, Vertex AI decides starting number, not greater than + # {::Google::Cloud::AIPlatform::V1::BatchDedicatedResources#max_replica_count max_replica_count} + # @!attribute [rw] max_replica_count + # @return [::Integer] + # Immutable. The maximum number of machine replicas the batch operation may + # be scaled to. The default value is 10. + class BatchDedicatedResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Statistics information about resource consumption. + # @!attribute [r] replica_hours + # @return [::Float] + # Output only. The number of replica hours used. Note that many replicas may + # run in parallel, and additionally any given work may be queued for some + # time. Therefore this value is not strictly related to wall time. + class ResourcesConsumed + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec of disk options. + # @!attribute [rw] boot_disk_type + # @return [::String] + # Type of the boot disk (default is "pd-ssd"). + # Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or + # "pd-standard" (Persistent Disk Hard Disk Drive). + # @!attribute [rw] boot_disk_size_gb + # @return [::Integer] + # Size in GB of the boot disk (default is 100GB). + class DiskSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec of [persistent + # disk][https://cloud.google.com/compute/docs/disks/persistent-disks] options. + # @!attribute [rw] disk_type + # @return [::String] + # Type of the disk (default is "pd-standard"). + # Valid values: "pd-ssd" (Persistent Disk Solid State Drive) + # "pd-standard" (Persistent Disk Hard Disk Drive) + # "pd-balanced" (Balanced Persistent Disk) + # "pd-extreme" (Extreme Persistent Disk) + # @!attribute [rw] disk_size_gb + # @return [::Integer] + # Size in GB of the disk (default is 100GB). + class PersistentDiskSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a mount configuration for Network File System (NFS) to mount. + # @!attribute [rw] server + # @return [::String] + # Required. IP address of the NFS server. + # @!attribute [rw] path + # @return [::String] + # Required. Source path exported from NFS server. + # Has to start with '/', and combined with the ip address, it indicates + # the source mount path in the form of `server:path` + # @!attribute [rw] mount_point + # @return [::String] + # Required. Destination mount path. The NFS will be mounted for the user + # under /mnt/nfs/ + class NfsMount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metric specification that defines the target resource utilization + # (CPU utilization, accelerator's duty cycle, and so on) for calculating the + # desired replica count. + # @!attribute [rw] metric_name + # @return [::String] + # Required. The resource metric name. + # Supported metrics: + # + # * For Online Prediction: + # * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + # * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + # @!attribute [rw] target + # @return [::Integer] + # The target resource utilization in percentage (1% - 100%) for the given + # metric; once the real usage deviates from the target by a certain + # percentage, the machine replicas change. The default value is 60 + # (representing 60%) if not provided. + class AutoscalingMetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of Shielded Instance options. + # See [Images using supported Shielded VM + # features](https://cloud.google.com/compute/docs/instances/modifying-shielded-vm). + # @!attribute [rw] enable_secure_boot + # @return [::Boolean] + # Defines whether the instance has [Secure + # Boot](https://cloud.google.com/compute/shielded-vm/docs/shielded-vm#secure-boot) + # enabled. + # + # Secure Boot helps ensure that the system only runs authentic software by + # verifying the digital signature of all boot components, and halting the + # boot process if signature verification fails. + class ShieldedVmConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.rb new file mode 100644 index 000000000000..89d37f693a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Manual batch tuning parameters. + # @!attribute [rw] batch_size + # @return [::Integer] + # Immutable. The number of the records (e.g. instances) of the operation + # given in each batch to a machine replica. Machine type, and size of a + # single record should be considered when setting this parameter, higher + # value speeds up the batch operation's execution, but too high value will + # result in a whole batch not fitting in a machine's memory, and the whole + # operation will fail. + # The default value is 64. + class ManualBatchTuningParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/match_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/match_service.rb new file mode 100644 index 000000000000..3e0a55bb0f90 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/match_service.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The request message for + # {::Google::Cloud::AIPlatform::V1::MatchService::Client#find_neighbors MatchService.FindNeighbors}. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index_id + # @return [::String] + # The ID of the DeployedIndex that will serve the request. This request is + # sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + # IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + # has a DeployedIndex.id field. + # The value of the field below must equal one of the DeployedIndex.id + # fields of the IndexEndpoint that is being called for this request. + # @!attribute [rw] queries + # @return [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsRequest::Query>] + # The list of queries. + # @!attribute [rw] return_full_datapoint + # @return [::Boolean] + # If set to true, the full datapoints (including all vector values and + # restricts) of the nearest neighbors are returned. + # Note that returning full datapoint will significantly increase the + # latency and cost of the query. + class FindNeighborsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A query to find a number of the nearest neighbors (most similar vectors) + # of a vector. + # @!attribute [rw] rrf + # @return [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest::Query::RRF] + # Optional. Represents RRF algorithm that combines search results. + # @!attribute [rw] datapoint + # @return [::Google::Cloud::AIPlatform::V1::IndexDatapoint] + # Required. The datapoint/vector whose nearest neighbors should be searched + # for. + # @!attribute [rw] neighbor_count + # @return [::Integer] + # The number of nearest neighbors to be retrieved from database for each + # query. If not set, will use the default from the service configuration + # (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config). + # @!attribute [rw] per_crowding_attribute_neighbor_count + # @return [::Integer] + # Crowding is a constraint on a neighbor list produced by nearest neighbor + # search requiring that no more than some value k' of the k neighbors + # returned have the same value of crowding_attribute. + # It's used for improving result diversity. + # This field is the maximum number of matches with the same crowding tag. + # @!attribute [rw] approximate_neighbor_count + # @return [::Integer] + # The number of neighbors to find via approximate search before + # exact reordering is performed. If not set, the default value from scam + # config is used; if set, this value must be > 0. + # @!attribute [rw] fraction_leaf_nodes_to_search_override + # @return [::Float] + # The fraction of the number of leaves to search, set at query time allows + # user to tune search performance. This value increase result in both + # search accuracy and latency increase. The value should be between 0.0 + # and 1.0. If not set or set to 0.0, query uses the default value specified + # in + # NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. + class Query + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parameters for RRF algorithm that combines search results. + # @!attribute [rw] alpha + # @return [::Float] + # Required. Users can provide an alpha value to give more weight to dense + # vs sparse results. For example, if the alpha is 0, we only return + # sparse and if the alpha is 1, we only return dense. + class RRF + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The response message for + # {::Google::Cloud::AIPlatform::V1::MatchService::Client#find_neighbors MatchService.FindNeighbors}. + # @!attribute [rw] nearest_neighbors + # @return [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsResponse::NearestNeighbors>] + # The nearest neighbors of the query datapoints. + class FindNeighborsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A neighbor of the query vector. + # @!attribute [rw] datapoint + # @return [::Google::Cloud::AIPlatform::V1::IndexDatapoint] + # The datapoint of the neighbor. + # Note that full datapoints are returned only when "return_full_datapoint" + # is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" + # fields are populated. + # @!attribute [rw] distance + # @return [::Float] + # The distance between the neighbor and the dense embedding query. + # @!attribute [rw] sparse_distance + # @return [::Float] + # The distance between the neighbor and the query sparse_embedding. + class Neighbor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Nearest neighbors for one query. + # @!attribute [rw] id + # @return [::String] + # The ID of the query datapoint. + # @!attribute [rw] neighbors + # @return [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsResponse::Neighbor>] + # All its neighbors. + class NearestNeighbors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::AIPlatform::V1::MatchService::Client#read_index_datapoints MatchService.ReadIndexDatapoints}. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The name of the index endpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index_id + # @return [::String] + # The ID of the DeployedIndex that will serve the request. + # @!attribute [rw] ids + # @return [::Array<::String>] + # IDs of the datapoints to be searched for. + class ReadIndexDatapointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::AIPlatform::V1::MatchService::Client#read_index_datapoints MatchService.ReadIndexDatapoints}. + # @!attribute [rw] datapoints + # @return [::Array<::Google::Cloud::AIPlatform::V1::IndexDatapoint>] + # The result list of datapoints. + class ReadIndexDatapointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_schema.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_schema.rb new file mode 100644 index 000000000000..d6185eccf5b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_schema.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Instance of a general MetadataSchema. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the MetadataSchema. + # @!attribute [rw] schema_version + # @return [::String] + # The version of the MetadataSchema. The version's format must match + # the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would + # allow to order/compare different versions. Example: 1.0.0, 1.0.1, etc. + # @!attribute [rw] schema + # @return [::String] + # Required. The raw YAML string representation of the MetadataSchema. The + # combination of [MetadataSchema.version] and the schema name given by + # `title` in [MetadataSchema.schema] must be unique within a MetadataStore. + # + # The schema is defined as an OpenAPI 3.0.2 + # [MetadataSchema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) + # @!attribute [rw] schema_type + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema::MetadataSchemaType] + # The type of the MetadataSchema. This is a property that identifies which + # metadata types will use the MetadataSchema. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this MetadataSchema was created. + # @!attribute [rw] description + # @return [::String] + # Description of the Metadata Schema + class MetadataSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the type of the MetadataSchema. + module MetadataSchemaType + # Unspecified type for the MetadataSchema. + METADATA_SCHEMA_TYPE_UNSPECIFIED = 0 + + # A type indicating that the MetadataSchema will be used by Artifacts. + ARTIFACT_TYPE = 1 + + # A typee indicating that the MetadataSchema will be used by Executions. + EXECUTION_TYPE = 2 + + # A state indicating that the MetadataSchema will be used by Contexts. + CONTEXT_TYPE = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb new file mode 100644 index 000000000000..7a9dded1a045 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb @@ -0,0 +1,1023 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_metadata_store MetadataService.CreateMetadataStore}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location where the MetadataStore should + # be created. + # Format: `projects/{project}/locations/{location}/` + # @!attribute [rw] metadata_store + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore] + # Required. The MetadataStore to create. + # @!attribute [rw] metadata_store_id + # @return [::String] + # The \\{metadatastore} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataStores in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataStore.) + class CreateMetadataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_metadata_store MetadataService.CreateMetadataStore}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for creating a MetadataStore. + class CreateMetadataStoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#get_metadata_store MetadataService.GetMetadataStore}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the MetadataStore to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + class GetMetadataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_stores MetadataService.ListMetadataStores}. + # @!attribute [rw] parent + # @return [::String] + # Required. The Location whose MetadataStores should be listed. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Metadata Stores to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_stores MetadataService.ListMetadataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + class ListMetadataStoresRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_stores MetadataService.ListMetadataStores}. + # @!attribute [rw] metadata_stores + # @return [::Array<::Google::Cloud::AIPlatform::V1::MetadataStore>] + # The MetadataStores found for the Location. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest#page_token ListMetadataStoresRequest.page_token} + # to retrieve the next page. If this field is not populated, there are no + # subsequent pages. + class ListMetadataStoresResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_metadata_store MetadataService.DeleteMetadataStore}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the MetadataStore to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] force + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Deprecated: Field is no longer supported. + class DeleteMetadataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_metadata_store MetadataService.DeleteMetadataStore}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for deleting a MetadataStore. + class DeleteMetadataStoreOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_artifact MetadataService.CreateArtifact}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the MetadataStore where the Artifact should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] artifact + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # Required. The Artifact to create. + # @!attribute [rw] artifact_id + # @return [::String] + # The \\{artifact} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # If not provided, the Artifact's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Artifact.) + class CreateArtifactRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#get_artifact MetadataService.GetArtifact}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Artifact to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + class GetArtifactRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_artifacts MetadataService.ListArtifacts}. + # @!attribute [rw] parent + # @return [::String] + # Required. The MetadataStore whose Artifacts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Artifacts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_artifacts MetadataService.ListArtifacts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @!attribute [rw] filter + # @return [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Artifacts based on the contexts to which they belong, use the + # function operator with the full resource name + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @!attribute [rw] order_by + # @return [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + class ListArtifactsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_artifacts MetadataService.ListArtifacts}. + # @!attribute [rw] artifacts + # @return [::Array<::Google::Cloud::AIPlatform::V1::Artifact>] + # The Artifacts retrieved from the MetadataStore. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListArtifactsRequest#page_token ListArtifactsRequest.page_token} + # to retrieve the next page. + # If this field is not populated, there are no subsequent pages. + class ListArtifactsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#update_artifact MetadataService.UpdateArtifact}. + # @!attribute [rw] artifact + # @return [::Google::Cloud::AIPlatform::V1::Artifact] + # Required. The Artifact containing updates. + # The Artifact's {::Google::Cloud::AIPlatform::V1::Artifact#name Artifact.name} + # field is used to identify the Artifact to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. A FieldMask indicating which fields should be updated. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is + # created. + class UpdateArtifactRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_artifact MetadataService.DeleteArtifact}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Artifact to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the Artifact to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + class DeleteArtifactRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_artifacts MetadataService.PurgeArtifacts}. + # @!attribute [rw] parent + # @return [::String] + # Required. The metadata store to purge Artifacts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] filter + # @return [::String] + # Required. A required filter matching the Artifacts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Artifact names that would be deleted. + class PurgeArtifactsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_artifacts MetadataService.PurgeArtifacts}. + # @!attribute [rw] purge_count + # @return [::Integer] + # The number of Artifacts that this request deleted (or, if `force` is false, + # the number of Artifacts that will be deleted). This can be an estimate. + # @!attribute [rw] purge_sample + # @return [::Array<::String>] + # A sample of the Artifact names that will be deleted. + # Only populated if `force` is set to false. The maximum number of samples is + # 100 (it is possible to return fewer). + class PurgeArtifactsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_artifacts MetadataService.PurgeArtifacts}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for purging Artifacts. + class PurgeArtifactsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_context MetadataService.CreateContext}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the MetadataStore where the Context should + # be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] context + # @return [::Google::Cloud::AIPlatform::V1::Context] + # Required. The Context to create. + # @!attribute [rw] context_id + # @return [::String] + # The \\{context} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + # If not provided, the Context's ID will be a UUID generated by the service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Contexts in the parent MetadataStore. (Otherwise + # the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + # caller can't view the preexisting Context.) + class CreateContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#get_context MetadataService.GetContext}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Context to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + class GetContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_contexts MetadataService.ListContexts} + # @!attribute [rw] parent + # @return [::String] + # Required. The MetadataStore whose Contexts should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Contexts to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_contexts MetadataService.ListContexts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @!attribute [rw] filter + # @return [::String] + # Filter specifying the boolean condition for the Contexts to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `schema_title`, + # `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0`. + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Parent Child filtering**: + # To filter Contexts based on parent-child relationship use the HAS + # operator as follows: + # + # ``` + # parent_contexts: + # "projects//locations//metadataStores//contexts/" + # child_contexts: + # "projects//locations//metadataStores//contexts/" + # ``` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @!attribute [rw] order_by + # @return [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + class ListContextsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_contexts MetadataService.ListContexts}. + # @!attribute [rw] contexts + # @return [::Array<::Google::Cloud::AIPlatform::V1::Context>] + # The Contexts retrieved from the MetadataStore. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListContextsRequest#page_token ListContextsRequest.page_token} + # to retrieve the next page. + # If this field is not populated, there are no subsequent pages. + class ListContextsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#update_context MetadataService.UpdateContext}. + # @!attribute [rw] context + # @return [::Google::Cloud::AIPlatform::V1::Context] + # Required. The Context containing updates. + # The Context's {::Google::Cloud::AIPlatform::V1::Context#name Context.name} field + # is used to identify the Context to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. A FieldMask indicating which fields should be updated. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Context Context} is + # not found, a new {::Google::Cloud::AIPlatform::V1::Context Context} is created. + class UpdateContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_context MetadataService.DeleteContext}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Context to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @!attribute [rw] force + # @return [::Boolean] + # The force deletion semantics is still undefined. + # Users should not use this field. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the Context to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + class DeleteContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_contexts MetadataService.PurgeContexts}. + # @!attribute [rw] parent + # @return [::String] + # Required. The metadata store to purge Contexts from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] filter + # @return [::String] + # Required. A required filter matching the Contexts to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Context names that would be deleted. + class PurgeContextsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_contexts MetadataService.PurgeContexts}. + # @!attribute [rw] purge_count + # @return [::Integer] + # The number of Contexts that this request deleted (or, if `force` is false, + # the number of Contexts that will be deleted). This can be an estimate. + # @!attribute [rw] purge_sample + # @return [::Array<::String>] + # A sample of the Context names that will be deleted. + # Only populated if `force` is set to false. The maximum number of samples is + # 100 (it is possible to return fewer). + class PurgeContextsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_contexts MetadataService.PurgeContexts}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for purging Contexts. + class PurgeContextsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_artifacts_and_executions MetadataService.AddContextArtifactsAndExecutions}. + # @!attribute [rw] context + # @return [::String] + # Required. The resource name of the Context that the Artifacts and + # Executions belong to. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @!attribute [rw] artifacts + # @return [::Array<::String>] + # The resource names of the Artifacts to attribute to the Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # @!attribute [rw] executions + # @return [::Array<::String>] + # The resource names of the Executions to associate with the + # Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + class AddContextArtifactsAndExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_artifacts_and_executions MetadataService.AddContextArtifactsAndExecutions}. + class AddContextArtifactsAndExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_children MetadataService.AddContextChildren}. + # @!attribute [rw] context + # @return [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @!attribute [rw] child_contexts + # @return [::Array<::String>] + # The resource names of the child Contexts. + class AddContextChildrenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_children MetadataService.AddContextChildren}. + class AddContextChildrenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # [MetadataService.DeleteContextChildrenRequest][]. + # @!attribute [rw] context + # @return [::String] + # Required. The resource name of the parent Context. + # + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # @!attribute [rw] child_contexts + # @return [::Array<::String>] + # The resource names of the child Contexts. + class RemoveContextChildrenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#remove_context_children MetadataService.RemoveContextChildren}. + class RemoveContextChildrenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#query_context_lineage_subgraph MetadataService.QueryContextLineageSubgraph}. + # @!attribute [rw] context + # @return [::String] + # Required. The resource name of the Context whose Artifacts and Executions + # should be retrieved as a LineageSubgraph. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + class QueryContextLineageSubgraphRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_execution MetadataService.CreateExecution}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the MetadataStore where the Execution should + # be created. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] execution + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # Required. The Execution to create. + # @!attribute [rw] execution_id + # @return [::String] + # The \\{execution} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # If not provided, the Execution's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all Executions in the parent MetadataStore. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting Execution.) + class CreateExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#get_execution MetadataService.GetExecution}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Execution to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + class GetExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_executions MetadataService.ListExecutions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The MetadataStore whose Executions should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Executions to return. The service may return fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_executions MetadataService.ListExecutions} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with an + # INVALID_ARGUMENT error.) + # @!attribute [rw] filter + # @return [::String] + # Filter specifying the boolean condition for the Executions to satisfy in + # order to be part of the result set. + # The syntax to define filter query is based on https://google.aip.dev/160. + # Following are the supported set of filters: + # + # * **Attribute filtering**: + # For example: `display_name = "test"`. + # Supported fields include: `name`, `display_name`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"`. + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..` + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # * **Context based filtering**: + # To filter Executions based on the contexts to which they belong use + # the function operator with the full resource name: + # `in_context()`. + # For example: + # `in_context("projects//locations//metadataStores//contexts/")` + # + # Each of the above supported filters can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + # @!attribute [rw] order_by + # @return [::String] + # How the list of messages is ordered. Specify the values to order by and an + # ordering operation. The default sorting order is ascending. To specify + # descending order for a field, users append a " desc" suffix; for example: + # "foo desc, bar". + # Subfields are specified with a `.` character, such as foo.bar. + # see https://google.aip.dev/132#ordering for more details. + class ListExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_executions MetadataService.ListExecutions}. + # @!attribute [rw] executions + # @return [::Array<::Google::Cloud::AIPlatform::V1::Execution>] + # The Executions retrieved from the MetadataStore. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListExecutionsRequest#page_token ListExecutionsRequest.page_token} + # to retrieve the next page. + # If this field is not populated, there are no subsequent pages. + class ListExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#update_execution MetadataService.UpdateExecution}. + # @!attribute [rw] execution + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # Required. The Execution containing updates. + # The Execution's {::Google::Cloud::AIPlatform::V1::Execution#name Execution.name} + # field is used to identify the Execution to be updated. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. A FieldMask indicating which fields should be updated. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::AIPlatform::V1::Execution Execution} + # is not found, a new {::Google::Cloud::AIPlatform::V1::Execution Execution} is + # created. + class UpdateExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_execution MetadataService.DeleteExecution}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Execution to delete. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the Execution to delete. + # If this is provided, it must match the server's etag. Otherwise, the + # request will fail with a FAILED_PRECONDITION. + class DeleteExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_executions MetadataService.PurgeExecutions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The metadata store to purge Executions from. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] filter + # @return [::String] + # Required. A required filter matching the Executions to be purged. + # E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. Flag to indicate to actually perform the purge. + # If `force` is set to false, the method will return a sample of + # Execution names that would be deleted. + class PurgeExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_executions MetadataService.PurgeExecutions}. + # @!attribute [rw] purge_count + # @return [::Integer] + # The number of Executions that this request deleted (or, if `force` is + # false, the number of Executions that will be deleted). This can be an + # estimate. + # @!attribute [rw] purge_sample + # @return [::Array<::String>] + # A sample of the Execution names that will be deleted. + # Only populated if `force` is set to false. The maximum number of samples is + # 100 (it is possible to return fewer). + class PurgeExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_executions MetadataService.PurgeExecutions}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for purging Executions. + class PurgeExecutionsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_execution_events MetadataService.AddExecutionEvents}. + # @!attribute [rw] execution + # @return [::String] + # Required. The resource name of the Execution that the Events connect + # Artifacts with. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::AIPlatform::V1::Event>] + # The Events to create and add. + class AddExecutionEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#add_execution_events MetadataService.AddExecutionEvents}. + class AddExecutionEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#query_execution_inputs_and_outputs MetadataService.QueryExecutionInputsAndOutputs}. + # @!attribute [rw] execution + # @return [::String] + # Required. The resource name of the Execution whose input and output + # Artifacts should be retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + class QueryExecutionInputsAndOutputsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#create_metadata_schema MetadataService.CreateMetadataSchema}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the MetadataStore where the MetadataSchema + # should be created. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] metadata_schema + # @return [::Google::Cloud::AIPlatform::V1::MetadataSchema] + # Required. The MetadataSchema to create. + # @!attribute [rw] metadata_schema_id + # @return [::String] + # The \\{metadata_schema} portion of the resource name with the format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + # If not provided, the MetadataStore's ID will be a UUID generated by the + # service. + # Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + # Must be unique across all MetadataSchemas in the parent Location. + # (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + # if the caller can't view the preexisting MetadataSchema.) + class CreateMetadataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#get_metadata_schema MetadataService.GetMetadataSchema}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the MetadataSchema to retrieve. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + class GetMetadataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_schemas MetadataService.ListMetadataSchemas}. + # @!attribute [rw] parent + # @return [::String] + # Required. The MetadataStore whose MetadataSchemas should be listed. + # Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of MetadataSchemas to return. The service may return + # fewer. + # Must be in range 1-1000, inclusive. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_schemas MetadataService.ListMetadataSchemas} + # call. Provide this to retrieve the next page. + # + # When paginating, all other provided parameters must match the call that + # provided the page token. (Otherwise the request will fail with + # INVALID_ARGUMENT error.) + # @!attribute [rw] filter + # @return [::String] + # A query to filter available MetadataSchemas for matching results. + class ListMetadataSchemasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_schemas MetadataService.ListMetadataSchemas}. + # @!attribute [rw] metadata_schemas + # @return [::Array<::Google::Cloud::AIPlatform::V1::MetadataSchema>] + # The MetadataSchemas found for the MetadataStore. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest#page_token ListMetadataSchemasRequest.page_token} + # to retrieve the next page. If this field is not populated, there are no + # subsequent pages. + class ListMetadataSchemasResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MetadataService::Client#query_artifact_lineage_subgraph MetadataService.QueryArtifactLineageSubgraph}. + # @!attribute [rw] artifact + # @return [::String] + # Required. The resource name of the Artifact whose Lineage needs to be + # retrieved as a LineageSubgraph. Format: + # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + # + # The request may error with FAILED_PRECONDITION if the number of Artifacts, + # the number of Executions, or the number of Events that would be returned + # for the Context exceeds 1000. + # @!attribute [rw] max_hops + # @return [::Integer] + # Specifies the size of the lineage graph in terms of number of hops from the + # specified artifact. + # Negative Value: INVALID_ARGUMENT error is returned + # 0: Only input artifact is returned. + # No value: Transitive closure is performed to return the complete graph. + # @!attribute [rw] filter + # @return [::String] + # Filter specifying the boolean condition for the Artifacts to satisfy in + # order to be part of the Lineage Subgraph. + # The syntax to define filter query is based on https://google.aip.dev/160. + # The supported set of filters include the following: + # + # * **Attribute filtering**: + # For example: `display_name = "test"` + # Supported fields include: `name`, `display_name`, `uri`, `state`, + # `schema_title`, `create_time`, and `update_time`. + # Time fields, such as `create_time` and `update_time`, require values + # specified in RFC-3339 format. + # For example: `create_time = "2020-11-19T11:30:00-04:00"` + # * **Metadata field**: + # To filter on metadata fields use traversal operation as follows: + # `metadata..`. + # For example: `metadata.field_1.number_value = 10.0` + # In case the field name contains special characters (such as colon), one + # can embed it inside double quote. + # For example: `metadata."field:1".number_value = 10.0` + # + # Each of the above supported filter types can be combined together using + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # + # For example: `display_name = "test" AND metadata.field1.bool_value = true`. + class QueryArtifactLineageSubgraphRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_store.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_store.rb new file mode 100644 index 000000000000..9ba48c2e2680 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_store.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Instance of a metadata store. Contains a set of metadata that can be + # queried. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the MetadataStore instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this MetadataStore was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this MetadataStore was last updated. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a Metadata Store. If set, this + # Metadata Store and all sub-resources of this Metadata Store are secured + # using this key. + # @!attribute [rw] description + # @return [::String] + # Description of the MetadataStore. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore::MetadataStoreState] + # Output only. State information of the MetadataStore. + # @!attribute [rw] dataplex_config + # @return [::Google::Cloud::AIPlatform::V1::MetadataStore::DataplexConfig] + # Optional. Dataplex integration settings. + class MetadataStore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents state information for a MetadataStore. + # @!attribute [rw] disk_utilization_bytes + # @return [::Integer] + # The disk utilization of the MetadataStore in bytes. + class MetadataStoreState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents Dataplex integration settings. + # @!attribute [rw] enabled_pipelines_lineage + # @return [::Boolean] + # Optional. Whether or not Data Lineage synchronization is enabled for + # Vertex Pipelines. + class DataplexConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migratable_resource.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migratable_resource.rb new file mode 100644 index 000000000000..fd9ac060f5e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migratable_resource.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents one resource that exists in automl.googleapis.com, + # datalabeling.googleapis.com or ml.googleapis.com. + # @!attribute [r] ml_engine_model_version + # @return [::Google::Cloud::AIPlatform::V1::MigratableResource::MlEngineModelVersion] + # Output only. Represents one Version in ml.googleapis.com. + # @!attribute [r] automl_model + # @return [::Google::Cloud::AIPlatform::V1::MigratableResource::AutomlModel] + # Output only. Represents one Model in automl.googleapis.com. + # @!attribute [r] automl_dataset + # @return [::Google::Cloud::AIPlatform::V1::MigratableResource::AutomlDataset] + # Output only. Represents one Dataset in automl.googleapis.com. + # @!attribute [r] data_labeling_dataset + # @return [::Google::Cloud::AIPlatform::V1::MigratableResource::DataLabelingDataset] + # Output only. Represents one Dataset in datalabeling.googleapis.com. + # @!attribute [r] last_migrate_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the last migration attempt on this + # MigratableResource started. Will not be set if there's no migration attempt + # on this MigratableResource. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this MigratableResource was last updated. + class MigratableResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents one model Version in ml.googleapis.com. + # @!attribute [rw] endpoint + # @return [::String] + # The ml.googleapis.com endpoint that this model Version currently lives + # in. + # Example values: + # + # * ml.googleapis.com + # * us-centrall-ml.googleapis.com + # * europe-west4-ml.googleapis.com + # * asia-east1-ml.googleapis.com + # @!attribute [rw] version + # @return [::String] + # Full resource name of ml engine model Version. + # Format: `projects/{project}/models/{model}/versions/{version}`. + class MlEngineModelVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents one Model in automl.googleapis.com. + # @!attribute [rw] model + # @return [::String] + # Full resource name of automl Model. + # Format: + # `projects/{project}/locations/{location}/models/{model}`. + # @!attribute [rw] model_display_name + # @return [::String] + # The Model's display name in automl.googleapis.com. + class AutomlModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents one Dataset in automl.googleapis.com. + # @!attribute [rw] dataset + # @return [::String] + # Full resource name of automl Dataset. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}`. + # @!attribute [rw] dataset_display_name + # @return [::String] + # The Dataset's display name in automl.googleapis.com. + class AutomlDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents one Dataset in datalabeling.googleapis.com. + # @!attribute [rw] dataset + # @return [::String] + # Full resource name of data labeling Dataset. + # Format: + # `projects/{project}/datasets/{dataset}`. + # @!attribute [rw] dataset_display_name + # @return [::String] + # The Dataset's display name in datalabeling.googleapis.com. + # @!attribute [rw] data_labeling_annotated_datasets + # @return [::Array<::Google::Cloud::AIPlatform::V1::MigratableResource::DataLabelingDataset::DataLabelingAnnotatedDataset>] + # The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to + # the data labeling Dataset. + class DataLabelingDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents one AnnotatedDataset in datalabeling.googleapis.com. + # @!attribute [rw] annotated_dataset + # @return [::String] + # Full resource name of data labeling AnnotatedDataset. + # Format: + # `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + # @!attribute [rw] annotated_dataset_display_name + # @return [::String] + # The AnnotatedDataset's display name in datalabeling.googleapis.com. + class DataLabelingAnnotatedDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migration_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migration_service.rb new file mode 100644 index 000000000000..2ea19fd63c7c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/migration_service.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::MigrationService::Client#search_migratable_resources MigrationService.SearchMigratableResources}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location that the migratable resources should be searched + # from. It's the Vertex AI location that the resources can be migrated to, + # not the resources' original location. Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard page size. + # The default and maximum value is 100. + # @!attribute [rw] page_token + # @return [::String] + # The standard page token. + # @!attribute [rw] filter + # @return [::String] + # A filter for your search. You can use the following types of filters: + # + # * Resource type filters. The following strings filter for a specific type + # of {::Google::Cloud::AIPlatform::V1::MigratableResource MigratableResource}: + # * `ml_engine_model_version:*` + # * `automl_model:*` + # * `automl_dataset:*` + # * `data_labeling_dataset:*` + # * "Migrated or not" filters. The following strings filter for resources + # that either have or have not already been migrated: + # * `last_migrate_time:*` filters for migrated resources. + # * `NOT last_migrate_time:*` filters for not yet migrated resources. + class SearchMigratableResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MigrationService::Client#search_migratable_resources MigrationService.SearchMigratableResources}. + # @!attribute [rw] migratable_resources + # @return [::Array<::Google::Cloud::AIPlatform::V1::MigratableResource>] + # All migratable resources that can be migrated to the + # location specified in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard next-page token. + # The migratable_resources may not fill page_size in + # SearchMigratableResourcesRequest even when there are subsequent pages. + class SearchMigratableResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::MigrationService::Client#batch_migrate_resources MigrationService.BatchMigrateResources}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location of the migrated resource will live in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] migrate_resource_requests + # @return [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceRequest>] + # Required. The request messages specifying the resources to migrate. + # They must be in the same location as the destination. + # Up to 50 resources can be migrated in one batch. + class BatchMigrateResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config of migrating one resource from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # @!attribute [rw] migrate_ml_engine_model_version_config + # @return [::Google::Cloud::AIPlatform::V1::MigrateResourceRequest::MigrateMlEngineModelVersionConfig] + # Config for migrating Version in ml.googleapis.com to Vertex AI's Model. + # @!attribute [rw] migrate_automl_model_config + # @return [::Google::Cloud::AIPlatform::V1::MigrateResourceRequest::MigrateAutomlModelConfig] + # Config for migrating Model in automl.googleapis.com to Vertex AI's + # Model. + # @!attribute [rw] migrate_automl_dataset_config + # @return [::Google::Cloud::AIPlatform::V1::MigrateResourceRequest::MigrateAutomlDatasetConfig] + # Config for migrating Dataset in automl.googleapis.com to Vertex AI's + # Dataset. + # @!attribute [rw] migrate_data_labeling_dataset_config + # @return [::Google::Cloud::AIPlatform::V1::MigrateResourceRequest::MigrateDataLabelingDatasetConfig] + # Config for migrating Dataset in datalabeling.googleapis.com to + # Vertex AI's Dataset. + class MigrateResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Config for migrating version in ml.googleapis.com to Vertex AI's Model. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The ml.googleapis.com endpoint that this model version should + # be migrated from. Example values: + # + # * ml.googleapis.com + # + # * us-centrall-ml.googleapis.com + # + # * europe-west4-ml.googleapis.com + # + # * asia-east1-ml.googleapis.com + # @!attribute [rw] model_version + # @return [::String] + # Required. Full resource name of ml engine model version. + # Format: `projects/{project}/models/{model}/versions/{version}`. + # @!attribute [rw] model_display_name + # @return [::String] + # Required. Display name of the model in Vertex AI. + # System will pick a display name if unspecified. + class MigrateMlEngineModelVersionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for migrating Model in automl.googleapis.com to Vertex AI's Model. + # @!attribute [rw] model + # @return [::String] + # Required. Full resource name of automl Model. + # Format: + # `projects/{project}/locations/{location}/models/{model}`. + # @!attribute [rw] model_display_name + # @return [::String] + # Optional. Display name of the model in Vertex AI. + # System will pick a display name if unspecified. + class MigrateAutomlModelConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for migrating Dataset in automl.googleapis.com to Vertex AI's + # Dataset. + # @!attribute [rw] dataset + # @return [::String] + # Required. Full resource name of automl Dataset. + # Format: + # `projects/{project}/locations/{location}/datasets/{dataset}`. + # @!attribute [rw] dataset_display_name + # @return [::String] + # Required. Display name of the Dataset in Vertex AI. + # System will pick a display name if unspecified. + class MigrateAutomlDatasetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for migrating Dataset in datalabeling.googleapis.com to Vertex + # AI's Dataset. + # @!attribute [rw] dataset + # @return [::String] + # Required. Full resource name of data labeling Dataset. + # Format: + # `projects/{project}/datasets/{dataset}`. + # @!attribute [rw] dataset_display_name + # @return [::String] + # Optional. Display name of the Dataset in Vertex AI. + # System will pick a display name if unspecified. + # @!attribute [rw] migrate_data_labeling_annotated_dataset_configs + # @return [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceRequest::MigrateDataLabelingDatasetConfig::MigrateDataLabelingAnnotatedDatasetConfig>] + # Optional. Configs for migrating AnnotatedDataset in + # datalabeling.googleapis.com to Vertex AI's SavedQuery. The specified + # AnnotatedDatasets have to belong to the datalabeling Dataset. + class MigrateDataLabelingDatasetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Config for migrating AnnotatedDataset in datalabeling.googleapis.com to + # Vertex AI's SavedQuery. + # @!attribute [rw] annotated_dataset + # @return [::String] + # Required. Full resource name of data labeling AnnotatedDataset. + # Format: + # `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + class MigrateDataLabelingAnnotatedDatasetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::MigrationService::Client#batch_migrate_resources MigrationService.BatchMigrateResources}. + # @!attribute [rw] migrate_resource_responses + # @return [::Array<::Google::Cloud::AIPlatform::V1::MigrateResourceResponse>] + # Successfully migrated resources. + class BatchMigrateResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes a successfully migrated resource. + # @!attribute [rw] dataset + # @return [::String] + # Migrated Dataset's resource name. + # @!attribute [rw] model + # @return [::String] + # Migrated Model's resource name. + # @!attribute [rw] migratable_resource + # @return [::Google::Cloud::AIPlatform::V1::MigratableResource] + # Before migration, the identifier in ml.googleapis.com, + # automl.googleapis.com or datalabeling.googleapis.com. + class MigrateResourceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::MigrationService::Client#batch_migrate_resources MigrationService.BatchMigrateResources}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + # @!attribute [rw] partial_results + # @return [::Array<::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesOperationMetadata::PartialResult>] + # Partial results that reflect the latest migration operation progress. + class BatchMigrateResourcesOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a partial result in batch migration operation for one + # {::Google::Cloud::AIPlatform::V1::MigrateResourceRequest MigrateResourceRequest}. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the migration request in case of failure. + # @!attribute [rw] model + # @return [::String] + # Migrated model resource name. + # @!attribute [rw] dataset + # @return [::String] + # Migrated dataset resource name. + # @!attribute [rw] request + # @return [::Google::Cloud::AIPlatform::V1::MigrateResourceRequest] + # It's the same as the value in + # {::Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest#migrate_resource_requests BatchMigrateResourcesRequest.migrate_resource_requests}. + class PartialResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb new file mode 100644 index 000000000000..2d243a58b13f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb @@ -0,0 +1,873 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A trained machine learning Model. + # @!attribute [rw] name + # @return [::String] + # The resource name of the Model. + # @!attribute [r] version_id + # @return [::String] + # Output only. Immutable. The version ID of the model. + # A new version is committed when a new model version is uploaded or + # trained under an existing model id. It is an auto-incrementing decimal + # number in string representation. + # @!attribute [rw] version_aliases + # @return [::Array<::String>] + # User provided version aliases so that a model version can be referenced via + # alias (i.e. + # `projects/{project}/locations/{location}/models/{model_id}@{version_alias}` + # instead of auto-generated version id (i.e. + # `projects/{project}/locations/{location}/models/{model_id}@{version_id})`. + # The format is [a-z][a-zA-Z0-9-]\\{0,126}[a-z0-9] to distinguish from + # version_id. A default version alias will be created for the first version + # of the model, and there must be exactly one default version alias for a + # model. + # @!attribute [r] version_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this version was created. + # @!attribute [r] version_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this version was most recently updated. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the Model. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the Model. + # @!attribute [rw] version_description + # @return [::String] + # The description of this version. + # @!attribute [rw] predict_schemata + # @return [::Google::Cloud::AIPlatform::V1::PredictSchemata] + # The schemata that describe formats of the Model's predictions and + # explanations as given and returned via + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict} + # and + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}. + # @!attribute [rw] metadata_schema_uri + # @return [::String] + # Immutable. Points to a YAML file stored on Google Cloud Storage describing + # additional information about the Model, that is specific to it. Unset if + # the Model does not have any additional information. The schema is defined + # as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # AutoML Models always have this field populated by Vertex AI, if no + # additional metadata is needed, this field is set to an empty string. + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Value] + # Immutable. An additional information about the Model; the schema of the + # metadata can be found in + # {::Google::Cloud::AIPlatform::V1::Model#metadata_schema_uri metadata_schema}. + # Unset if the Model does not have any additional information. + # @!attribute [r] supported_export_formats + # @return [::Array<::Google::Cloud::AIPlatform::V1::Model::ExportFormat>] + # Output only. The formats in which this Model may be exported. If empty, + # this Model is not available for export. + # @!attribute [r] training_pipeline + # @return [::String] + # Output only. The resource name of the TrainingPipeline that uploaded this + # Model, if any. + # @!attribute [rw] pipeline_job + # @return [::String] + # Optional. This field is populated if the model is produced by a pipeline + # job. + # @!attribute [rw] container_spec + # @return [::Google::Cloud::AIPlatform::V1::ModelContainerSpec] + # Input only. The specification of the container that is to be used when + # deploying this Model. The specification is ingested upon + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel}, + # and all binaries it contains are copied and stored internally by Vertex AI. + # Not required for AutoML Models. + # @!attribute [rw] artifact_uri + # @return [::String] + # Immutable. The path to the directory containing the Model artifact and any + # of its supporting files. Not required for AutoML Models. + # @!attribute [r] supported_deployment_resources_types + # @return [::Array<::Google::Cloud::AIPlatform::V1::Model::DeploymentResourcesType>] + # Output only. When this Model is deployed, its prediction resources are + # described by the `prediction_resources` field of the + # {::Google::Cloud::AIPlatform::V1::Endpoint#deployed_models Endpoint.deployed_models} + # object. Because not all Models support all resource configuration types, + # the configuration types this Model supports are listed here. If no + # configuration types are listed, the Model cannot be deployed to an + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} and does not support + # online predictions + # ({::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict} + # or + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}). + # Such a Model can serve predictions by using a + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}, if it + # has at least one entry each in + # {::Google::Cloud::AIPlatform::V1::Model#supported_input_storage_formats supported_input_storage_formats} + # and + # {::Google::Cloud::AIPlatform::V1::Model#supported_output_storage_formats supported_output_storage_formats}. + # @!attribute [r] supported_input_storage_formats + # @return [::Array<::String>] + # Output only. The formats this Model supports in + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#input_config BatchPredictionJob.input_config}. + # If + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri PredictSchemata.instance_schema_uri} + # exists, the instances should be given as per that schema. + # + # The possible formats are: + # + # * `jsonl` + # The JSON Lines format, where each instance is a single line. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig#gcs_source GcsSource}. + # + # * `csv` + # The CSV format, where each instance is a single comma-separated line. + # The first line in the file is the header, containing comma-separated field + # names. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig#gcs_source GcsSource}. + # + # * `tf-record` + # The TFRecord format, where each instance is a single record in tfrecord + # syntax. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig#gcs_source GcsSource}. + # + # * `tf-record-gzip` + # Similar to `tf-record`, but the file is gzipped. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig#gcs_source GcsSource}. + # + # * `bigquery` + # Each instance is a single row in BigQuery. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig#bigquery_source BigQuerySource}. + # + # * `file-list` + # Each line of the file is the location of an instance to process, uses + # `gcs_source` field of the + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::InputConfig InputConfig} + # object. + # + # + # If this Model doesn't support any of these formats it means it cannot be + # used with a + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. + # However, if it has + # {::Google::Cloud::AIPlatform::V1::Model#supported_deployment_resources_types supported_deployment_resources_types}, + # it could serve online predictions by using + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict} + # or + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}. + # @!attribute [r] supported_output_storage_formats + # @return [::Array<::String>] + # Output only. The formats this Model supports in + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#output_config BatchPredictionJob.output_config}. + # If both + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri PredictSchemata.instance_schema_uri} + # and + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#prediction_schema_uri PredictSchemata.prediction_schema_uri} + # exist, the predictions are returned together with their instances. In other + # words, the prediction has the original instance data first, followed by the + # actual prediction content (as per the schema). + # + # The possible formats are: + # + # * `jsonl` + # The JSON Lines format, where each prediction is a single line. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig#gcs_destination GcsDestination}. + # + # * `csv` + # The CSV format, where each prediction is a single comma-separated line. + # The first line in the file is the header, containing comma-separated field + # names. Uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig#gcs_destination GcsDestination}. + # + # * `bigquery` + # Each prediction is a single row in a BigQuery table, uses + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob::OutputConfig#bigquery_destination BigQueryDestination} + # . + # + # + # If this Model doesn't support any of these formats it means it cannot be + # used with a + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. + # However, if it has + # {::Google::Cloud::AIPlatform::V1::Model#supported_deployment_resources_types supported_deployment_resources_types}, + # it could serve online predictions by using + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict} + # or + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Model was uploaded into Vertex AI. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Model was most recently updated. + # @!attribute [r] deployed_models + # @return [::Array<::Google::Cloud::AIPlatform::V1::DeployedModelRef>] + # Output only. The pointers to DeployedModels created from this Model. Note + # that Model could have been deployed to Endpoints in different Locations. + # @!attribute [rw] explanation_spec + # @return [::Google::Cloud::AIPlatform::V1::ExplanationSpec] + # The default explanation specification for this Model. + # + # The Model can be used for + # [requesting + # explanation][google.cloud.aiplatform.v1.PredictionService.Explain] after + # being {::Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model deployed} if + # it is populated. The Model can be used for [batch + # explanation][google.cloud.aiplatform.v1.BatchPredictionJob.generate_explanation] + # if it is populated. + # + # All fields of the explanation_spec can be overridden by + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # of + # {::Google::Cloud::AIPlatform::V1::DeployModelRequest#deployed_model DeployModelRequest.deployed_model}, + # or + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#explanation_spec explanation_spec} + # of {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. + # + # If the default explanation specification is not set for this Model, this + # Model can still be used for + # [requesting + # explanation][google.cloud.aiplatform.v1.PredictionService.Explain] by + # setting + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # of + # {::Google::Cloud::AIPlatform::V1::DeployModelRequest#deployed_model DeployModelRequest.deployed_model} + # and for [batch + # explanation][google.cloud.aiplatform.v1.BatchPredictionJob.generate_explanation] + # by setting + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#explanation_spec explanation_spec} + # of {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Models. + # + # 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] data_stats + # @return [::Google::Cloud::AIPlatform::V1::Model::DataStats] + # Stats of data used for training or evaluating the Model. + # + # Only populated when the Model is trained by a TrainingPipeline with + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#input_data_config data_input_config}. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a Model. If set, this + # Model and all sub-resources of this Model will be secured by this key. + # @!attribute [r] model_source_info + # @return [::Google::Cloud::AIPlatform::V1::ModelSourceInfo] + # Output only. Source of a model. It can either be automl training pipeline, + # custom training pipeline, BigQuery ML, or saved and tuned from Genie or + # Model Garden. + # @!attribute [r] original_model_info + # @return [::Google::Cloud::AIPlatform::V1::Model::OriginalModelInfo] + # Output only. If this Model is a copy of another Model, this contains info + # about the original. + # @!attribute [r] metadata_artifact + # @return [::String] + # Output only. The resource name of the Artifact that was created in + # MetadataStore when creating the Model. The Artifact resource name pattern + # is + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + # @!attribute [rw] base_model_source + # @return [::Google::Cloud::AIPlatform::V1::Model::BaseModelSource] + # Optional. User input field to specify the base model source. Currently it + # only supports specifing the Model Garden models and Genie models. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Model + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents export format supported by the Model. + # All formats export to Google Cloud Storage. + # @!attribute [r] id + # @return [::String] + # Output only. The ID of the export format. + # The possible format IDs are: + # + # * `tflite` + # Used for Android mobile devices. + # + # * `edgetpu-tflite` + # Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. + # + # * `tf-saved-model` + # A tensorflow model in SavedModel format. + # + # * `tf-js` + # A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used + # in the browser and in Node.js using JavaScript. + # + # * `core-ml` + # Used for iOS mobile devices. + # + # * `custom-trained` + # A Model that was uploaded or trained by custom code. + # @!attribute [r] exportable_contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::Model::ExportFormat::ExportableContent>] + # Output only. The content of this Model that may be exported. + class ExportFormat + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Model content that can be exported. + module ExportableContent + # Should not be used. + EXPORTABLE_CONTENT_UNSPECIFIED = 0 + + # Model artifact and any of its supported files. Will be exported to the + # location specified by the `artifactDestination` field of the + # {::Google::Cloud::AIPlatform::V1::ExportModelRequest#output_config ExportModelRequest.output_config} + # object. + ARTIFACT = 1 + + # The container image that is to be used when deploying this Model. Will + # be exported to the location specified by the `imageDestination` field + # of the + # {::Google::Cloud::AIPlatform::V1::ExportModelRequest#output_config ExportModelRequest.output_config} + # object. + IMAGE = 2 + end + end + + # Stats of data used for train or evaluate the Model. + # @!attribute [rw] training_data_items_count + # @return [::Integer] + # Number of DataItems that were used for training this Model. + # @!attribute [rw] validation_data_items_count + # @return [::Integer] + # Number of DataItems that were used for validating this Model during + # training. + # @!attribute [rw] test_data_items_count + # @return [::Integer] + # Number of DataItems that were used for evaluating this Model. If the + # Model is evaluated multiple times, this will be the number of test + # DataItems used by the first evaluation. If the Model is not evaluated, + # the number is 0. + # @!attribute [rw] training_annotations_count + # @return [::Integer] + # Number of Annotations that are used for training this Model. + # @!attribute [rw] validation_annotations_count + # @return [::Integer] + # Number of Annotations that are used for validating this Model during + # training. + # @!attribute [rw] test_annotations_count + # @return [::Integer] + # Number of Annotations that are used for evaluating this Model. If the + # Model is evaluated multiple times, this will be the number of test + # Annotations used by the first evaluation. If the Model is not evaluated, + # the number is 0. + class DataStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information about the original Model if this Model is a copy. + # @!attribute [r] model + # @return [::String] + # Output only. The resource name of the Model this Model is a copy of, + # including the revision. Format: + # `projects/{project}/locations/{location}/models/{model_id}@{version_id}` + class OriginalModelInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User input field to specify the base model source. Currently it only + # supports specifing the Model Garden models and Genie models. + # @!attribute [rw] model_garden_source + # @return [::Google::Cloud::AIPlatform::V1::ModelGardenSource] + # Source information of Model Garden models. + # @!attribute [rw] genie_source + # @return [::Google::Cloud::AIPlatform::V1::GenieSource] + # Information about the base model of Genie models. + class BaseModelSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identifies a type of Model's prediction resources. + module DeploymentResourcesType + # Should not be used. + DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0 + + # Resources that are dedicated to the + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel}, and that need + # a higher degree of manual configuration. + DEDICATED_RESOURCES = 1 + + # Resources that to large degree are decided by Vertex AI, and require + # only a modest additional configuration. + AUTOMATIC_RESOURCES = 2 + + # Resources that can be shared by multiple + # {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModels}. A + # pre-configured + # {::Google::Cloud::AIPlatform::V1::DeploymentResourcePool DeploymentResourcePool} + # is required. + SHARED_RESOURCES = 3 + end + end + + # Contains information about the Large Model. + # @!attribute [rw] name + # @return [::String] + # Required. The unique name of the large Foundation or pre-built model. Like + # "chat-bison", "text-bison". Or model name with version ID, like + # "chat-bison@001", "text-bison@005", etc. + class LargeModelReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information about the source of the models generated from Model + # Garden. + # @!attribute [rw] public_model_name + # @return [::String] + # Required. The model garden source model resource name. + class ModelGardenSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information about the source of the models generated from Generative + # AI Studio. + # @!attribute [rw] base_model_uri + # @return [::String] + # Required. The public base model URI. + class GenieSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains the schemata used in Model's predictions and explanations via + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict}, + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain} + # and {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob}. + # @!attribute [rw] instance_schema_uri + # @return [::String] + # Immutable. Points to a YAML file stored on Google Cloud Storage describing + # the format of a single instance, which are used in + # {::Google::Cloud::AIPlatform::V1::PredictRequest#instances PredictRequest.instances}, + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances ExplainRequest.instances} + # and + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#input_config BatchPredictionJob.input_config}. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # AutoML Models always have this field populated by Vertex AI. + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + # @!attribute [rw] parameters_schema_uri + # @return [::String] + # Immutable. Points to a YAML file stored on Google Cloud Storage describing + # the parameters of prediction and explanation via + # {::Google::Cloud::AIPlatform::V1::PredictRequest#parameters PredictRequest.parameters}, + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#parameters ExplainRequest.parameters} + # and + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#model_parameters BatchPredictionJob.model_parameters}. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # AutoML Models always have this field populated by Vertex AI, if no + # parameters are supported, then it is set to an empty string. + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + # @!attribute [rw] prediction_schema_uri + # @return [::String] + # Immutable. Points to a YAML file stored on Google Cloud Storage describing + # the format of a single prediction produced by this Model, which are + # returned via + # {::Google::Cloud::AIPlatform::V1::PredictResponse#predictions PredictResponse.predictions}, + # {::Google::Cloud::AIPlatform::V1::ExplainResponse#explanations ExplainResponse.explanations}, + # and + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob#output_config BatchPredictionJob.output_config}. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # AutoML Models always have this field populated by Vertex AI. + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + class PredictSchemata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of a container for serving predictions. Some fields in this + # message correspond to fields in the [Kubernetes Container v1 core + # specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + # @!attribute [rw] image_uri + # @return [::String] + # Required. Immutable. URI of the Docker image to be used as the custom + # container for serving predictions. This URI must identify an image in + # Artifact Registry or Container Registry. Learn more about the [container + # publishing + # requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), + # including permissions requirements for the Vertex AI Service Agent. + # + # The container image is ingested upon + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel}, + # stored internally, and this original path is afterwards not used. + # + # To learn about the requirements for the Docker image itself, see + # [Custom container + # requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). + # + # You can use the URI to one of Vertex AI's [pre-built container images for + # prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) + # in this field. + # @!attribute [rw] command + # @return [::Array<::String>] + # Immutable. Specifies the command that runs when the container starts. This + # overrides the container's + # [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). + # Specify this field as an array of executable and arguments, similar to a + # Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. + # + # If you do not specify this field, then the container's `ENTRYPOINT` runs, + # in conjunction with the + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#args args} field or the + # container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), + # if either exists. If this field is not specified and the container does not + # have an `ENTRYPOINT`, then refer to the Docker documentation about [how + # `CMD` and `ENTRYPOINT` + # interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + # + # If you specify this field, then you can also specify the `args` field to + # provide additional arguments for this command. However, if you specify this + # field, then the container's `CMD` is ignored. See the + # [Kubernetes documentation about how the + # `command` and `args` fields interact with a container's `ENTRYPOINT` and + # `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + # + # In this field, you can reference [environment variables set by Vertex + # AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + # and environment variables set in the + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#env env} field. You cannot + # reference environment variables set in the Docker image. In order for + # environment variables to be expanded, reference them by using the following + # syntax: $(VARIABLE_NAME) Note that this differs + # from Bash variable expansion, which does not use parentheses. If a variable + # cannot be resolved, the reference in the input string is used unchanged. To + # avoid variable expansion, you can escape this syntax with `$$`; for + # example: $$(VARIABLE_NAME) This field corresponds + # to the `command` field of the Kubernetes Containers [v1 core + # API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + # @!attribute [rw] args + # @return [::Array<::String>] + # Immutable. Specifies arguments for the command that runs when the container + # starts. This overrides the container's + # [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify + # this field as an array of executable and arguments, similar to a Docker + # `CMD`'s "default parameters" form. + # + # If you don't specify this field but do specify the + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#command command} field, + # then the command from the `command` field runs without any additional + # arguments. See the [Kubernetes documentation about how the `command` and + # `args` fields interact with a container's `ENTRYPOINT` and + # `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + # + # If you don't specify this field and don't specify the `command` field, + # then the container's + # [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and + # `CMD` determine what runs based on their default behavior. See the Docker + # documentation about [how `CMD` and `ENTRYPOINT` + # interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + # + # In this field, you can reference [environment variables + # set by Vertex + # AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + # and environment variables set in the + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#env env} field. You cannot + # reference environment variables set in the Docker image. In order for + # environment variables to be expanded, reference them by using the following + # syntax: $(VARIABLE_NAME) Note that this differs + # from Bash variable expansion, which does not use parentheses. If a variable + # cannot be resolved, the reference in the input string is used unchanged. To + # avoid variable expansion, you can escape this syntax with `$$`; for + # example: $$(VARIABLE_NAME) This field corresponds + # to the `args` field of the Kubernetes Containers [v1 core + # API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + # @!attribute [rw] env + # @return [::Array<::Google::Cloud::AIPlatform::V1::EnvVar>] + # Immutable. List of environment variables to set in the container. After the + # container starts running, code running in the container can read these + # environment variables. + # + # Additionally, the + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#command command} and + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#args args} fields can + # reference these variables. Later entries in this list can also reference + # earlier entries. For example, the following example sets the variable + # `VAR_2` to have the value `foo bar`: + # + # ```json + # [ + # { + # "name": "VAR_1", + # "value": "foo" + # }, + # { + # "name": "VAR_2", + # "value": "$(VAR_1) bar" + # } + # ] + # ``` + # + # If you switch the order of the variables in the example, then the expansion + # does not occur. + # + # This field corresponds to the `env` field of the Kubernetes Containers + # [v1 core + # API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + # @!attribute [rw] ports + # @return [::Array<::Google::Cloud::AIPlatform::V1::Port>] + # Immutable. List of ports to expose from the container. Vertex AI sends any + # prediction requests that it receives to the first port on this list. Vertex + # AI also sends + # [liveness and health + # checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) + # to this port. + # + # If you do not specify this field, it defaults to following value: + # + # ```json + # [ + # { + # "containerPort": 8080 + # } + # ] + # ``` + # + # Vertex AI does not use ports other than the first one listed. This field + # corresponds to the `ports` field of the Kubernetes Containers + # [v1 core + # API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + # @!attribute [rw] predict_route + # @return [::String] + # Immutable. HTTP path on the container to send prediction requests to. + # Vertex AI forwards requests sent using + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict projects.locations.endpoints.predict} + # to this path on the container's IP address and port. Vertex AI then returns + # the container's response in the API response. + # + # For example, if you set this field to `/foo`, then when Vertex AI + # receives a prediction request, it forwards the request body in a POST + # request to the `/foo` path on the port of your container specified by the + # first value of this `ModelContainerSpec`'s + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#ports ports} field. + # + # If you don't specify this field, it defaults to the following value when + # you [deploy this Model to an + # Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: + # /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + # The placeholders in this value are replaced as follows: + # + # * ENDPOINT: The last segment (following `endpoints/`)of the + # Endpoint.name][] field of the Endpoint where this Model has been + # deployed. (Vertex AI makes this value available to your container code + # as the [`AIP_ENDPOINT_ID` environment + # variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + # + # * DEPLOYED_MODEL: + # {::Google::Cloud::AIPlatform::V1::DeployedModel#id DeployedModel.id} of the + # `DeployedModel`. + # (Vertex AI makes this value available to your container code + # as the [`AIP_DEPLOYED_MODEL_ID` environment + # variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + # @!attribute [rw] health_route + # @return [::String] + # Immutable. HTTP path on the container to send health checks to. Vertex AI + # intermittently sends GET requests to this path on the container's IP + # address and port to check that the container is healthy. Read more about + # [health + # checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). + # + # For example, if you set this field to `/bar`, then Vertex AI + # intermittently sends a GET request to the `/bar` path on the port of your + # container specified by the first value of this `ModelContainerSpec`'s + # {::Google::Cloud::AIPlatform::V1::ModelContainerSpec#ports ports} field. + # + # If you don't specify this field, it defaults to the following value when + # you [deploy this Model to an + # Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: + # /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + # The placeholders in this value are replaced as follows: + # + # * ENDPOINT: The last segment (following `endpoints/`)of the + # Endpoint.name][] field of the Endpoint where this Model has been + # deployed. (Vertex AI makes this value available to your container code + # as the [`AIP_ENDPOINT_ID` environment + # variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + # + # * DEPLOYED_MODEL: + # {::Google::Cloud::AIPlatform::V1::DeployedModel#id DeployedModel.id} of the + # `DeployedModel`. + # (Vertex AI makes this value available to your container code as the + # [`AIP_DEPLOYED_MODEL_ID` environment + # variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + # @!attribute [rw] grpc_ports + # @return [::Array<::Google::Cloud::AIPlatform::V1::Port>] + # Immutable. List of ports to expose from the container. Vertex AI sends gRPC + # prediction requests that it receives to the first port on this list. Vertex + # AI also sends liveness and health checks to this port. + # + # If you do not specify this field, gRPC requests to the container will be + # disabled. + # + # Vertex AI does not use ports other than the first one listed. This field + # corresponds to the `ports` field of the Kubernetes Containers v1 core API. + # @!attribute [rw] deployment_timeout + # @return [::Google::Protobuf::Duration] + # Immutable. Deployment timeout. + # Limit for deployment timeout is 2 hours. + # @!attribute [rw] shared_memory_size_mb + # @return [::Integer] + # Immutable. The amount of the VM memory to reserve as the shared memory for + # the model in megabytes. + # @!attribute [rw] startup_probe + # @return [::Google::Cloud::AIPlatform::V1::Probe] + # Immutable. Specification for Kubernetes startup probe. + # @!attribute [rw] health_probe + # @return [::Google::Cloud::AIPlatform::V1::Probe] + # Immutable. Specification for Kubernetes readiness probe. + class ModelContainerSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a network port in a container. + # @!attribute [rw] container_port + # @return [::Integer] + # The number of the port to expose on the pod's IP address. + # Must be a valid port number, between 1 and 65535 inclusive. + class Port + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detail description of the source information of the model. + # @!attribute [rw] source_type + # @return [::Google::Cloud::AIPlatform::V1::ModelSourceInfo::ModelSourceType] + # Type of the model source. + # @!attribute [rw] copy + # @return [::Boolean] + # If this Model is copy of another Model. If true then + # {::Google::Cloud::AIPlatform::V1::ModelSourceInfo#source_type source_type} + # pertains to the original. + class ModelSourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Source of the model. + # Different from `objective` field, this `ModelSourceType` enum + # indicates the source from which the model was accessed or obtained, + # whereas the `objective` indicates the overall aim or function of this + # model. + module ModelSourceType + # Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0 + + # The Model is uploaded by automl training pipeline. + AUTOML = 1 + + # The Model is uploaded by user or custom training pipeline. + CUSTOM = 2 + + # The Model is registered and sync'ed from BigQuery ML. + BQML = 3 + + # The Model is saved or tuned from Model Garden. + MODEL_GARDEN = 4 + + # The Model is saved or tuned from Genie. + GENIE = 5 + + # The Model is uploaded by text embedding finetuning pipeline. + CUSTOM_TEXT_EMBEDDING = 6 + + # The Model is saved or tuned from Marketplace. + MARKETPLACE = 7 + end + end + + # Probe describes a health check to be performed against a container to + # determine whether it is alive or ready to receive traffic. + # @!attribute [rw] exec + # @return [::Google::Cloud::AIPlatform::V1::Probe::ExecAction] + # ExecAction probes the health of a container by executing a command. + # @!attribute [rw] period_seconds + # @return [::Integer] + # How often (in seconds) to perform the probe. Default to 10 seconds. + # Minimum value is 1. Must be less than timeout_seconds. + # + # Maps to Kubernetes probe argument 'periodSeconds'. + # @!attribute [rw] timeout_seconds + # @return [::Integer] + # Number of seconds after which the probe times out. Defaults to 1 second. + # Minimum value is 1. Must be greater or equal to period_seconds. + # + # Maps to Kubernetes probe argument 'timeoutSeconds'. + class Probe + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # ExecAction specifies a command to execute. + # @!attribute [rw] command + # @return [::Array<::String>] + # Command is the command line to execute inside the container, the working + # directory for the command is root ('/') in the container's filesystem. + # The command is simply exec'd, it is not run inside a shell, so + # traditional shell instructions ('|', etc) won't work. To use a shell, you + # need to explicitly call out to that shell. Exit status of 0 is treated as + # live/healthy and non-zero is unhealthy. + class ExecAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb new file mode 100644 index 000000000000..eff4652a0b87 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb @@ -0,0 +1,333 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a job that runs periodically to monitor the deployed models in an + # endpoint. It will analyze the logged training & prediction data to detect any + # abnormal behaviors. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of a ModelDeploymentMonitoringJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the ModelDeploymentMonitoringJob. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # Display name of a ModelDeploymentMonitoringJob. + # @!attribute [rw] endpoint + # @return [::String] + # Required. Endpoint resource name. + # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the monitoring job. + # When the job is still creating, the state will be 'PENDING'. + # Once the job is successfully created, the state will be 'RUNNING'. + # Pause the job, the state will be 'PAUSED'. + # Resume the job, the state will return to 'RUNNING'. + # @!attribute [r] schedule_state + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob::MonitoringScheduleState] + # Output only. Schedule state when the monitoring job is in Running state. + # @!attribute [r] latest_monitoring_pipeline_metadata + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob::LatestMonitoringPipelineMetadata] + # Output only. Latest triggered monitoring pipeline metadata. + # @!attribute [rw] model_deployment_monitoring_objective_configs + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringObjectiveConfig>] + # Required. The config for monitoring objectives. This is a per DeployedModel + # config. Each DeployedModel needs to be configured separately. + # @!attribute [rw] model_deployment_monitoring_schedule_config + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringScheduleConfig] + # Required. Schedule config for running the monitoring job. + # @!attribute [rw] logging_sampling_strategy + # @return [::Google::Cloud::AIPlatform::V1::SamplingStrategy] + # Required. Sample Strategy for logging. + # @!attribute [rw] model_monitoring_alert_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringAlertConfig] + # Alert config for model monitoring. + # @!attribute [rw] predict_instance_schema_uri + # @return [::String] + # YAML schema file uri describing the format of a single instance, + # which are given to format this Endpoint's prediction (and explanation). + # If not set, we will generate predict schema from collected predict + # requests. + # @!attribute [rw] sample_predict_instance + # @return [::Google::Protobuf::Value] + # Sample Predict instance, same format as + # {::Google::Cloud::AIPlatform::V1::PredictRequest#instances PredictRequest.instances}, + # this can be set as a replacement of + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob#predict_instance_schema_uri ModelDeploymentMonitoringJob.predict_instance_schema_uri}. + # If not set, we will generate predict schema from collected predict + # requests. + # @!attribute [rw] analysis_instance_schema_uri + # @return [::String] + # YAML schema file uri describing the format of a single instance that you + # want Tensorflow Data Validation (TFDV) to analyze. + # + # If this field is empty, all the feature data types are inferred from + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob#predict_instance_schema_uri predict_instance_schema_uri}, + # meaning that TFDV will use the data in the exact format(data type) as + # prediction request/response. + # If there are any data type differences between predict instance and TFDV + # instance, this field can be used to override the schema. + # For models trained with Vertex AI, this field must be set as all the + # fields in predict instance formatted as string. + # @!attribute [r] bigquery_tables + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringBigQueryTable>] + # Output only. The created bigquery tables for the job under customer + # project. Customer could do their own query & analysis. There could be 4 log + # tables in maximum: + # 1. Training data logging predict request/response + # 2. Serving data logging predict request/response + # @!attribute [rw] log_ttl + # @return [::Google::Protobuf::Duration] + # The TTL of BigQuery tables in user projects which stores logs. + # A day is the basic unit of the TTL and we take the ceil of TTL/86400(a + # day). e.g. { second: 3600} indicates ttl = 1 day. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your + # ModelDeploymentMonitoringJob. + # + # 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 [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ModelDeploymentMonitoringJob was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ModelDeploymentMonitoringJob was updated + # most recently. + # @!attribute [r] next_schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this monitoring pipeline will be scheduled to + # run for the next round. + # @!attribute [rw] stats_anomalies_base_directory + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # Stats anomalies base folder path. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If + # set, this ModelDeploymentMonitoringJob and all sub-resources of this + # ModelDeploymentMonitoringJob will be secured by this key. + # @!attribute [rw] enable_monitoring_pipeline_logs + # @return [::Boolean] + # If true, the scheduled monitoring pipeline logs are sent to + # Google Cloud Logging, including pipeline status and anomalies detected. + # Please note the logs incur cost, which are subject to [Cloud Logging + # pricing](https://cloud.google.com/logging#pricing). + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when the job's state is `JOB_STATE_FAILED` or + # `JOB_STATE_CANCELLED`. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class ModelDeploymentMonitoringJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # All metadata of most recent monitoring pipelines. + # @!attribute [rw] run_time + # @return [::Google::Protobuf::Timestamp] + # The time that most recent monitoring pipelines that is related to this + # run. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of the most recent monitoring pipeline. + class LatestMonitoringPipelineMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state to Specify the monitoring pipeline. + module MonitoringScheduleState + # Unspecified state. + MONITORING_SCHEDULE_STATE_UNSPECIFIED = 0 + + # The pipeline is picked up and wait to run. + PENDING = 1 + + # The pipeline is offline and will be scheduled for next run. + OFFLINE = 2 + + # The pipeline is running. + RUNNING = 3 + end + end + + # ModelDeploymentMonitoringBigQueryTable specifies the BigQuery table name + # as well as some information of the logs stored in this table. + # @!attribute [rw] log_source + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringBigQueryTable::LogSource] + # The source of log. + # @!attribute [rw] log_type + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringBigQueryTable::LogType] + # The type of log. + # @!attribute [rw] bigquery_table_path + # @return [::String] + # The created BigQuery table to store logs. Customer could do their own query + # & analysis. Format: + # `bq://.model_deployment_monitoring_._` + # @!attribute [r] request_response_logging_schema_version + # @return [::String] + # Output only. The schema version of the request/response logging BigQuery + # table. Default to v1 if unset. + class ModelDeploymentMonitoringBigQueryTable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates where does the log come from. + module LogSource + # Unspecified source. + LOG_SOURCE_UNSPECIFIED = 0 + + # Logs coming from Training dataset. + TRAINING = 1 + + # Logs coming from Serving traffic. + SERVING = 2 + end + + # Indicates what type of traffic does the log belong to. + module LogType + # Unspecified type. + LOG_TYPE_UNSPECIFIED = 0 + + # Predict logs. + PREDICT = 1 + + # Explain logs. + EXPLAIN = 2 + end + end + + # ModelDeploymentMonitoringObjectiveConfig contains the pair of + # deployed_model_id to ModelMonitoringObjectiveConfig. + # @!attribute [rw] deployed_model_id + # @return [::String] + # The DeployedModel ID of the objective config. + # @!attribute [rw] objective_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig] + # The objective config of for the modelmonitoring job of this deployed model. + class ModelDeploymentMonitoringObjectiveConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The config for scheduling monitoring job. + # @!attribute [rw] monitor_interval + # @return [::Google::Protobuf::Duration] + # Required. The model monitoring job scheduling interval. It will be rounded + # up to next full hour. This defines how often the monitoring jobs are + # triggered. + # @!attribute [rw] monitor_window + # @return [::Google::Protobuf::Duration] + # The time window of the prediction data being included in each prediction + # dataset. This window specifies how long the data should be collected from + # historical model results for each run. If not set, + # {::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringScheduleConfig#monitor_interval ModelDeploymentMonitoringScheduleConfig.monitor_interval} + # will be used. e.g. If currently the cutoff time is 2022-01-08 14:30:00 and + # the monitor_window is set to be 3600, then data from 2022-01-08 13:30:00 to + # 2022-01-08 14:30:00 will be retrieved and aggregated to calculate the + # monitoring statistics. + class ModelDeploymentMonitoringScheduleConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Statistics and anomalies generated by Model Monitoring. + # @!attribute [rw] objective + # @return [::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringObjectiveType] + # Model Monitoring Objective those stats and anomalies belonging to. + # @!attribute [rw] deployed_model_id + # @return [::String] + # Deployed Model ID. + # @!attribute [rw] anomaly_count + # @return [::Integer] + # Number of anomalies within all stats. + # @!attribute [rw] feature_stats + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies::FeatureHistoricStatsAnomalies>] + # A list of historical Stats and Anomalies generated for all Features. + class ModelMonitoringStatsAnomalies + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Historical Stats (and Anomalies) for a specific Feature. + # @!attribute [rw] feature_display_name + # @return [::String] + # Display Name of the Feature. + # @!attribute [rw] threshold + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + # Threshold for anomaly detection. + # @!attribute [rw] training_stats + # @return [::Google::Cloud::AIPlatform::V1::FeatureStatsAnomaly] + # Stats calculated for the Training Dataset. + # @!attribute [rw] prediction_stats + # @return [::Array<::Google::Cloud::AIPlatform::V1::FeatureStatsAnomaly>] + # A list of historical stats generated by different time window's + # Prediction Dataset. + class FeatureHistoricStatsAnomalies + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The Model Monitoring Objective types. + module ModelDeploymentMonitoringObjectiveType + # Default value, should not be set. + MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED = 0 + + # Raw feature values' stats to detect skew between Training-Prediction + # datasets. + RAW_FEATURE_SKEW = 1 + + # Raw feature values' stats to detect drift between Serving-Prediction + # datasets. + RAW_FEATURE_DRIFT = 2 + + # Feature attribution scores to detect skew between Training-Prediction + # datasets. + FEATURE_ATTRIBUTION_SKEW = 3 + + # Feature attribution scores to detect skew between Prediction datasets + # collected within different time windows. + FEATURE_ATTRIBUTION_DRIFT = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb new file mode 100644 index 000000000000..a176720d804c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A collection of metrics calculated by comparing Model's predictions on all of + # the test data against annotations from the test data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the ModelEvaluation. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the ModelEvaluation. + # @!attribute [rw] metrics_schema_uri + # @return [::String] + # Points to a YAML file stored on Google Cloud Storage describing the + # {::Google::Cloud::AIPlatform::V1::ModelEvaluation#metrics metrics} of this + # ModelEvaluation. The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # @!attribute [rw] metrics + # @return [::Google::Protobuf::Value] + # Evaluation metrics of the Model. The schema of the metrics is stored in + # {::Google::Cloud::AIPlatform::V1::ModelEvaluation#metrics_schema_uri metrics_schema_uri} + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ModelEvaluation was created. + # @!attribute [rw] slice_dimensions + # @return [::Array<::String>] + # All possible + # {::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice#dimension dimensions} + # of ModelEvaluationSlices. The dimensions can be used as the filter of the + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices} + # request, in the form of `slice.dimension = `. + # @!attribute [rw] data_item_schema_uri + # @return [::String] + # Points to a YAML file stored on Google Cloud Storage describing + # [EvaluatedDataItemView.data_item_payload][] and + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#data_item_payload EvaluatedAnnotation.data_item_payload}. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # + # This field is not populated if there are neither EvaluatedDataItemViews nor + # EvaluatedAnnotations under this ModelEvaluation. + # @!attribute [rw] annotation_schema_uri + # @return [::String] + # Points to a YAML file stored on Google Cloud Storage describing + # [EvaluatedDataItemView.predictions][], + # [EvaluatedDataItemView.ground_truths][], + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#predictions EvaluatedAnnotation.predictions}, + # and + # {::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation#ground_truths EvaluatedAnnotation.ground_truths}. + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # + # This field is not populated if there are neither EvaluatedDataItemViews nor + # EvaluatedAnnotations under this ModelEvaluation. + # @!attribute [rw] model_explanation + # @return [::Google::Cloud::AIPlatform::V1::ModelExplanation] + # Aggregated explanation metrics for the Model's prediction output over the + # data this ModelEvaluation uses. This field is populated only if the Model + # is evaluated with explanations, and only for AutoML tabular Models. + # @!attribute [rw] explanation_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluation::ModelEvaluationExplanationSpec>] + # Describes the values of + # {::Google::Cloud::AIPlatform::V1::ExplanationSpec ExplanationSpec} that are used + # for explaining the predicted values on the evaluated data. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Value] + # The metadata of the ModelEvaluation. + # For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a + # structured value with keys of "pipeline_job_id", "evaluation_dataset_type", + # "evaluation_dataset_path", "row_based_metrics_path". + class ModelEvaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] explanation_type + # @return [::String] + # Explanation type. + # + # For AutoML Image Classification models, possible values are: + # + # * `image-integrated-gradients` + # * `image-xrai` + # @!attribute [rw] explanation_spec + # @return [::Google::Cloud::AIPlatform::V1::ExplanationSpec] + # Explanation spec details. + class ModelEvaluationExplanationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation_slice.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation_slice.rb new file mode 100644 index 000000000000..41a6bd494af8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_evaluation_slice.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A collection of metrics calculated by comparing Model's predictions on a + # slice of the test data against ground truth annotations. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the ModelEvaluationSlice. + # @!attribute [r] slice + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice] + # Output only. The slice of the test data that is used to evaluate the Model. + # @!attribute [r] metrics_schema_uri + # @return [::String] + # Output only. Points to a YAML file stored on Google Cloud Storage + # describing the + # {::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice#metrics metrics} of this + # ModelEvaluationSlice. The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # @!attribute [r] metrics + # @return [::Google::Protobuf::Value] + # Output only. Sliced evaluation metrics of the Model. The schema of the + # metrics is stored in + # {::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice#metrics_schema_uri metrics_schema_uri} + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ModelEvaluationSlice was created. + # @!attribute [r] model_explanation + # @return [::Google::Cloud::AIPlatform::V1::ModelExplanation] + # Output only. Aggregated explanation metrics for the Model's prediction + # output over the data this ModelEvaluation uses. This field is populated + # only if the Model is evaluated with explanations, and only for tabular + # Models. + class ModelEvaluationSlice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Definition of a slice. + # @!attribute [r] dimension + # @return [::String] + # Output only. The dimension of the slice. + # Well-known dimensions are: + # * `annotationSpec`: This slice is on the test data that has either + # ground truth or prediction with + # {::Google::Cloud::AIPlatform::V1::AnnotationSpec#display_name AnnotationSpec.display_name} + # equals to + # {::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice#value value}. + # * `slice`: This slice is a user customized slice defined by its + # SliceSpec. + # @!attribute [r] value + # @return [::String] + # Output only. The value of the dimension in this slice. + # @!attribute [r] slice_spec + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice::SliceSpec] + # Output only. Specification for how the data was sliced. + class Slice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification for how the data should be sliced. + # @!attribute [rw] configs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice::SliceSpec::SliceConfig}] + # Mapping configuration for this SliceSpec. + # The key is the name of the feature. + # By default, the key will be prefixed by "instance" as a dictionary + # prefix for Vertex Batch Predictions output format. + class SliceSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification message containing the config for this SliceSpec. + # When `kind` is selected as `value` and/or `range`, only a single slice + # will be computed. + # When `all_values` is present, a separate slice will be computed for + # each possible label/value for the corresponding key in `config`. + # Examples, with feature zip_code with values 12345, 23334, 88888 and + # feature country with values "US", "Canada", "Mexico" in the dataset: + # + # Example 1: + # + # { + # "zip_code": { "value": { "float_value": 12345.0 } } + # } + # + # A single slice for any data with zip_code 12345 in the dataset. + # + # Example 2: + # + # { + # "zip_code": { "range": { "low": 12345, "high": 20000 } } + # } + # + # A single slice containing data where the zip_codes between 12345 and + # 20000 For this example, data with the zip_code of 12345 will be in this + # slice. + # + # Example 3: + # + # { + # "zip_code": { "range": { "low": 10000, "high": 20000 } }, + # "country": { "value": { "string_value": "US" } } + # } + # + # A single slice containing data where the zip_codes between 10000 and + # 20000 has the country "US". For this example, data with the zip_code of + # 12345 and country "US" will be in this slice. + # + # Example 4: + # + # { "country": {"all_values": { "value": true } } } + # + # Three slices are computed, one for each unique country in the dataset. + # + # Example 5: + # + # { + # "country": { "all_values": { "value": true } }, + # "zip_code": { "value": { "float_value": 12345.0 } } + # } + # + # Three slices are computed, one for each unique country in the dataset + # where the zip_code is also 12345. For this example, data with zip_code + # 12345 and country "US" will be in one slice, zip_code 12345 and country + # "Canada" in another slice, and zip_code 12345 and country "Mexico" in + # another slice, totaling 3 slices. + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice::SliceSpec::Value] + # A unique specific value for a given feature. + # Example: `{ "value": { "string_value": "12345" } }` + # @!attribute [rw] range + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice::SliceSpec::Range] + # A range of values for a numerical feature. + # Example: `{"range":{"low":10000.0,"high":50000.0}}` + # will capture 12345 and 23334 in the slice. + # @!attribute [rw] all_values + # @return [::Google::Protobuf::BoolValue] + # If all_values is set to true, then all possible labels of the keyed + # feature will have another slice computed. + # Example: `{"all_values":{"value":true}}` + class SliceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A range of values for slice(s). + # `low` is inclusive, `high` is exclusive. + # @!attribute [rw] low + # @return [::Float] + # Inclusive low value for the range. + # @!attribute [rw] high + # @return [::Float] + # Exclusive high value for the range. + class Range + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Single value that supports strings and floats. + # @!attribute [rw] string_value + # @return [::String] + # String type. + # @!attribute [rw] float_value + # @return [::Float] + # Float type. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice::Slice::SliceSpec::SliceConfig] + class ConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb new file mode 100644 index 000000000000..ea07c4422858 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelGardenService::Client#get_publisher_model ModelGardenService.GetPublisherModel} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PublisherModel resource. + # Format: + # `publishers/{publisher}/models/{publisher_model}` + # @!attribute [rw] language_code + # @return [::String] + # Optional. The IETF BCP-47 language code representing the language in which + # the publisher model's text information should be written in. + # @!attribute [rw] view + # @return [::Google::Cloud::AIPlatform::V1::PublisherModelView] + # Optional. PublisherModel view specifying which fields to read. + # @!attribute [rw] is_hugging_face_model + # @return [::Boolean] + # Optional. Boolean indicates whether the requested model is a Hugging Face + # model. + # @!attribute [rw] hugging_face_token + # @return [::String] + # Optional. Token used to access Hugging Face gated models. + class GetPublisherModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # View enumeration of PublisherModel. + module PublisherModelView + # The default / unset value. The API will default to the BASIC view. + PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0 + + # Include basic metadata about the publisher model, but not the full + # contents. + PUBLISHER_MODEL_VIEW_BASIC = 1 + + # Include everything. + PUBLISHER_MODEL_VIEW_FULL = 2 + + # Include: VersionId, ModelVersionExternalName, and SupportedActions. + PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb new file mode 100644 index 000000000000..2a79719a6525 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The objective configuration for model monitoring, including the information + # needed to detect anomalies for one particular model. + # @!attribute [rw] training_dataset + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::TrainingDataset] + # Training dataset for models. This field has to be set only if + # TrainingPredictionSkewDetectionConfig is specified. + # @!attribute [rw] training_prediction_skew_detection_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::TrainingPredictionSkewDetectionConfig] + # The config for skew between training data and prediction data. + # @!attribute [rw] prediction_drift_detection_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::PredictionDriftDetectionConfig] + # The config for drift of prediction data. + # @!attribute [rw] explanation_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::ExplanationConfig] + # The config for integrating with Vertex Explainable AI. + class ModelMonitoringObjectiveConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Training Dataset information. + # @!attribute [rw] dataset + # @return [::String] + # The resource name of the Dataset used to train this Model. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::AIPlatform::V1::GcsSource] + # The Google Cloud Storage uri of the unmanaged Dataset used to train + # this Model. + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::AIPlatform::V1::BigQuerySource] + # The BigQuery table of the unmanaged Dataset used to train this + # Model. + # @!attribute [rw] data_format + # @return [::String] + # Data format of the dataset, only applicable if the input is from + # Google Cloud Storage. + # The possible formats are: + # + # "tf-record" + # The source file is a TFRecord file. + # + # "csv" + # The source file is a CSV file. + # "jsonl" + # The source file is a JSONL file. + # @!attribute [rw] target_field + # @return [::String] + # The target field name the model is to predict. + # This field will be excluded when doing Predict and (or) Explain for the + # training data. + # @!attribute [rw] logging_sampling_strategy + # @return [::Google::Cloud::AIPlatform::V1::SamplingStrategy] + # Strategy to sample data from Training Dataset. + # If not set, we process the whole dataset. + class TrainingDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The config for Training & Prediction data skew detection. It specifies the + # training dataset sources and the skew detection parameters. + # @!attribute [rw] skew_thresholds + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ThresholdConfig}] + # Key is the feature name and value is the threshold. If a feature needs to + # be monitored for skew, a value threshold must be configured for that + # feature. The threshold here is against feature distribution distance + # between the training and prediction feature. + # @!attribute [rw] attribution_score_skew_thresholds + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ThresholdConfig}] + # Key is the feature name and value is the threshold. The threshold here is + # against attribution score distance between the training and prediction + # feature. + # @!attribute [rw] default_skew_threshold + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + # Skew anomaly detection threshold used by all features. + # When the per-feature thresholds are not set, this field can be used to + # specify a threshold for all features. + class TrainingPredictionSkewDetectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + class SkewThresholdsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + class AttributionScoreSkewThresholdsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The config for Prediction data drift detection. + # @!attribute [rw] drift_thresholds + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ThresholdConfig}] + # Key is the feature name and value is the threshold. If a feature needs to + # be monitored for drift, a value threshold must be configured for that + # feature. The threshold here is against feature distribution distance + # between different time windws. + # @!attribute [rw] attribution_score_drift_thresholds + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ThresholdConfig}] + # Key is the feature name and value is the threshold. The threshold here is + # against attribution score distance between different time windows. + # @!attribute [rw] default_drift_threshold + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + # Drift anomaly detection threshold used by all features. + # When the per-feature thresholds are not set, this field can be used to + # specify a threshold for all features. + class PredictionDriftDetectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + class DriftThresholdsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ThresholdConfig] + class AttributionScoreDriftThresholdsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The config for integrating with Vertex Explainable AI. Only applicable if + # the Model has explanation_spec populated. + # @!attribute [rw] enable_feature_attributes + # @return [::Boolean] + # If want to analyze the Vertex Explainable AI feature attribute scores or + # not. If set to true, Vertex AI will log the feature attributions from + # explain response and do the skew/drift detection for them. + # @!attribute [rw] explanation_baseline + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::ExplanationConfig::ExplanationBaseline] + # Predictions generated by the BatchPredictionJob using baseline dataset. + class ExplanationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output from + # {::Google::Cloud::AIPlatform::V1::BatchPredictionJob BatchPredictionJob} for + # Model Monitoring baseline dataset, which can be used to generate baseline + # attribution scores. + # @!attribute [rw] gcs + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # Cloud Storage location for BatchExplain output. + # @!attribute [rw] bigquery + # @return [::Google::Cloud::AIPlatform::V1::BigQueryDestination] + # BigQuery location for BatchExplain output. + # @!attribute [rw] prediction_format + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringObjectiveConfig::ExplanationConfig::ExplanationBaseline::PredictionFormat] + # The storage format of the predictions generated BatchPrediction job. + class ExplanationBaseline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The storage format of the predictions generated BatchPrediction job. + module PredictionFormat + # Should not be set. + PREDICTION_FORMAT_UNSPECIFIED = 0 + + # Predictions are in JSONL files. + JSONL = 2 + + # Predictions are in BigQuery. + BIGQUERY = 3 + end + end + end + end + + # The alert config for model monitoring. + # @!attribute [rw] email_alert_config + # @return [::Google::Cloud::AIPlatform::V1::ModelMonitoringAlertConfig::EmailAlertConfig] + # Email alert config. + # @!attribute [rw] enable_logging + # @return [::Boolean] + # Dump the anomalies to Cloud Logging. The anomalies will be put to json + # payload encoded from proto + # {::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies ModelMonitoringStatsAnomalies}. + # This can be further synced to Pub/Sub or any other services supported by + # Cloud Logging. + # @!attribute [rw] notification_channels + # @return [::Array<::String>] + # Resource names of the NotificationChannels to send alert. + # Must be of the format + # `projects//notificationChannels/` + class ModelMonitoringAlertConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The config for email alert. + # @!attribute [rw] user_emails + # @return [::Array<::String>] + # The email addresses to send the alert. + class EmailAlertConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The config for feature monitoring threshold. + # @!attribute [rw] value + # @return [::Float] + # Specify a threshold value that can trigger the alert. + # If this threshold config is for feature distribution distance: + # 1. For categorical feature, the distribution distance is calculated by + # L-inifinity norm. + # 2. For numerical feature, the distribution distance is calculated by + # Jensen–Shannon divergence. + # Each feature must have a non-zero threshold if they need to be monitored. + # Otherwise no alert will be triggered for that feature. + class ThresholdConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sampling Strategy for logging, can be for both training and prediction + # dataset. + # @!attribute [rw] random_sample_config + # @return [::Google::Cloud::AIPlatform::V1::SamplingStrategy::RandomSampleConfig] + # Random sample config. Will support more sampling strategies later. + class SamplingStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Requests are randomly selected. + # @!attribute [rw] sample_rate + # @return [::Float] + # Sample rate (0, 1] + class RandomSampleConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_service.rb new file mode 100644 index 000000000000..fdc63bf86ad4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model_service.rb @@ -0,0 +1,681 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location into which to upload the Model. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] parent_model + # @return [::String] + # Optional. The resource name of the model into which to upload the version. + # Only specify this field when uploading a new version. + # @!attribute [rw] model_id + # @return [::String] + # Optional. The ID to use for the uploaded Model, which will become the final + # component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @!attribute [rw] model + # @return [::Google::Cloud::AIPlatform::V1::Model] + # Required. The Model to create. + # @!attribute [rw] service_account + # @return [::String] + # Optional. The user-provided custom service account to use to do the model + # upload. If empty, [Vertex AI Service + # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + # will be used to access resources needed to upload the model. This account + # must belong to the target project where the model is uploaded to, i.e., the + # project specified in the `parent` field of this request and have necessary + # read permissions (to Google Cloud Storage, Artifact Registry, etc.). + class UploadModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class UploadModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel} + # operation. + # @!attribute [rw] model + # @return [::String] + # The name of the uploaded Model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @!attribute [r] model_version_id + # @return [::String] + # Output only. The version ID of the model that is uploaded. + class UploadModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#get_model ModelService.GetModel}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # + # In order to retrieve a specific version of the model, also provide + # the version ID or version alias. + # Example: `projects/{project}/locations/{location}/models/{model}@2` + # or + # `projects/{project}/locations/{location}/models/{model}@golden` + # If no version ID or alias is specified, the "default" version will be + # returned. The "default" version alias is created for the first version of + # the model, and can be moved to other versions later on. There will be + # exactly one default version. + class GetModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_models ModelService.ListModels}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the Models from. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `model` supports = and !=. `model` represents the Model ID, + # i.e. the last segment of the Model's [resource + # name][google.cloud.aiplatform.v1.Model.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `base_model_name` only supports = + # + # Some examples: + # + # * `model=1234` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `baseModelName="text-bison"` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_models ModelService.ListModels} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by, sorted in ascending order. + # Use "desc" after a field name for descending. + # Supported fields: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + class ListModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_models ModelService.ListModels} + # @!attribute [rw] models + # @return [::Array<::Google::Cloud::AIPlatform::V1::Model>] + # List of Models in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListModelsRequest#page_token ListModelsRequest.page_token} + # to obtain that page. + class ListModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_versions ModelService.ListModelVersions}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model to list versions for. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse#next_page_token next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_versions ListModelVersions} + # call. + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. For field names + # both snake_case and camelCase are supported. + # + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # + # Some examples: + # + # * `labels.myKey="myValue"` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + # @!attribute [rw] order_by + # @return [::String] + # 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: `update_time asc, create_time desc`. + class ListModelVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_versions ModelService.ListModelVersions} + # @!attribute [rw] models + # @return [::Array<::Google::Cloud::AIPlatform::V1::Model>] + # List of Model versions in the requested page. + # In the returned Model name field, version ID instead of regvision tag will + # be included. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest#page_token ListModelVersionsRequest.page_token} + # to obtain that page. + class ListModelVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#update_model ModelService.UpdateModel}. + # @!attribute [rw] model + # @return [::Google::Cloud::AIPlatform::V1::Model] + # Required. The Model which replaces the resource on the server. + # When Model Versioning is enabled, the model.name will be used to determine + # whether to update the model or model version. + # 1. model.name with the @ value, e.g. models/123@1, refers to a version + # specific update. + # 2. model.name without the @ value, e.g. models/123, refers to a model + # update. + # 3. model.name with @-, e.g. models/123@-, refers to a model update. + # 4. Supported model fields: display_name, description; supported + # version-specific fields: version_description. Labels are supported in both + # scenarios. Both the model labels and the version labels are merged when a + # model is returned. When updating labels, if the request is for + # model-specific update, model label gets updated. Otherwise, version labels + # get updated. + # 5. A model name or model version name fields update mismatch will cause a + # precondition error. + # 6. One request cannot update both the model and the version fields. You + # must update them separately. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class UpdateModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#update_explanation_dataset ModelService.UpdateExplanationDataset}. + # @!attribute [rw] model + # @return [::String] + # Required. The resource name of the Model to update. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @!attribute [rw] examples + # @return [::Google::Cloud::AIPlatform::V1::Examples] + # The example config containing the location of the dataset. + class UpdateExplanationDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#update_explanation_dataset ModelService.UpdateExplanationDataset}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class UpdateExplanationDatasetOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model ModelService.DeleteModel}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Model resource to be deleted. + # Format: `projects/{project}/locations/{location}/models/{model}` + class DeleteModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model_version ModelService.DeleteModelVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model version to be deleted, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + class DeleteModelVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#merge_version_aliases ModelService.MergeVersionAliases}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model version to merge aliases, with a version ID + # explicitly included. + # + # Example: `projects/{project}/locations/{location}/models/{model}@1234` + # @!attribute [rw] version_aliases + # @return [::Array<::String>] + # Required. The set of version aliases to merge. + # The alias should be at most 128 characters, and match + # `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. + # Add the `-` prefix to an alias means removing that alias from the version. + # `-` is NOT counted in the 128 characters. Example: `-golden` means removing + # the `golden` alias from the version. + # + # There is NO ordering in aliases, which means + # 1) The aliases returned from GetModel API might not have the exactly same + # order from this MergeVersionAliases API. 2) Adding and deleting the same + # alias in the request is not recommended, and the 2 operations will be + # cancelled out. + class MergeVersionAliasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#export_model ModelService.ExportModel}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Model to export. + # The resource name may contain version id or version alias to specify the + # version, if no version is specified, the default version will be exported. + # @!attribute [rw] output_config + # @return [::Google::Cloud::AIPlatform::V1::ExportModelRequest::OutputConfig] + # Required. The desired output location and configuration. + class ExportModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output configuration for the Model export. + # @!attribute [rw] export_format_id + # @return [::String] + # The ID of the format in which the Model must be exported. Each Model + # lists the [export formats it + # supports][google.cloud.aiplatform.v1.Model.supported_export_formats]. If + # no value is provided here, then the first from the list of the Model's + # supported formats is used by default. + # @!attribute [rw] artifact_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # The Cloud Storage location where the Model artifact is to be + # written to. Under the directory given as the destination a new one with + # name "`model-export--`", + # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + # will be created. Inside, the Model and any of its supporting files + # will be written. + # This field should only be set when the `exportableContent` field of the + # [Model.supported_export_formats] object contains `ARTIFACT`. + # @!attribute [rw] image_destination + # @return [::Google::Cloud::AIPlatform::V1::ContainerRegistryDestination] + # The Google Container Registry or Artifact Registry uri where the + # Model container image will be copied to. + # This field should only be set when the `exportableContent` field of the + # [Model.supported_export_formats] object contains `IMAGE`. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#export_model ModelService.ExportModel} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + # @!attribute [r] output_info + # @return [::Google::Cloud::AIPlatform::V1::ExportModelOperationMetadata::OutputInfo] + # Output only. Information further describing the output of this Model + # export. + class ExportModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Further describes the output of the ExportModel. Supplements + # {::Google::Cloud::AIPlatform::V1::ExportModelRequest::OutputConfig ExportModelRequest.OutputConfig}. + # @!attribute [r] artifact_output_uri + # @return [::String] + # Output only. If the Model artifact is being exported to Google Cloud + # Storage this is the full path of the directory created, into which the + # Model files are being written to. + # @!attribute [r] image_output_uri + # @return [::String] + # Output only. If the Model image is being exported to Google Container + # Registry or Artifact Registry this is the full path of the image created. + class OutputInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#update_explanation_dataset ModelService.UpdateExplanationDataset} + # operation. + class UpdateExplanationDatasetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#export_model ModelService.ExportModel} + # operation. + class ExportModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#copy_model ModelService.CopyModel}. + # @!attribute [rw] model_id + # @return [::String] + # Optional. Copy source_model into a new Model with this ID. The ID will + # become the final component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @!attribute [rw] parent_model + # @return [::String] + # Optional. Specify this field to copy source_model into this existing + # Model as a new version. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location into which to copy the Model. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] source_model + # @return [::String] + # Required. The resource name of the Model to copy. That Model must be in the + # same Project. Format: + # `projects/{project}/locations/{location}/models/{model}` + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key options. If this is set, + # then the Model copy will be encrypted with the provided encryption key. + class CopyModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#copy_model ModelService.CopyModel} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class CopyModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#copy_model ModelService.CopyModel} + # operation. + # @!attribute [rw] model + # @return [::String] + # The name of the copied Model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @!attribute [r] model_version_id + # @return [::String] + # Output only. The version ID of the model that is copied. + class CopyModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#import_model_evaluation ModelService.ImportModelEvaluation} + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent model resource. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @!attribute [rw] model_evaluation + # @return [::Google::Cloud::AIPlatform::V1::ModelEvaluation] + # Required. Model evaluation resource to be imported. + class ImportModelEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#batch_import_model_evaluation_slices ModelService.BatchImportModelEvaluationSlices} + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @!attribute [rw] model_evaluation_slices + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # Required. Model evaluation slice resource to be imported. + class BatchImportModelEvaluationSlicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#batch_import_model_evaluation_slices ModelService.BatchImportModelEvaluationSlices} + # @!attribute [r] imported_model_evaluation_slices + # @return [::Array<::String>] + # Output only. List of imported + # {::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice#name ModelEvaluationSlice.name}. + class BatchImportModelEvaluationSlicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#batch_import_evaluated_annotations ModelService.BatchImportEvaluatedAnnotations} + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + # @!attribute [rw] evaluated_annotations + # @return [::Array<::Google::Cloud::AIPlatform::V1::EvaluatedAnnotation>] + # Required. Evaluated annotations resource to be imported. + class BatchImportEvaluatedAnnotationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#batch_import_evaluated_annotations ModelService.BatchImportEvaluatedAnnotations} + # @!attribute [r] imported_evaluated_annotations_count + # @return [::Integer] + # Output only. Number of EvaluatedAnnotations imported. + class BatchImportEvaluatedAnnotationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#get_model_evaluation ModelService.GetModelEvaluation}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ModelEvaluation resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + class GetModelEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluations ModelService.ListModelEvaluations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Model to list the ModelEvaluations from. + # Format: `projects/{project}/locations/{location}/models/{model}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluations ModelService.ListModelEvaluations} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListModelEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluations ModelService.ListModelEvaluations}. + # @!attribute [rw] model_evaluations + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluation>] + # List of ModelEvaluations in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest#page_token ListModelEvaluationsRequest.page_token} + # to obtain that page. + class ListModelEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#get_model_evaluation_slice ModelService.GetModelEvaluationSlice}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ModelEvaluationSlice resource. + # Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + class GetModelEvaluationSliceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the ModelEvaluation to list the + # ModelEvaluationSlices from. Format: + # `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # * `slice.dimension` - for =. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesResponse#next_page_token ListModelEvaluationSlicesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListModelEvaluationSlicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices ModelService.ListModelEvaluationSlices}. + # @!attribute [rw] model_evaluation_slices + # @return [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>] + # List of ModelEvaluations in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest#page_token ListModelEvaluationSlicesRequest.page_token} + # to obtain that page. + class ListModelEvaluationSlicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/nas_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/nas_job.rb new file mode 100644 index 000000000000..8ee563fc77ea --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/nas_job.rb @@ -0,0 +1,313 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents a Neural Architecture Search (NAS) job. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the NasJob. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the NasJob. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] nas_job_spec + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec] + # Required. The specification of a NasJob. + # @!attribute [r] nas_job_output + # @return [::Google::Cloud::AIPlatform::V1::NasJobOutput] + # Output only. Output of the NasJob. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The detailed state of the job. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasJob was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasJob for the first time entered the + # `JOB_STATE_RUNNING` state. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasJob entered any of the following states: + # `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasJob was most recently updated. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when job's state is JOB_STATE_FAILED or + # JOB_STATE_CANCELLED. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize NasJobs. + # + # 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] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key options for a NasJob. + # If this is set, then all resources created by the NasJob + # will be encrypted with the provided encryption key. + # @!attribute [rw] enable_restricted_image_training + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Enable a separation of Custom model training + # and restricted image training for tenant project. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class NasJob + 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 + + # Represents a NasTrial details along with its parameters. If there is a + # corresponding train NasTrial, the train NasTrial is also returned. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the NasTrialDetail. + # @!attribute [rw] parameters + # @return [::String] + # The parameters for the NasJob NasTrial. + # @!attribute [rw] search_trial + # @return [::Google::Cloud::AIPlatform::V1::NasTrial] + # The requested search NasTrial. + # @!attribute [rw] train_trial + # @return [::Google::Cloud::AIPlatform::V1::NasTrial] + # The train NasTrial corresponding to + # {::Google::Cloud::AIPlatform::V1::NasTrialDetail#search_trial search_trial}. + # Only populated if + # {::Google::Cloud::AIPlatform::V1::NasTrialDetail#search_trial search_trial} is + # used for training. + class NasTrialDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec of a NasJob. + # @!attribute [rw] multi_trial_algorithm_spec + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec] + # The spec of multi-trial algorithms. + # @!attribute [rw] resume_nas_job_id + # @return [::String] + # The ID of the existing NasJob in the same Project and Location + # which will be used to resume search. search_space_spec and + # nas_algorithm_spec are obtained from previous NasJob hence should not + # provide them again for this NasJob. + # @!attribute [rw] search_space_spec + # @return [::String] + # It defines the search space for Neural Architecture Search (NAS). + class NasJobSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The spec of multi-trial Neural Architecture Search (NAS). + # @!attribute [rw] multi_trial_algorithm + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec::MultiTrialAlgorithm] + # The multi-trial Neural Architecture Search (NAS) algorithm + # type. Defaults to `REINFORCEMENT_LEARNING`. + # @!attribute [rw] metric + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec::MetricSpec] + # Metric specs for the NAS job. + # Validation for this field is done at `multi_trial_algorithm_spec` field. + # @!attribute [rw] search_trial_spec + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec::SearchTrialSpec] + # Required. Spec for search trials. + # @!attribute [rw] train_trial_spec + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec::TrainTrialSpec] + # Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] + # search trials will be trained for every M + # [TrainTrialSpec.frequency] trials searched. + class MultiTrialAlgorithmSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a metric to optimize. + # @!attribute [rw] metric_id + # @return [::String] + # Required. The ID of the metric. Must not contain whitespaces. + # @!attribute [rw] goal + # @return [::Google::Cloud::AIPlatform::V1::NasJobSpec::MultiTrialAlgorithmSpec::MetricSpec::GoalType] + # Required. The optimization goal of the metric. + class MetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The available types of optimization goals. + module GoalType + # Goal Type will default to maximize. + GOAL_TYPE_UNSPECIFIED = 0 + + # Maximize the goal metric. + MAXIMIZE = 1 + + # Minimize the goal metric. + MINIMIZE = 2 + end + end + + # Represent spec for search trials. + # @!attribute [rw] search_trial_job_spec + # @return [::Google::Cloud::AIPlatform::V1::CustomJobSpec] + # Required. The spec of a search trial job. The same spec applies to + # all search trials. + # @!attribute [rw] max_trial_count + # @return [::Integer] + # Required. The maximum number of Neural Architecture Search (NAS) trials + # to run. + # @!attribute [rw] max_parallel_trial_count + # @return [::Integer] + # Required. The maximum number of trials to run in parallel. + # @!attribute [rw] max_failed_trial_count + # @return [::Integer] + # The number of failed trials that need to be seen before failing + # the NasJob. + # + # If set to 0, Vertex AI decides how many trials must fail + # before the whole job fails. + class SearchTrialSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represent spec for train trials. + # @!attribute [rw] train_trial_job_spec + # @return [::Google::Cloud::AIPlatform::V1::CustomJobSpec] + # Required. The spec of a train trial job. The same spec applies to + # all train trials. + # @!attribute [rw] max_parallel_trial_count + # @return [::Integer] + # Required. The maximum number of trials to run in parallel. + # @!attribute [rw] frequency + # @return [::Integer] + # Required. Frequency of search trials to start train stage. Top N + # [TrainTrialSpec.max_parallel_trial_count] + # search trials will be trained for every M + # [TrainTrialSpec.frequency] trials searched. + class TrainTrialSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The available types of multi-trial algorithms. + module MultiTrialAlgorithm + # Defaults to `REINFORCEMENT_LEARNING`. + MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0 + + # The Reinforcement Learning Algorithm for Multi-trial Neural + # Architecture Search (NAS). + REINFORCEMENT_LEARNING = 1 + + # The Grid Search Algorithm for Multi-trial Neural + # Architecture Search (NAS). + GRID_SEARCH = 2 + end + end + end + + # Represents a uCAIP NasJob output. + # @!attribute [r] multi_trial_job_output + # @return [::Google::Cloud::AIPlatform::V1::NasJobOutput::MultiTrialJobOutput] + # Output only. The output of this multi-trial Neural Architecture Search + # (NAS) job. + class NasJobOutput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The output of a multi-trial Neural Architecture Search (NAS) jobs. + # @!attribute [r] search_trials + # @return [::Array<::Google::Cloud::AIPlatform::V1::NasTrial>] + # Output only. List of NasTrials that were started as part of search stage. + # @!attribute [r] train_trials + # @return [::Array<::Google::Cloud::AIPlatform::V1::NasTrial>] + # Output only. List of NasTrials that were started as part of train stage. + class MultiTrialJobOutput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a uCAIP NasJob trial. + # @!attribute [r] id + # @return [::String] + # Output only. The identifier of the NasTrial assigned by the service. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::NasTrial::State] + # Output only. The detailed state of the NasTrial. + # @!attribute [r] final_measurement + # @return [::Google::Cloud::AIPlatform::V1::Measurement] + # Output only. The final measurement containing the objective value. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasTrial was started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the NasTrial's status changed to `SUCCEEDED` or + # `INFEASIBLE`. + class NasTrial + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a NasTrial state. + module State + # The NasTrial state is unspecified. + STATE_UNSPECIFIED = 0 + + # Indicates that a specific NasTrial has been requested, but it has not yet + # been suggested by the service. + REQUESTED = 1 + + # Indicates that the NasTrial has been suggested. + ACTIVE = 2 + + # Indicates that the NasTrial should stop according to the service. + STOPPING = 3 + + # Indicates that the NasTrial is completed successfully. + SUCCEEDED = 4 + + # Indicates that the NasTrial should not be attempted again. + # The service will set a NasTrial to INFEASIBLE when it's done but missing + # the final_measurement. + INFEASIBLE = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/network_spec.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/network_spec.rb new file mode 100644 index 000000000000..5a2c9b6f1269 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/network_spec.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Network spec. + # @!attribute [rw] enable_internet_access + # @return [::Boolean] + # Whether to enable public internet access. Default false. + # @!attribute [rw] network + # @return [::String] + # The full name of the Google Compute Engine + # [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + # @!attribute [rw] subnetwork + # @return [::String] + # The name of the subnet that this instance is in. + # Format: + # `projects/{project_id_or_number}/regions/{region}/subnetworks/{subnetwork_id}` + class NetworkSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb new file mode 100644 index 000000000000..8231de184e5b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_euc_config.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The euc configuration of NotebookRuntimeTemplate. + # @!attribute [rw] euc_disabled + # @return [::Boolean] + # Input only. Whether EUC is disabled in this NotebookRuntimeTemplate. + # In proto3, the default value of a boolean is false. In this way, by default + # EUC will be enabled for NotebookRuntimeTemplate. + # @!attribute [r] bypass_actas_check + # @return [::Boolean] + # Output only. Whether ActAs check is bypassed for service account attached + # to the VM. If false, we need ActAs check for the default Compute Engine + # Service account. When a Runtime is created, a VM is allocated using Default + # Compute Engine Service Account. Any user requesting to use this Runtime + # requires Service Account User (ActAs) permission over this SA. If true, + # Runtime owner is using EUC and does not require the above permission as VM + # no longer use default Compute Engine SA, but a P4SA. + class NotebookEucConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb new file mode 100644 index 000000000000..d34e21a72916 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # NotebookExecutionJob represents an instance of a notebook execution. + # @!attribute [rw] dataform_repository_source + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob::DataformRepositorySource] + # The Dataform Repository pointing to a single file notebook repository. + # @!attribute [rw] gcs_notebook_source + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob::GcsNotebookSource] + # The Cloud Storage url pointing to the ipynb file. Format: + # `gs://bucket/notebook_file.ipynb` + # @!attribute [rw] direct_notebook_source + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob::DirectNotebookSource] + # The contents of an input notebook file. + # @!attribute [rw] notebook_runtime_template_resource_name + # @return [::String] + # The NotebookRuntimeTemplate to source compute configuration from. + # @!attribute [rw] custom_environment_spec + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob::CustomEnvironmentSpec] + # The custom compute configuration for an execution job. + # @!attribute [rw] gcs_output_uri + # @return [::String] + # The Cloud Storage location to upload the result to. Format: + # `gs://bucket-name` + # @!attribute [rw] execution_user + # @return [::String] + # The user email to run the execution as. Only supported by Colab runtimes. + # @!attribute [rw] service_account + # @return [::String] + # The service account to run the execution as. + # @!attribute [rw] workbench_runtime + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob::WorkbenchRuntime] + # The Workbench runtime configuration to use for the notebook execution. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this NotebookExecutionJob. Format: + # `projects/{project_id}/locations/{location}/notebookExecutionJobs/{job_id}` + # @!attribute [rw] display_name + # @return [::String] + # The display name of the NotebookExecutionJob. The name can be up to 128 + # characters long and can consist of any UTF-8 characters. + # @!attribute [rw] execution_timeout + # @return [::Google::Protobuf::Duration] + # Max running time of the execution job in seconds (default 86400s / 24 hrs). + # @!attribute [r] schedule_resource_name + # @return [::String] + # Output only. The Schedule resource name if this job is triggered by one. + # Format: + # `projects/{project_id}/locations/{location}/schedules/{schedule_id}` + # @!attribute [r] job_state + # @return [::Google::Cloud::AIPlatform::V1::JobState] + # Output only. The state of the NotebookExecutionJob. + # @!attribute [r] status + # @return [::Google::Rpc::Status] + # Output only. Populated when the NotebookExecutionJob is completed. When + # there is an error during notebook execution, the error details are + # populated. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookExecutionJob was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookExecutionJob was most recently + # updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize NotebookExecutionJobs. + # + # 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. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] kernel_name + # @return [::String] + # The name of the kernel to use during notebook execution. If unset, the + # default kernel is used. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for the notebook execution job. + # This field is auto-populated if the + # {::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate NotebookRuntimeTemplate} + # has an encryption spec. + class NotebookExecutionJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Dataform Repository containing the input notebook. + # @!attribute [rw] dataform_repository_resource_name + # @return [::String] + # The resource name of the Dataform Repository. Format: + # `projects/{project_id}/locations/{location}/repositories/{repository_id}` + # @!attribute [rw] commit_sha + # @return [::String] + # The commit SHA to read repository with. If unset, the file will be read + # at HEAD. + class DataformRepositorySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Cloud Storage uri for the input notebook. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage uri pointing to the ipynb file. Format: + # `gs://bucket/notebook_file.ipynb` + # @!attribute [rw] generation + # @return [::String] + # The version of the Cloud Storage object to read. If unset, the current + # version of the object is read. See + # https://cloud.google.com/storage/docs/metadata#generation-number. + class GcsNotebookSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The content of the input notebook in ipynb format. + # @!attribute [rw] content + # @return [::String] + # The base64-encoded contents of the input notebook file. + class DirectNotebookSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compute configuration to use for an execution job. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # The specification of a single machine for the execution job. + # @!attribute [rw] persistent_disk_spec + # @return [::Google::Cloud::AIPlatform::V1::PersistentDiskSpec] + # The specification of a persistent disk to attach for the execution job. + # @!attribute [rw] network_spec + # @return [::Google::Cloud::AIPlatform::V1::NetworkSpec] + # The network configuration to use for the execution job. + class CustomEnvironmentSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a Workbench Instances-based environment. + class WorkbenchRuntime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb new file mode 100644 index 000000000000..51570a76251a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The idle shutdown configuration of NotebookRuntimeTemplate, which contains + # the idle_timeout as required field. + # @!attribute [rw] idle_timeout + # @return [::Google::Protobuf::Duration] + # Required. Duration is accurate to the second. In Notebook, Idle Timeout is + # accurate to minute so the range of idle_timeout (second) is: 10 * 60 ~ 1440 + # * 60. + # @!attribute [rw] idle_shutdown_disabled + # @return [::Boolean] + # Whether Idle Shutdown is disabled in this NotebookRuntimeTemplate. + class NotebookIdleShutdownConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb new file mode 100644 index 000000000000..018675986e24 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A template that specifies runtime configurations such as machine type, + # runtime version, network configurations, etc. + # Multiple runtimes can be created from a runtime template. + # @!attribute [rw] name + # @return [::String] + # The resource name of the NotebookRuntimeTemplate. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the NotebookRuntimeTemplate. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the NotebookRuntimeTemplate. + # @!attribute [r] is_default + # @return [::Boolean] + # Output only. The default template to use if not specified. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # Optional. Immutable. The specification of a single machine for the + # template. + # @!attribute [rw] data_persistent_disk_spec + # @return [::Google::Cloud::AIPlatform::V1::PersistentDiskSpec] + # Optional. The specification of [persistent + # disk][https://cloud.google.com/compute/docs/disks/persistent-disks] + # attached to the runtime as data disk storage. + # @!attribute [rw] network_spec + # @return [::Google::Cloud::AIPlatform::V1::NetworkSpec] + # Optional. Network spec. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the runtime workload runs as. + # You can use any service account within the same project, but you + # must have the service account user permission to use the instance. + # + # If not specified, the [Compute Engine default service + # account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + # is used. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize the + # NotebookRuntimeTemplates. + # + # 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] idle_shutdown_config + # @return [::Google::Cloud::AIPlatform::V1::NotebookIdleShutdownConfig] + # The idle shutdown configuration of NotebookRuntimeTemplate. This config + # will only be set when idle shutdown is enabled. + # @!attribute [rw] euc_config + # @return [::Google::Cloud::AIPlatform::V1::NotebookEucConfig] + # EUC configuration of the NotebookRuntimeTemplate. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookRuntimeTemplate was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookRuntimeTemplate was most recently + # updated. + # @!attribute [rw] notebook_runtime_type + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeType] + # Optional. Immutable. The type of the notebook runtime template. + # @!attribute [rw] shielded_vm_config + # @return [::Google::Cloud::AIPlatform::V1::ShieldedVmConfig] + # Optional. Immutable. Runtime Shielded VM spec. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # Optional. The Compute Engine tags to add to runtime (see [Tagging + # instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for the notebook runtime. + class NotebookRuntimeTemplate + 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 + + # A runtime is a virtual machine allocated to a particular user for a + # particular Notebook file on temporary basis with lifetime limited to 24 + # hours. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the NotebookRuntime. + # @!attribute [rw] runtime_user + # @return [::String] + # Required. The user email of the NotebookRuntime. + # @!attribute [r] notebook_runtime_template_ref + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplateRef] + # Output only. The pointer to NotebookRuntimeTemplate this NotebookRuntime is + # created from. + # @!attribute [r] proxy_uri + # @return [::String] + # Output only. The proxy endpoint used to access the NotebookRuntime. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookRuntime was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookRuntime was most recently updated. + # @!attribute [r] health_state + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime::HealthState] + # Output only. The health state of the NotebookRuntime. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the NotebookRuntime. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] description + # @return [::String] + # The description of the NotebookRuntime. + # @!attribute [r] service_account + # @return [::String] + # Output only. The service account that the NotebookRuntime workload runs as. + # @!attribute [r] runtime_state + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime::RuntimeState] + # Output only. The runtime (instance) state of the NotebookRuntime. + # @!attribute [r] is_upgradable + # @return [::Boolean] + # Output only. Whether NotebookRuntime is upgradable. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your + # NotebookRuntime. + # + # 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. + # No more than 64 user labels can be associated with one NotebookRuntime + # (System labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. Following system labels exist for NotebookRuntime: + # + # * "aiplatform.googleapis.com/notebook_runtime_gce_instance_id": output + # only, its value is the Compute Engine instance id. + # * "aiplatform.googleapis.com/colab_enterprise_entry_service": its value is + # either "bigquery" or "vertex"; if absent, it should be "vertex". This is to + # describe the entry service, either BigQuery or Vertex. + # @!attribute [r] expiration_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this NotebookRuntime will be expired: + # 1. System Predefined NotebookRuntime: 24 hours after creation. After + # expiration, system predifined runtime will be deleted. + # 2. User created NotebookRuntime: 6 months after last upgrade. After + # expiration, user created runtime will be stopped and allowed for upgrade. + # @!attribute [r] version + # @return [::String] + # Output only. The VM os image version of NotebookRuntime. + # @!attribute [r] notebook_runtime_type + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeType] + # Output only. The type of the notebook runtime. + # @!attribute [r] idle_shutdown_config + # @return [::Google::Cloud::AIPlatform::V1::NotebookIdleShutdownConfig] + # Output only. The idle shutdown configuration of the notebook runtime. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # Optional. The Compute Engine tags to add to runtime (see [Tagging + # instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + # @!attribute [r] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Output only. Customer-managed encryption key spec for the notebook runtime. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class NotebookRuntime + 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 + + # The substate of the NotebookRuntime to display health information. + module HealthState + # Unspecified health state. + HEALTH_STATE_UNSPECIFIED = 0 + + # NotebookRuntime is in healthy state. Applies to ACTIVE state. + HEALTHY = 1 + + # NotebookRuntime is in unhealthy state. Applies to ACTIVE state. + UNHEALTHY = 2 + end + + # The substate of the NotebookRuntime to display state of runtime. + # The resource of NotebookRuntime is in ACTIVE state for these sub state. + module RuntimeState + # Unspecified runtime state. + RUNTIME_STATE_UNSPECIFIED = 0 + + # NotebookRuntime is in running state. + RUNNING = 1 + + # NotebookRuntime is in starting state. + BEING_STARTED = 2 + + # NotebookRuntime is in stopping state. + BEING_STOPPED = 3 + + # NotebookRuntime is in stopped state. + STOPPED = 4 + + # NotebookRuntime is in upgrading state. It is in the middle of upgrading + # process. + BEING_UPGRADED = 5 + + # NotebookRuntime was unable to start/stop properly. + ERROR = 100 + + # NotebookRuntime is in invalid state. Cannot be recovered. + INVALID = 101 + end + end + + # Represents a notebook runtime type. + module NotebookRuntimeType + # Unspecified notebook runtime type, NotebookRuntimeType will default to + # USER_DEFINED. + NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED = 0 + + # runtime or template with coustomized configurations from user. + USER_DEFINED = 1 + + # runtime or template with system defined configurations. + ONE_CLICK = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb new file mode 100644 index 000000000000..d81dc163cb1f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_runtime_template_ref.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Points to a NotebookRuntimeTemplateRef. + # @!attribute [rw] notebook_runtime_template + # @return [::String] + # Immutable. A resource name of the NotebookRuntimeTemplate. + class NotebookRuntimeTemplateRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb new file mode 100644 index 000000000000..e38b8f3444bb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb @@ -0,0 +1,546 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#create_notebook_runtime_template NotebookService.CreateNotebookRuntimeTemplate}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the + # NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] notebook_runtime_template + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # Required. The NotebookRuntimeTemplate to create. + # @!attribute [rw] notebook_runtime_template_id + # @return [::String] + # Optional. User specified ID for the notebook runtime template. + class CreateNotebookRuntimeTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#create_notebook_runtime_template NotebookService.CreateNotebookRuntimeTemplate}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateNotebookRuntimeTemplateOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#get_notebook_runtime_template NotebookService.GetNotebookRuntimeTemplate} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntimeTemplate resource. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + class GetNotebookRuntimeTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtime_templates NotebookService.ListNotebookRuntimeTemplates}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the + # NotebookRuntimeTemplates. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `display_name` supports = and != + # * `labels` supports general map functions that is: + # * `labels.key=value` - key:value equality + # * `labels.key:* or labels:key - key existence + # * A key including a space must be quoted. `labels."a key"`. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntimeTemplate=notebookRuntimeTemplate123` + # * `displayName="myDisplayName"` + # * `labels.myKey="myValue"` + # * `notebookRuntimeType=USER_DEFINED` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesResponse#next_page_token ListNotebookRuntimeTemplatesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtime_templates NotebookService.ListNotebookRuntimeTemplates} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to read. + # @!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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + class ListNotebookRuntimeTemplatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtime_templates NotebookService.ListNotebookRuntimeTemplates}. + # @!attribute [rw] notebook_runtime_templates + # @return [::Array<::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate>] + # List of NotebookRuntimeTemplates in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimeTemplatesRequest#page_token ListNotebookRuntimeTemplatesRequest.page_token} + # to obtain that page. + class ListNotebookRuntimeTemplatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#delete_notebook_runtime_template NotebookService.DeleteNotebookRuntimeTemplate}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntimeTemplate resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}` + class DeleteNotebookRuntimeTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#update_notebook_runtime_template NotebookService.UpdateNotebookRuntimeTemplate}. + # @!attribute [rw] notebook_runtime_template + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntimeTemplate] + # Required. The NotebookRuntimeTemplate to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. + # For the `FieldMask` definition, see + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. Input format: + # `{paths: "${updated_filed}"}` Updatable fields: + # + # * `encryption_spec.kms_key_name` + class UpdateNotebookRuntimeTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#assign_notebook_runtime NotebookService.AssignNotebookRuntime}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to get the NotebookRuntime + # assignment. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] notebook_runtime_template + # @return [::String] + # Required. The resource name of the NotebookRuntimeTemplate based on which a + # NotebookRuntime will be assigned (reuse or create a new one). + # @!attribute [rw] notebook_runtime + # @return [::Google::Cloud::AIPlatform::V1::NotebookRuntime] + # Required. Provide runtime specific information (e.g. runtime owner, + # notebook id) used for NotebookRuntime assignment. + # @!attribute [rw] notebook_runtime_id + # @return [::String] + # Optional. User specified ID for the notebook runtime. + class AssignNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#assign_notebook_runtime NotebookService.AssignNotebookRuntime}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] progress_message + # @return [::String] + # A human-readable message that shows the intermediate progress details of + # NotebookRuntime. + class AssignNotebookRuntimeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#get_notebook_runtime NotebookService.GetNotebookRuntime} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntime resource. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + class GetNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtimes NotebookService.ListNotebookRuntimes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the + # NotebookRuntimes. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookRuntime` supports = and !=. `notebookRuntime` represents the + # NotebookRuntime ID, + # i.e. the last segment of the NotebookRuntime's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntime.name]. + # * `displayName` supports = and != and regex. + # * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate` + # represents the NotebookRuntimeTemplate ID, + # i.e. the last segment of the NotebookRuntimeTemplate's [resource name] + # [google.cloud.aiplatform.v1.NotebookRuntimeTemplate.name]. + # * `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, + # HEALTH_STATE_UNSPECIFIED]. + # * `runtimeState` supports = and !=. runtimeState enum: + # [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, + # STOPPED, BEING_UPGRADED, ERROR, INVALID]. + # * `runtimeUser` supports = and !=. + # * API version is UI only: `uiState` supports = and !=. uiState enum: + # [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, + # UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, + # UI_RESOURCE_STATE_CREATION_FAILED]. + # * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: + # [USER_DEFINED, ONE_CLICK]. + # + # Some examples: + # + # * `notebookRuntime="notebookRuntime123"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` + # * `healthState=HEALTHY` + # * `runtimeState=RUNNING` + # * `runtimeUser="test@google.com"` + # * `uiState=UI_RESOURCE_STATE_BEING_DELETED` + # * `notebookRuntimeType=USER_DEFINED` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesResponse#next_page_token ListNotebookRuntimesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtimes NotebookService.ListNotebookRuntimes} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to read. + # @!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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + class ListNotebookRuntimesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_runtimes NotebookService.ListNotebookRuntimes}. + # @!attribute [rw] notebook_runtimes + # @return [::Array<::Google::Cloud::AIPlatform::V1::NotebookRuntime>] + # List of NotebookRuntimes in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListNotebookRuntimesRequest#page_token ListNotebookRuntimesRequest.page_token} + # to obtain that page. + class ListNotebookRuntimesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#delete_notebook_runtime NotebookService.DeleteNotebookRuntime}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntime resource to be deleted. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + class DeleteNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#upgrade_notebook_runtime NotebookService.UpgradeNotebookRuntime}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntime resource to be upgrade. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + class UpgradeNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#upgrade_notebook_runtime NotebookService.UpgradeNotebookRuntime}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] progress_message + # @return [::String] + # A human-readable message that shows the intermediate progress details of + # NotebookRuntime. + class UpgradeNotebookRuntimeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#upgrade_notebook_runtime NotebookService.UpgradeNotebookRuntime}. + class UpgradeNotebookRuntimeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#start_notebook_runtime NotebookService.StartNotebookRuntime}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntime resource to be started. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + class StartNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#start_notebook_runtime NotebookService.StartNotebookRuntime}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] progress_message + # @return [::String] + # A human-readable message that shows the intermediate progress details of + # NotebookRuntime. + class StartNotebookRuntimeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#start_notebook_runtime NotebookService.StartNotebookRuntime}. + class StartNotebookRuntimeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#stop_notebook_runtime NotebookService.StopNotebookRuntime}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookRuntime resource to be stopped. + # Instead of checking whether the name is in valid NotebookRuntime resource + # name format, directly throw NotFound exception if there is no such + # NotebookRuntime in spanner. + class StopNotebookRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#stop_notebook_runtime NotebookService.StopNotebookRuntime}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class StopNotebookRuntimeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#stop_notebook_runtime NotebookService.StopNotebookRuntime}. + class StopNotebookRuntimeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [NotebookService.CreateNotebookExecutionJob] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the + # NotebookExecutionJob. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] notebook_execution_job + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJob] + # Required. The NotebookExecutionJob to create. + # @!attribute [rw] notebook_execution_job_id + # @return [::String] + # Optional. User specified ID for the NotebookExecutionJob. + class CreateNotebookExecutionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata information for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#create_notebook_execution_job NotebookService.CreateNotebookExecutionJob}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + # @!attribute [rw] progress_message + # @return [::String] + # A human-readable message that shows the intermediate progress details of + # NotebookRuntime. + class CreateNotebookExecutionJobOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [NotebookService.GetNotebookExecutionJob] + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookExecutionJob resource. + # @!attribute [rw] view + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + class GetNotebookExecutionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [NotebookService.ListNotebookExecutionJobs] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location from which to list the + # NotebookExecutionJobs. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. For field + # names both snake_case and camelCase are supported. + # + # * `notebookExecutionJob` supports = and !=. `notebookExecutionJob` + # represents the NotebookExecutionJob ID. + # * `displayName` supports = and != and regex. + # * `schedule` supports = and != and regex. + # + # Some examples: + # * `notebookExecutionJob="123"` + # * `notebookExecutionJob="my-execution-job"` + # * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsResponse#next_page_token ListNotebookExecutionJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#list_notebook_execution_jobs NotebookService.ListNotebookExecutionJobs} + # call. + # @!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: + # + # * `display_name` + # * `create_time` + # * `update_time` + # + # Example: `display_name, create_time desc`. + # @!attribute [rw] view + # @return [::Google::Cloud::AIPlatform::V1::NotebookExecutionJobView] + # Optional. The NotebookExecutionJob view. Defaults to BASIC. + class ListNotebookExecutionJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for [NotebookService.CreateNotebookExecutionJob] + # @!attribute [rw] notebook_execution_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::NotebookExecutionJob>] + # List of NotebookExecutionJobs in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListNotebookExecutionJobsRequest#page_token ListNotebookExecutionJobsRequest.page_token} + # to obtain that page. + class ListNotebookExecutionJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [NotebookService.DeleteNotebookExecutionJob] + # @!attribute [rw] name + # @return [::String] + # Required. The name of the NotebookExecutionJob resource to be deleted. + class DeleteNotebookExecutionJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Views for Get/List NotebookExecutionJob + module NotebookExecutionJobView + # When unspecified, the API defaults to the BASIC view. + NOTEBOOK_EXECUTION_JOB_VIEW_UNSPECIFIED = 0 + + # Includes all fields except for direct notebook inputs. + NOTEBOOK_EXECUTION_JOB_VIEW_BASIC = 1 + + # Includes all fields. + NOTEBOOK_EXECUTION_JOB_VIEW_FULL = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/openapi.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/openapi.rb new file mode 100644 index 000000000000..f9d97418c511 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/openapi.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Schema is used to define the format of input/output data. Represents a select + # subset of an [OpenAPI 3.0 schema + # object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may + # be added in the future as needed. + # @!attribute [rw] type + # @return [::Google::Cloud::AIPlatform::V1::Type] + # Optional. The type of the data. + # @!attribute [rw] format + # @return [::String] + # Optional. The format of the data. + # Supported formats: + # for NUMBER type: "float", "double" + # for INTEGER type: "int32", "int64" + # for STRING type: "email", "byte", etc + # @!attribute [rw] title + # @return [::String] + # Optional. The title of the Schema. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the data. + # @!attribute [rw] nullable + # @return [::Boolean] + # Optional. Indicates if the value may be null. + # @!attribute [rw] default + # @return [::Google::Protobuf::Value] + # Optional. Default value of the data. + # @!attribute [rw] items + # @return [::Google::Cloud::AIPlatform::V1::Schema] + # Optional. SCHEMA FIELDS FOR TYPE ARRAY + # Schema of the elements of Type.ARRAY. + # @!attribute [rw] min_items + # @return [::Integer] + # Optional. Minimum number of the elements for Type.ARRAY. + # @!attribute [rw] max_items + # @return [::Integer] + # Optional. Maximum number of the elements for Type.ARRAY. + # @!attribute [rw] enum + # @return [::Array<::String>] + # Optional. Possible values of the element of primitive type with enum + # format. Examples: + # 1. We can define direction as : + # \\{type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} + # 2. We can define apartment number as : + # \\{type:INTEGER, format:enum, enum:["101", "201", "301"]} + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::Schema}] + # Optional. SCHEMA FIELDS FOR TYPE OBJECT + # Properties of Type.OBJECT. + # @!attribute [rw] property_ordering + # @return [::Array<::String>] + # Optional. The order of the properties. + # Not a standard field in open api spec. Only used to support the order of + # the properties. + # @!attribute [rw] required + # @return [::Array<::String>] + # Optional. Required properties of Type.OBJECT. + # @!attribute [rw] min_properties + # @return [::Integer] + # Optional. Minimum number of the properties for Type.OBJECT. + # @!attribute [rw] max_properties + # @return [::Integer] + # Optional. Maximum number of the properties for Type.OBJECT. + # @!attribute [rw] minimum + # @return [::Float] + # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER + # Minimum value of the Type.INTEGER and Type.NUMBER + # @!attribute [rw] maximum + # @return [::Float] + # Optional. Maximum value of the Type.INTEGER and Type.NUMBER + # @!attribute [rw] min_length + # @return [::Integer] + # Optional. SCHEMA FIELDS FOR TYPE STRING + # Minimum length of the Type.STRING + # @!attribute [rw] max_length + # @return [::Integer] + # Optional. Maximum length of the Type.STRING + # @!attribute [rw] pattern + # @return [::String] + # Optional. Pattern of the Type.STRING to restrict a string to a regular + # expression. + # @!attribute [rw] example + # @return [::Google::Protobuf::Value] + # Optional. Example of the object. Will only populated when the object is the + # root. + # @!attribute [rw] any_of + # @return [::Array<::Google::Cloud::AIPlatform::V1::Schema>] + # Optional. The value should be validated against any (one or more) of the + # subschemas in the list. + class Schema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::Schema] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Type contains the list of OpenAPI data types as defined by + # https://swagger.io/docs/specification/data-models/data-types/ + module Type + # Not specified, should not be used. + TYPE_UNSPECIFIED = 0 + + # OpenAPI string type + STRING = 1 + + # OpenAPI number type + NUMBER = 2 + + # OpenAPI integer type + INTEGER = 3 + + # OpenAPI boolean type + BOOLEAN = 4 + + # OpenAPI array type + ARRAY = 5 + + # OpenAPI object type + OBJECT = 6 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/operation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/operation.rb new file mode 100644 index 000000000000..c5f44bb865ec --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/operation.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Generic Metadata shared by all operations. + # @!attribute [r] partial_failures + # @return [::Array<::Google::Rpc::Status>] + # Output only. Partial failures encountered. + # E.g. single files that couldn't be read. + # This field should never exceed 20 entries. + # Status details field will contain standard Google Cloud error details. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the operation was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the operation was updated for the last time. + # If the operation has finished (successfully or not), this is the finish + # time. + class GenericOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform deletes of any entities. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class DeleteOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb new file mode 100644 index 000000000000..8429d579c07b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource.rb @@ -0,0 +1,329 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents long-lasting resources that are dedicated to users to runs custom + # workloads. + # A PersistentResource can have multiple node pools and each node + # pool can have its own machine spec. + # @!attribute [rw] name + # @return [::String] + # Immutable. Resource name of a PersistentResource. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the PersistentResource. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] resource_pools + # @return [::Array<::Google::Cloud::AIPlatform::V1::ResourcePool>] + # Required. The spec of the pools of different resources. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource::State] + # Output only. The detailed state of a Study. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when persistent resource's state is `STOPPING` + # or `ERROR`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the PersistentResource was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the PersistentResource for the first time entered + # the `RUNNING` state. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the PersistentResource was most recently updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata to organize + # PersistentResource. + # + # 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] network + # @return [::String] + # Optional. The full name of the Compute Engine + # [network](/compute/docs/networks-and-firewalls#networks) to peered with + # Vertex AI to host the persistent resources. + # For example, `projects/12345/global/networks/myVPC`. + # [Format](/compute/docs/reference/rest/v1/networks/insert) + # is of the form `projects/{project}/global/networks/{network}`. + # Where \\{project} is a project number, as in `12345`, and \\{network} is a + # network name. + # + # To specify this field, you must have already [configured VPC Network + # Peering for Vertex + # AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). + # + # If this field is left unspecified, the resources aren't peered with any + # network. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Optional. Customer-managed encryption key spec for a PersistentResource. + # If set, this PersistentResource and all sub-resources of this + # PersistentResource will be secured by this key. + # @!attribute [rw] resource_runtime_spec + # @return [::Google::Cloud::AIPlatform::V1::ResourceRuntimeSpec] + # Optional. Persistent Resource runtime spec. + # For example, used for Ray cluster configuration. + # @!attribute [r] resource_runtime + # @return [::Google::Cloud::AIPlatform::V1::ResourceRuntime] + # Output only. Runtime information of the Persistent Resource. + # @!attribute [rw] reserved_ip_ranges + # @return [::Array<::String>] + # Optional. A list of names for the reserved IP ranges under the VPC network + # that can be used for this persistent resource. + # + # If set, we will deploy the persistent resource within the provided IP + # ranges. Otherwise, the persistent resource is deployed to any IP + # ranges under the provided VPC network. + # + # Example: ['vertex-ai-ip-range']. + class PersistentResource + 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 + + # Describes the PersistentResource state. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # The PROVISIONING state indicates the persistent resources is being + # created. + PROVISIONING = 1 + + # The RUNNING state indicates the persistent resource is healthy and fully + # usable. + RUNNING = 3 + + # The STOPPING state indicates the persistent resource is being deleted. + STOPPING = 4 + + # The ERROR state indicates the persistent resource may be unusable. + # Details can be found in the `error` field. + ERROR = 5 + + # The REBOOTING state indicates the persistent resource is being rebooted + # (PR is not available right now but is expected to be ready again later). + REBOOTING = 6 + + # The UPDATING state indicates the persistent resource is being updated. + UPDATING = 7 + end + end + + # Represents the spec of a group of resources of the same type, + # for example machine type, disk, and accelerators, in a PersistentResource. + # @!attribute [rw] id + # @return [::String] + # Immutable. The unique ID in a PersistentResource for referring to this + # resource pool. User can specify it if necessary. Otherwise, it's generated + # automatically. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::AIPlatform::V1::MachineSpec] + # Required. Immutable. The specification of a single machine. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The total number of machines to use for this resource pool. + # @!attribute [rw] disk_spec + # @return [::Google::Cloud::AIPlatform::V1::DiskSpec] + # Optional. Disk spec for the machine in this node pool. + # @!attribute [r] used_replica_count + # @return [::Integer] + # Output only. The number of machines currently in use by training jobs for + # this resource pool. Will replace idle_replica_count. + # @!attribute [rw] autoscaling_spec + # @return [::Google::Cloud::AIPlatform::V1::ResourcePool::AutoscalingSpec] + # Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling + class ResourcePool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The min/max number of replicas allowed if enabling autoscaling + # @!attribute [rw] min_replica_count + # @return [::Integer] + # Optional. min replicas in the node pool, + # must be ≤ replica_count and < max_replica_count or will throw error. + # For autoscaling enabled Ray-on-Vertex, we allow min_replica_count of a + # resource_pool to be 0 to match the OSS Ray + # behavior(https://docs.ray.io/en/latest/cluster/vms/user-guides/configuring-autoscaling.html#cluster-config-parameters). + # As for Persistent Resource, the min_replica_count must be > 0, we added + # a corresponding validation inside + # CreatePersistentResourceRequestValidator.java. + # @!attribute [rw] max_replica_count + # @return [::Integer] + # Optional. max replicas in the node pool, + # must be ≥ replica_count and > min_replica_count or will throw error + class AutoscalingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for the runtime on a PersistentResource instance, including + # but not limited to: + # + # * Service accounts used to run the workloads. + # * Whether to make it a dedicated Ray Cluster. + # @!attribute [rw] service_account_spec + # @return [::Google::Cloud::AIPlatform::V1::ServiceAccountSpec] + # Optional. Configure the use of workload identity on the PersistentResource + # @!attribute [rw] ray_spec + # @return [::Google::Cloud::AIPlatform::V1::RaySpec] + # Optional. Ray cluster configuration. + # Required when creating a dedicated RayCluster on the PersistentResource. + class ResourceRuntimeSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration information for the Ray cluster. + # For experimental launch, Ray cluster creation and Persistent + # cluster creation are 1:1 mapping: We will provision all the nodes within the + # Persistent cluster as Ray nodes. + # @!attribute [rw] image_uri + # @return [::String] + # Optional. Default image for user to choose a preferred ML framework + # (for example, TensorFlow or Pytorch) by choosing from [Vertex prebuilt + # images](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + # Either this or the resource_pool_images is required. Use this field if + # you need all the resource pools to have the same Ray image. Otherwise, use + # the \\{@code resource_pool_images} field. + # @!attribute [rw] resource_pool_images + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Required if image_uri isn't set. A map of resource_pool_id to + # prebuild Ray image if user need to use different images for different + # head/worker pools. This map needs to cover all the resource pool ids. + # Example: + # { + # "ray_head_node_pool": "head image" + # "ray_worker_node_pool1": "worker image" + # "ray_worker_node_pool2": "another worker image" + # } + # @!attribute [rw] head_node_resource_pool_id + # @return [::String] + # Optional. This will be used to indicate which resource pool will serve as + # the Ray head node(the first node within that pool). Will use the machine + # from the first workerpool as the head node by default if this field isn't + # set. + # @!attribute [rw] ray_metric_spec + # @return [::Google::Cloud::AIPlatform::V1::RayMetricSpec] + # Optional. Ray metrics configurations. + # @!attribute [rw] ray_logs_spec + # @return [::Google::Cloud::AIPlatform::V1::RayLogsSpec] + # Optional. OSS Ray logging configurations. + class RaySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourcePoolImagesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Persistent Cluster runtime information as output + # @!attribute [r] access_uris + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. URIs for user to connect to the Cluster. + # Example: + # { + # "RAY_HEAD_NODE_INTERNAL_IP": "head-node-IP:10001" + # "RAY_DASHBOARD_URI": "ray-dashboard-address:8888" + # } + class ResourceRuntime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AccessUrisEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for the use of custom service account to run the workloads. + # @!attribute [rw] enable_custom_service_account + # @return [::Boolean] + # Required. If true, custom user-managed service account is enforced to run + # any workloads (for example, Vertex Jobs) on the resource. Otherwise, uses + # the [Vertex AI Custom Code Service + # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). + # @!attribute [rw] service_account + # @return [::String] + # Optional. Required when all below conditions are met + # * `enable_custom_service_account` is true; + # * any runtime is specified via `ResourceRuntimeSpec` on creation time, + # for example, Ray + # + # The users must have `iam.serviceAccounts.actAs` permission on this service + # account and then the specified runtime containers will run as it. + # + # Do not set this field if you want to submit jobs using custom service + # account to this PersistentResource after creation, but only specify the + # `service_account` inside the job. + class ServiceAccountSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the Ray metrics. + # @!attribute [rw] disabled + # @return [::Boolean] + # Optional. Flag to disable the Ray metrics collection. + class RayMetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the Ray OSS Logs. + # @!attribute [rw] disabled + # @return [::Boolean] + # Optional. Flag to disable the export of Ray OSS logs to Cloud Logging. + class RayLogsSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb new file mode 100644 index 000000000000..dca14a007fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#create_persistent_resource PersistentResourceService.CreatePersistentResource}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the + # PersistentResource in. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] persistent_resource + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource] + # Required. The PersistentResource to create. + # @!attribute [rw] persistent_resource_id + # @return [::String] + # Required. The ID to use for the PersistentResource, which become the final + # component of the PersistentResource's resource name. + # + # The maximum length is 63 characters, and valid characters + # are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + class CreatePersistentResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create PersistentResource. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for PersistentResource. + # @!attribute [rw] progress_message + # @return [::String] + # Progress Message for Create LRO + class CreatePersistentResourceOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update PersistentResource. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for PersistentResource. + # @!attribute [rw] progress_message + # @return [::String] + # Progress Message for Update LRO + class UpdatePersistentResourceOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform reboot PersistentResource. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for PersistentResource. + # @!attribute [rw] progress_message + # @return [::String] + # Progress Message for Reboot LRO + class RebootPersistentResourceOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#get_persistent_resource PersistentResourceService.GetPersistentResource}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + class GetPersistentResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#list_persistent_resources PersistentResourceService.ListPersistentResources}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the PersistentResources + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesResponse#next_page_token ListPersistentResourcesResponse.next_page_token} + # of the previous [PersistentResourceService.ListPersistentResource][] call. + class ListPersistentResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#list_persistent_resources PersistentResourceService.ListPersistentResources} + # @!attribute [rw] persistent_resources + # @return [::Array<::Google::Cloud::AIPlatform::V1::PersistentResource>] + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListPersistentResourcesRequest#page_token ListPersistentResourcesRequest.page_token} + # to obtain that page. + class ListPersistentResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#delete_persistent_resource PersistentResourceService.DeletePersistentResource}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PersistentResource to be deleted. + # Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + class DeletePersistentResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdatePersistentResource method. + # @!attribute [rw] persistent_resource + # @return [::Google::Cloud::AIPlatform::V1::PersistentResource] + # Required. The PersistentResource to update. + # + # The PersistentResource's `name` field is used to identify the + # PersistentResource to update. Format: + # `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specify the fields to be overwritten in the PersistentResource by + # the update method. + class UpdatePersistentResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PersistentResourceService::Client#reboot_persistent_resource PersistentResourceService.RebootPersistentResource}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PersistentResource resource. + # Format: + # `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}` + class RebootPersistentResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_failure_policy.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_failure_policy.rb new file mode 100644 index 000000000000..de0f88f3c785 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_failure_policy.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Represents the failure policy of a pipeline. Currently, the default of a + # pipeline is that the pipeline will continue to run until no more tasks can be + # executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a + # pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling + # any new tasks when a task has failed. Any scheduled tasks will continue to + # completion. + module PipelineFailurePolicy + # Default value, and follows fail slow behavior. + PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0 + + # Indicates that the pipeline should continue to run until all possible + # tasks have been scheduled and completed. + PIPELINE_FAILURE_POLICY_FAIL_SLOW = 1 + + # Indicates that the pipeline should stop scheduling new tasks after a task + # has failed. + PIPELINE_FAILURE_POLICY_FAIL_FAST = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb new file mode 100644 index 000000000000..9e50a585e975 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb @@ -0,0 +1,458 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # An instance of a machine learning PipelineJob. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the PipelineJob. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Pipeline. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Pipeline creation time. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Pipeline start time. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Pipeline end time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this PipelineJob was most recently updated. + # @!attribute [rw] pipeline_spec + # @return [::Google::Protobuf::Struct] + # The spec of the pipeline. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::PipelineState] + # Output only. The detailed state of the job. + # @!attribute [r] job_detail + # @return [::Google::Cloud::AIPlatform::V1::PipelineJobDetail] + # Output only. The details of pipeline run. Not available in the list view. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. The error that occurred during pipeline execution. + # Only populated when the pipeline's state is FAILED or CANCELLED. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize PipelineJob. + # + # 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. + # + # Note there is some reserved label key for Vertex AI Pipelines. + # - `vertex-ai-pipelines-run-billing-id`, user set value will get overrided. + # @!attribute [rw] runtime_config + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob::RuntimeConfig] + # Runtime config of the pipeline. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a pipelineJob. If set, this + # PipelineJob and all of its sub-resources will be secured by this key. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the pipeline workload runs as. + # If not specified, the Compute Engine default service account in the project + # will be used. + # See + # https://cloud.google.com/compute/docs/access/service-accounts#default_service_account + # + # Users starting the pipeline must have the `iam.serviceAccounts.actAs` + # permission on this service account. + # @!attribute [rw] network + # @return [::String] + # The full name of the Compute Engine + # [network](/compute/docs/networks-and-firewalls#networks) to which the + # Pipeline Job's workload should be peered. For example, + # `projects/12345/global/networks/myVPC`. + # [Format](/compute/docs/reference/rest/v1/networks/insert) + # is of the form `projects/{project}/global/networks/{network}`. + # Where \\{project} is a project number, as in `12345`, and \\{network} is a + # network name. + # + # Private services access must already be configured for the network. + # Pipeline job will apply the network configuration to the Google Cloud + # resources being launched, if applied, such as Vertex AI + # Training or Dataflow job. If left unspecified, the workload is not peered + # with any network. + # @!attribute [rw] reserved_ip_ranges + # @return [::Array<::String>] + # A list of names for the reserved ip ranges under the VPC network + # that can be used for this Pipeline Job's workload. + # + # If set, we will deploy the Pipeline Job's workload within the provided ip + # ranges. Otherwise, the job will be deployed to any ip ranges under the + # provided VPC network. + # + # Example: ['vertex-ai-ip-range']. + # @!attribute [rw] template_uri + # @return [::String] + # A template uri from where the + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec}, + # if empty, will be downloaded. Currently, only uri from Vertex Template + # Registry & Gallery is supported. Reference to + # https://cloud.google.com/vertex-ai/docs/pipelines/create-pipeline-template. + # @!attribute [r] template_metadata + # @return [::Google::Cloud::AIPlatform::V1::PipelineTemplateMetadata] + # Output only. Pipeline template metadata. Will fill up fields if + # {::Google::Cloud::AIPlatform::V1::PipelineJob#template_uri PipelineJob.template_uri} + # is from supported template registry. + # @!attribute [r] schedule_name + # @return [::String] + # Output only. The schedule resource name. + # Only returned if the Pipeline is created by Schedule API. + # @!attribute [rw] preflight_validations + # @return [::Boolean] + # Optional. Whether to do component level validations before job creation. + class PipelineJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The runtime config of a PipelineJob. + # @!attribute [rw] parameters + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::Value}] + # Deprecated. Use + # {::Google::Cloud::AIPlatform::V1::PipelineJob::RuntimeConfig#parameter_values RuntimeConfig.parameter_values} + # instead. The runtime parameters of the PipelineJob. The parameters will + # be passed into + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} + # to replace the placeholders at runtime. This field is used by pipelines + # built using `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower, + # such as pipelines built using Kubeflow Pipelines SDK 1.8 or lower. + # @!attribute [rw] gcs_output_directory + # @return [::String] + # Required. A path in a Cloud Storage bucket, which will be treated as the + # root output directory of the pipeline. It is used by the system to + # generate the paths of output artifacts. The artifact paths are generated + # with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the + # specified output directory. The service account specified in this + # pipeline must have the `storage.objects.get` and `storage.objects.create` + # permissions for this bucket. + # @!attribute [rw] parameter_values + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # The runtime parameters of the PipelineJob. The parameters will be + # passed into + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} + # to replace the placeholders at runtime. This field is used by pipelines + # built using `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as + # pipelines built using Kubeflow Pipelines SDK 1.9 or higher and the v2 + # DSL. + # @!attribute [rw] failure_policy + # @return [::Google::Cloud::AIPlatform::V1::PipelineFailurePolicy] + # Represents the failure policy of a pipeline. Currently, the default of a + # pipeline is that the pipeline will continue to run until no more tasks + # can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. + # However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it + # will stop scheduling any new tasks when a task has failed. Any scheduled + # tasks will continue to completion. + # @!attribute [rw] input_artifacts + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::PipelineJob::RuntimeConfig::InputArtifact}] + # The runtime artifacts of the PipelineJob. The key will be the input + # artifact name and the value would be one of the InputArtifact. + class RuntimeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of an input artifact. + # @!attribute [rw] artifact_id + # @return [::String] + # Artifact resource id from MLMD. Which is the last portion of an + # artifact resource name: + # `projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}`. + # The artifact must stay within the same project, location and default + # metadatastore as the pipeline. + class InputArtifact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::Value] + class ParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ParameterValuesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob::RuntimeConfig::InputArtifact] + class InputArtifactsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Pipeline template metadata if + # {::Google::Cloud::AIPlatform::V1::PipelineJob#template_uri PipelineJob.template_uri} + # is from supported template registry. Currently, the only supported registry + # is Artifact Registry. + # @!attribute [rw] version + # @return [::String] + # The version_name in artifact registry. + # + # Will always be presented in output if the + # {::Google::Cloud::AIPlatform::V1::PipelineJob#template_uri PipelineJob.template_uri} + # is from supported template registry. + # + # Format is "sha256:abcdef123456...". + class PipelineTemplateMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The runtime detail of PipelineJob. + # @!attribute [r] pipeline_context + # @return [::Google::Cloud::AIPlatform::V1::Context] + # Output only. The context of the pipeline. + # @!attribute [r] pipeline_run_context + # @return [::Google::Cloud::AIPlatform::V1::Context] + # Output only. The context of the current pipeline run. + # @!attribute [r] task_details + # @return [::Array<::Google::Cloud::AIPlatform::V1::PipelineTaskDetail>] + # Output only. The runtime details of the tasks under the pipeline. + class PipelineJobDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The runtime detail of a task execution. + # @!attribute [r] task_id + # @return [::Integer] + # Output only. The system generated ID of the task. + # @!attribute [r] parent_task_id + # @return [::Integer] + # Output only. The id of the parent task if the task is within a component + # scope. Empty if the task is at the root level. + # @!attribute [r] task_name + # @return [::String] + # Output only. The user specified name of the task that is defined in + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec pipeline_spec}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Task create time. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Task start time. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Task end time. + # @!attribute [r] executor_detail + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskExecutorDetail] + # Output only. The detailed execution info. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::State] + # Output only. State of the task. + # @!attribute [r] execution + # @return [::Google::Cloud::AIPlatform::V1::Execution] + # Output only. The execution metadata of the task. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. The error that occurred during task execution. + # Only populated when the task's state is FAILED or CANCELLED. + # @!attribute [r] pipeline_task_status + # @return [::Array<::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::PipelineTaskStatus>] + # Output only. A list of task status. This field keeps a record of task + # status evolving over time. + # @!attribute [r] inputs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::ArtifactList}] + # Output only. The runtime input artifacts of the task. + # @!attribute [r] outputs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::ArtifactList}] + # Output only. The runtime output artifacts of the task. + class PipelineTaskDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single record of the task status. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time of this status. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::State] + # Output only. The state of the task. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. The error that occurred during the state. May be set when + # the state is any of the non-final state (PENDING/RUNNING/CANCELLING) or + # FAILED state. If the state is FAILED, the error here is final and not + # going to be retried. If the state is a non-final state, the error + # indicates a system-error being retried. + class PipelineTaskStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of artifact metadata. + # @!attribute [r] artifacts + # @return [::Array<::Google::Cloud::AIPlatform::V1::Artifact>] + # Output only. A list of artifact metadata. + class ArtifactList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::ArtifactList] + class InputsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskDetail::ArtifactList] + class OutputsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies state of TaskExecution + module State + # Unspecified. + STATE_UNSPECIFIED = 0 + + # Specifies pending state for the task. + PENDING = 1 + + # Specifies task is being executed. + RUNNING = 2 + + # Specifies task completed successfully. + SUCCEEDED = 3 + + # Specifies Task cancel is in pending state. + CANCEL_PENDING = 4 + + # Specifies task is being cancelled. + CANCELLING = 5 + + # Specifies task was cancelled. + CANCELLED = 6 + + # Specifies task failed. + FAILED = 7 + + # Specifies task was skipped due to cache hit. + SKIPPED = 8 + + # Specifies that the task was not triggered because the task's trigger + # policy is not satisfied. The trigger policy is specified in the + # `condition` field of + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec}. + NOT_TRIGGERED = 9 + end + end + + # The runtime detail of a pipeline executor. + # @!attribute [r] container_detail + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskExecutorDetail::ContainerDetail] + # Output only. The detailed info for a container executor. + # @!attribute [r] custom_job_detail + # @return [::Google::Cloud::AIPlatform::V1::PipelineTaskExecutorDetail::CustomJobDetail] + # Output only. The detailed info for a custom job executor. + class PipelineTaskExecutorDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The detail of a container execution. It contains the job names of the + # lifecycle of a container execution. + # @!attribute [r] main_job + # @return [::String] + # Output only. The name of the + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the main container + # execution. + # @!attribute [r] pre_caching_check_job + # @return [::String] + # Output only. The name of the + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the + # pre-caching-check container execution. This job will be available if the + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} + # specifies the `pre_caching_check` hook in the lifecycle events. + # @!attribute [r] failed_main_jobs + # @return [::Array<::String>] + # Output only. The names of the previously failed + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the main container + # executions. The list includes the all attempts in chronological order. + # @!attribute [r] failed_pre_caching_check_jobs + # @return [::Array<::String>] + # Output only. The names of the previously failed + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the + # pre-caching-check container executions. This job will be available if the + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} + # specifies the `pre_caching_check` hook in the lifecycle events. The list + # includes the all attempts in chronological order. + class ContainerDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The detailed info for a custom job executor. + # @!attribute [r] job + # @return [::String] + # Output only. The name of the + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob}. + # @!attribute [r] failed_jobs + # @return [::Array<::String>] + # Output only. The names of the previously failed + # {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob}. The list includes the + # all attempts in chronological order. + class CustomJobDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_service.rb new file mode 100644 index 000000000000..49a703e2ff82 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_service.rb @@ -0,0 +1,353 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#batch_cancel_pipeline_jobs PipelineService.BatchCancelPipelineJobs}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class BatchCancelPipelineJobsOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#create_training_pipeline PipelineService.CreateTrainingPipeline}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the TrainingPipeline + # in. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] training_pipeline + # @return [::Google::Cloud::AIPlatform::V1::TrainingPipeline] + # Required. The TrainingPipeline to create. + class CreateTrainingPipelineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#get_training_pipeline PipelineService.GetTrainingPipeline}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TrainingPipeline resource. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + class GetTrainingPipelineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_training_pipelines PipelineService.ListTrainingPipelines}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the TrainingPipelines + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # + # Supported fields: + # + # * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + # * `state` supports `=`, `!=` comparisons. + # * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + # * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + # `create_time` must be in RFC 3339 format. + # * `labels` supports general map functions that is: + # `labels.key=value` - key:value equality + # `labels.key:* - key existence + # + # Some examples of using the filter are: + # + # * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + # * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + # * `NOT display_name="my_pipeline"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `training_task_definition:"*automl_text_classification*"` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesResponse#next_page_token ListTrainingPipelinesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_training_pipelines PipelineService.ListTrainingPipelines} + # call. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListTrainingPipelinesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_training_pipelines PipelineService.ListTrainingPipelines} + # @!attribute [rw] training_pipelines + # @return [::Array<::Google::Cloud::AIPlatform::V1::TrainingPipeline>] + # List of TrainingPipelines in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest#page_token ListTrainingPipelinesRequest.page_token} + # to obtain that page. + class ListTrainingPipelinesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#delete_training_pipeline PipelineService.DeleteTrainingPipeline}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TrainingPipeline resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + class DeleteTrainingPipelineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#cancel_training_pipeline PipelineService.CancelTrainingPipeline}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TrainingPipeline to cancel. + # Format: + # `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + class CancelTrainingPipelineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#create_pipeline_job PipelineService.CreatePipelineJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the PipelineJob in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] pipeline_job + # @return [::Google::Cloud::AIPlatform::V1::PipelineJob] + # Required. The PipelineJob to create. + # @!attribute [rw] pipeline_job_id + # @return [::String] + # The ID to use for the PipelineJob, which will become the final component of + # the PipelineJob name. If not provided, an ID will be automatically + # generated. + # + # This value should be less than 128 characters, and valid characters + # are `/[a-z][0-9]-/`. + class CreatePipelineJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#get_pipeline_job PipelineService.GetPipelineJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PipelineJob resource. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + class GetPipelineJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_pipeline_jobs PipelineService.ListPipelineJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the PipelineJobs from. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the PipelineJobs that match the filter expression. The following + # fields are supported: + # + # * `pipeline_name`: Supports `=` and `!=` comparisons. + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + # for example, can check if pipeline's display_name contains *step* by + # doing display_name:\"*step*\" + # * `state`: Supports `=` and `!=` comparisons. + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `labels`: Supports key-value equality and key presence. + # * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `template_metadata.version`: Supports `=`, `!=` comparisons, and `:` + # wildcard. + # + # Filter expressions can be combined together using logical operators + # (`AND` & `OR`). + # For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + # + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `create_time>"2021-05-18T00:00:00Z" OR + # update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + # after 2020-05-18 00:00:00 UTC. + # * `labels.env = "prod"` + # PipelineJobs with label "env" set to "prod". + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsResponse#next_page_token ListPipelineJobsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_pipeline_jobs PipelineService.ListPipelineJobs} + # call. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided e.g. "create_time desc, end_time", + # "end_time, start_time, update_time" For example, using "create_time desc, + # end_time" will order results by create time in descending order, and if + # there are multiple jobs having the same create time, order them by the end + # time in ascending order. if order_by is not specified, it will order by + # default order is create time in descending order. Supported fields: + # + # * `create_time` + # * `update_time` + # * `end_time` + # * `start_time` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListPipelineJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#list_pipeline_jobs PipelineService.ListPipelineJobs} + # @!attribute [rw] pipeline_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # List of PipelineJobs in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest#page_token ListPipelineJobsRequest.page_token} + # to obtain that page. + class ListPipelineJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#delete_pipeline_job PipelineService.DeletePipelineJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PipelineJob resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + class DeletePipelineJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#batch_delete_pipeline_jobs PipelineService.BatchDeletePipelineJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The names of the PipelineJobs to delete. + # A maximum of 32 PipelineJobs can be deleted in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + class BatchDeletePipelineJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#batch_delete_pipeline_jobs PipelineService.BatchDeletePipelineJobs}. + # @!attribute [rw] pipeline_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # PipelineJobs deleted. + class BatchDeletePipelineJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#cancel_pipeline_job PipelineService.CancelPipelineJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PipelineJob to cancel. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + class CancelPipelineJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#batch_cancel_pipeline_jobs PipelineService.BatchCancelPipelineJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the PipelineJobs' parent resource. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The names of the PipelineJobs to cancel. + # A maximum of 32 PipelineJobs can be cancelled in a batch. + # Format: + # `projects/{project}/locations/{location}/pipelineJobs/{pipelineJob}` + class BatchCancelPipelineJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#batch_cancel_pipeline_jobs PipelineService.BatchCancelPipelineJobs}. + # @!attribute [rw] pipeline_jobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::PipelineJob>] + # PipelineJobs cancelled. + class BatchCancelPipelineJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_state.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_state.rb new file mode 100644 index 000000000000..6443822d7c84 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_state.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Describes the state of a pipeline. + module PipelineState + # The pipeline state is unspecified. + PIPELINE_STATE_UNSPECIFIED = 0 + + # The pipeline has been created or resumed, and processing has not yet + # begun. + PIPELINE_STATE_QUEUED = 1 + + # The service is preparing to run the pipeline. + PIPELINE_STATE_PENDING = 2 + + # The pipeline is in progress. + PIPELINE_STATE_RUNNING = 3 + + # The pipeline completed successfully. + PIPELINE_STATE_SUCCEEDED = 4 + + # The pipeline failed. + PIPELINE_STATE_FAILED = 5 + + # The pipeline is being cancelled. From this state, the pipeline may only go + # to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or + # PIPELINE_STATE_CANCELLED. + PIPELINE_STATE_CANCELLING = 6 + + # The pipeline has been cancelled. + PIPELINE_STATE_CANCELLED = 7 + + # The pipeline has been stopped, and can be resumed. + PIPELINE_STATE_PAUSED = 8 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb new file mode 100644 index 000000000000..f74cd4e8426a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb @@ -0,0 +1,628 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] instances + # @return [::Array<::Google::Protobuf::Value>] + # Required. The instances that are the input to the prediction call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the prediction call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Value] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + class PredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict}. + # @!attribute [rw] predictions + # @return [::Array<::Google::Protobuf::Value>] + # The predictions that are the output of the predictions call. + # The schema of any single prediction may be specified via Endpoint's + # DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#prediction_schema_uri prediction_schema_uri}. + # @!attribute [rw] deployed_model_id + # @return [::String] + # ID of the Endpoint's DeployedModel that served this prediction. + # @!attribute [r] model + # @return [::String] + # Output only. The resource name of the Model which is deployed as the + # DeployedModel that this prediction hits. + # @!attribute [r] model_version_id + # @return [::String] + # Output only. The version ID of the Model which is deployed as the + # DeployedModel that this prediction hits. + # @!attribute [r] model_display_name + # @return [::String] + # Output only. The [display + # name][google.cloud.aiplatform.v1.Model.display_name] of the Model which is + # deployed as the DeployedModel that this prediction hits. + # @!attribute [r] metadata + # @return [::Google::Protobuf::Value] + # Output only. Request-level metadata returned by the model. The metadata + # type will be dependent upon the model implementation. + class PredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#raw_predict PredictionService.RawPredict}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] http_body + # @return [::Google::Api::HttpBody] + # The prediction input. Supports HTTP headers and arbitrary data payload. + # + # A {::Google::Cloud::AIPlatform::V1::DeployedModel DeployedModel} may have an + # upper limit on the number of instances it supports per request. When this + # limit it is exceeded for an AutoML model, the + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#raw_predict RawPredict} + # method returns an error. When this limit is exceeded for a custom-trained + # model, the behavior varies depending on the model. + # + # You can specify the schema for each instance in the + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri predict_schemata.instance_schema_uri} + # field when you create a {::Google::Cloud::AIPlatform::V1::Model Model}. This + # schema applies when you deploy the `Model` as a `DeployedModel` to an + # {::Google::Cloud::AIPlatform::V1::Endpoint Endpoint} and use the `RawPredict` + # method. + class RawPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#stream_raw_predict PredictionService.StreamRawPredict}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] http_body + # @return [::Google::Api::HttpBody] + # The prediction input. Supports HTTP headers and arbitrary data payload. + class StreamRawPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#direct_predict PredictionService.DirectPredict}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] inputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # The prediction input. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # The parameters that govern the prediction. + class DirectPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#direct_predict PredictionService.DirectPredict}. + # @!attribute [rw] outputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # The prediction output. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # The parameters that govern the prediction. + class DirectPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#direct_raw_predict PredictionService.DirectRawPredict}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] method_name + # @return [::String] + # Fully qualified name of the API method being invoked to perform + # predictions. + # + # Format: + # `/namespace.Service/Method/` + # Example: + # `/tensorflow.serving.PredictionService/Predict` + # @!attribute [rw] input + # @return [::String] + # The prediction input. + class DirectRawPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#direct_raw_predict PredictionService.DirectRawPredict}. + # @!attribute [rw] output + # @return [::String] + # The prediction output. + class DirectRawPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#stream_direct_predict PredictionService.StreamDirectPredict}. + # + # The first message must contain + # {::Google::Cloud::AIPlatform::V1::StreamDirectPredictRequest#endpoint endpoint} + # field and optionally [input][]. The subsequent messages must contain + # [input][]. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] inputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # Optional. The prediction input. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # Optional. The parameters that govern the prediction. + class StreamDirectPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#stream_direct_predict PredictionService.StreamDirectPredict}. + # @!attribute [rw] outputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # The prediction output. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # The parameters that govern the prediction. + class StreamDirectPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#stream_direct_raw_predict PredictionService.StreamDirectRawPredict}. + # + # The first message must contain + # {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest#endpoint endpoint} + # and + # {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest#method_name method_name} + # fields and optionally + # {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest#input input}. The + # subsequent messages must contain + # {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest#input input}. + # {::Google::Cloud::AIPlatform::V1::StreamDirectRawPredictRequest#method_name method_name} + # in the subsequent messages have no effect. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] method_name + # @return [::String] + # Optional. Fully qualified name of the API method being invoked to perform + # predictions. + # + # Format: + # `/namespace.Service/Method/` + # Example: + # `/tensorflow.serving.PredictionService/Predict` + # @!attribute [rw] input + # @return [::String] + # Optional. The prediction input. + class StreamDirectRawPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#stream_direct_raw_predict PredictionService.StreamDirectRawPredict}. + # @!attribute [rw] output + # @return [::String] + # The prediction output. + class StreamDirectRawPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#streaming_predict PredictionService.StreamingPredict}. + # + # The first message must contain + # {::Google::Cloud::AIPlatform::V1::StreamingPredictRequest#endpoint endpoint} field + # and optionally [input][]. The subsequent messages must contain [input][]. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] inputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # The prediction input. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # The parameters that govern the prediction. + class StreamingPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#streaming_predict PredictionService.StreamingPredict}. + # @!attribute [rw] outputs + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensor>] + # The prediction output. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Tensor] + # The parameters that govern the prediction. + class StreamingPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#streaming_raw_predict PredictionService.StreamingRawPredict}. + # + # The first message must contain + # {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest#endpoint endpoint} + # and + # {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest#method_name method_name} + # fields and optionally + # {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest#input input}. The + # subsequent messages must contain + # {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest#input input}. + # {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest#method_name method_name} + # in the subsequent messages have no effect. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the prediction. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] method_name + # @return [::String] + # Fully qualified name of the API method being invoked to perform + # predictions. + # + # Format: + # `/namespace.Service/Method/` + # Example: + # `/tensorflow.serving.PredictionService/Predict` + # @!attribute [rw] input + # @return [::String] + # The prediction input. + class StreamingRawPredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#streaming_raw_predict PredictionService.StreamingRawPredict}. + # @!attribute [rw] output + # @return [::String] + # The prediction output. + class StreamingRawPredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to serve the explanation. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] instances + # @return [::Array<::Google::Protobuf::Value>] + # Required. The instances that are the input to the explanation call. + # A DeployedModel may have an upper limit on the number of instances it + # supports per request, and when it is exceeded the explanation call errors + # in case of AutoML Models, or, in case of customer created Models, the + # behaviour is as documented by that Model. + # The schema of any single instance may be specified via Endpoint's + # DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#instance_schema_uri instance_schema_uri}. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Value] + # The parameters that govern the prediction. The schema of the parameters may + # be specified via Endpoint's DeployedModels' [Model's + # ][google.cloud.aiplatform.v1.DeployedModel.model] + # [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + # {::Google::Cloud::AIPlatform::V1::PredictSchemata#parameters_schema_uri parameters_schema_uri}. + # @!attribute [rw] explanation_spec_override + # @return [::Google::Cloud::AIPlatform::V1::ExplanationSpecOverride] + # If specified, overrides the + # {::Google::Cloud::AIPlatform::V1::DeployedModel#explanation_spec explanation_spec} + # of the DeployedModel. Can be used for explaining prediction results with + # different configurations, such as: + # - Explaining top-5 predictions results as opposed to top-1; + # - Increasing path count or step count of the attribution methods to reduce + # approximate errors; + # - Using different baselines for explaining the prediction results. + # @!attribute [rw] deployed_model_id + # @return [::String] + # If specified, this ExplainRequest will be served by the chosen + # DeployedModel, overriding + # {::Google::Cloud::AIPlatform::V1::Endpoint#traffic_split Endpoint.traffic_split}. + class ExplainRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#explain PredictionService.Explain}. + # @!attribute [rw] explanations + # @return [::Array<::Google::Cloud::AIPlatform::V1::Explanation>] + # The explanations of the Model's + # {::Google::Cloud::AIPlatform::V1::PredictResponse#predictions PredictResponse.predictions}. + # + # It has the same number of elements as + # {::Google::Cloud::AIPlatform::V1::ExplainRequest#instances instances} to be + # explained. + # @!attribute [rw] deployed_model_id + # @return [::String] + # ID of the Endpoint's DeployedModel that served this explanation. + # @!attribute [rw] predictions + # @return [::Array<::Google::Protobuf::Value>] + # The predictions that are the output of the predictions call. + # Same as + # {::Google::Cloud::AIPlatform::V1::PredictResponse#predictions PredictResponse.predictions}. + class ExplainResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [PredictionService.CountTokens][]. + # @!attribute [rw] endpoint + # @return [::String] + # Required. The name of the Endpoint requested to perform token counting. + # Format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] model + # @return [::String] + # Optional. The name of the publisher model requested to serve the + # prediction. Format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # @!attribute [rw] instances + # @return [::Array<::Google::Protobuf::Value>] + # Optional. The instances that are the input to token counting call. + # Schema is identical to the prediction schema of the underlying model. + # @!attribute [rw] contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::Content>] + # Optional. Input content. + # @!attribute [rw] system_instruction + # @return [::Google::Cloud::AIPlatform::V1::Content] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @!attribute [rw] tools + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tool>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @!attribute [rw] generation_config + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig] + # Optional. Generation config that the model will use to generate the + # response. + class CountTokensRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for [PredictionService.CountTokens][]. + # @!attribute [rw] total_tokens + # @return [::Integer] + # The total number of tokens counted across all instances from the request. + # @!attribute [rw] total_billable_characters + # @return [::Integer] + # The total number of billable characters counted across all instances from + # the request. + class CountTokensResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [PredictionService.GenerateContent]. + # @!attribute [rw] model + # @return [::String] + # Required. The fully qualified name of the publisher model or tuned model + # endpoint to use. + # + # Publisher model format: + # `projects/{project}/locations/{location}/publishers/*/models/*` + # + # Tuned model endpoint format: + # `projects/{project}/locations/{location}/endpoints/{endpoint}` + # @!attribute [rw] contents + # @return [::Array<::Google::Cloud::AIPlatform::V1::Content>] + # Required. The content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @!attribute [rw] system_instruction + # @return [::Google::Cloud::AIPlatform::V1::Content] + # Optional. The user provided system instructions for the model. + # Note: only text should be used in parts and content in each part will be in + # a separate paragraph. + # @!attribute [rw] cached_content + # @return [::String] + # Optional. The name of the cached content used as context to serve the + # prediction. Note: only used in explicit caching, where users can have + # control over caching (e.g. what content to cache) and enjoy guaranteed cost + # savings. Format: + # `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + # @!attribute [rw] tools + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tool>] + # Optional. A list of `Tools` the model may use to generate the next + # response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. + # @!attribute [rw] tool_config + # @return [::Google::Cloud::AIPlatform::V1::ToolConfig] + # Optional. Tool config. This config is shared for all tools provided in the + # request. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. It is used + # for billing and reporting only. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints) and can only contain lowercase letters, numeric + # characters, underscores, and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # @!attribute [rw] safety_settings + # @return [::Array<::Google::Cloud::AIPlatform::V1::SafetySetting>] + # Optional. Per request settings for blocking unsafe content. + # Enforced on GenerateContentResponse.candidates. + # @!attribute [rw] generation_config + # @return [::Google::Cloud::AIPlatform::V1::GenerationConfig] + # Optional. Generation config. + class GenerateContentRequest + 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 + + # Response message for [PredictionService.GenerateContent]. + # @!attribute [r] candidates + # @return [::Array<::Google::Cloud::AIPlatform::V1::Candidate>] + # Output only. Generated candidates. + # @!attribute [r] model_version + # @return [::String] + # Output only. The model version used to generate the response. + # @!attribute [r] prompt_feedback + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback] + # Output only. Content filter results for a prompt sent in the request. + # Note: Sent only in the first stream chunk. + # Only happens when no candidates were generated due to content violations. + # @!attribute [rw] usage_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::UsageMetadata] + # Usage metadata about the response(s). + class GenerateContentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Content filter results for a prompt sent in the request. + # @!attribute [r] block_reason + # @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback::BlockedReason] + # Output only. Blocked reason. + # @!attribute [r] safety_ratings + # @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>] + # Output only. Safety ratings. + # @!attribute [r] block_reason_message + # @return [::String] + # Output only. A readable block reason message. + class PromptFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Blocked reason enumeration. + module BlockedReason + # Unspecified blocked reason. + BLOCKED_REASON_UNSPECIFIED = 0 + + # Candidates blocked due to safety. + SAFETY = 1 + + # Candidates blocked due to other reason. + OTHER = 2 + + # Candidates blocked due to the terms which are included from the + # terminology blocklist. + BLOCKLIST = 3 + + # Candidates blocked due to prohibited content. + PROHIBITED_CONTENT = 4 + end + end + + # Usage metadata about response(s). + # @!attribute [rw] prompt_token_count + # @return [::Integer] + # Number of tokens in the request. When `cached_content` is set, this is + # still the total effective prompt size meaning this includes the number of + # tokens in the cached content. + # @!attribute [rw] candidates_token_count + # @return [::Integer] + # Number of tokens in the response(s). + # @!attribute [rw] total_token_count + # @return [::Integer] + # Total token count for prompt and response candidates. + # @!attribute [r] cached_content_token_count + # @return [::Integer] + # Output only. Number of tokens in the cached part in the input (the cached + # content). + class UsageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb new file mode 100644 index 000000000000..6b9a3ac5b7ef --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb @@ -0,0 +1,347 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A Model Garden Publisher Model. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the PublisherModel. + # @!attribute [r] version_id + # @return [::String] + # Output only. Immutable. The version ID of the PublisherModel. + # A new version is committed when a new model version is uploaded under an + # existing model id. It is an auto-incrementing decimal number in string + # representation. + # @!attribute [rw] open_source_category + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::OpenSourceCategory] + # Required. Indicates the open source category of the publisher model. + # @!attribute [rw] supported_actions + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction] + # Optional. Supported call-to-action options. + # @!attribute [rw] frameworks + # @return [::Array<::String>] + # Optional. Additional information about the model's Frameworks. + # @!attribute [rw] launch_stage + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::LaunchStage] + # Optional. Indicates the launch stage of the model. + # @!attribute [rw] version_state + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::VersionState] + # Optional. Indicates the state of the model version. + # @!attribute [r] publisher_model_template + # @return [::String] + # Optional. Output only. Immutable. Used to indicate this model has a + # publisher model and provide the template of the publisher model resource + # name. + # @!attribute [rw] predict_schemata + # @return [::Google::Cloud::AIPlatform::V1::PredictSchemata] + # Optional. The schemata that describes formats of the PublisherModel's + # predictions and explanations as given and returned via + # {::Google::Cloud::AIPlatform::V1::PredictionService::Client#predict PredictionService.Predict}. + class PublisherModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reference to a resource. + # @!attribute [rw] uri + # @return [::String] + # The URI of the resource. + # @!attribute [rw] resource_name + # @return [::String] + # The resource name of the Google Cloud resource. + # @!attribute [rw] use_case + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Use case (CUJ) of the resource. + # @!attribute [rw] description + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Description of the resource. + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A named piece of documentation. + # @!attribute [rw] title + # @return [::String] + # Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, + # NODE.JS, etc.. + # @!attribute [rw] content + # @return [::String] + # Required. Content of this piece of document (in Markdown format). + class Documentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Actions could take on this Publisher Model. + # @!attribute [rw] view_rest_api + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::ViewRestApi] + # Optional. To view Rest API docs. + # @!attribute [rw] open_notebook + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open notebook of the PublisherModel. + # @!attribute [rw] open_notebooks + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::OpenNotebooks] + # Optional. Open notebooks of the PublisherModel. + # @!attribute [rw] create_application + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Create application using the PublisherModel. + # @!attribute [rw] open_fine_tuning_pipeline + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open fine-tuning pipeline of the PublisherModel. + # @!attribute [rw] open_fine_tuning_pipelines + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::OpenFineTuningPipelines] + # Optional. Open fine-tuning pipelines of the PublisherModel. + # @!attribute [rw] open_prompt_tuning_pipeline + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open prompt-tuning pipeline of the PublisherModel. + # @!attribute [rw] open_genie + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open Genie / Playground. + # @!attribute [rw] deploy + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::Deploy] + # Optional. Deploy the PublisherModel to Vertex Endpoint. + # @!attribute [rw] deploy_gke + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::DeployGke] + # Optional. Deploy PublisherModel to Google Kubernetes Engine. + # @!attribute [rw] open_generation_ai_studio + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open in Generation AI Studio. + # @!attribute [rw] request_access + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Request for access. + # @!attribute [rw] open_evaluation_pipeline + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences] + # Optional. Open evaluation pipeline of the PublisherModel. + class CallToAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The regional resource name or the URI. Key is region, e.g., + # us-central1, europe-west2, global, etc.. + # @!attribute [rw] references + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::PublisherModel::ResourceReference}] + # Required. + # @!attribute [rw] title + # @return [::String] + # Required. + # @!attribute [rw] resource_title + # @return [::String] + # Optional. Title of the resource. + # @!attribute [rw] resource_use_case + # @return [::String] + # Optional. Use case (CUJ) of the resource. + # @!attribute [rw] resource_description + # @return [::String] + # Optional. Description of the resource. + class RegionalResourceReferences + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::ResourceReference] + class ReferencesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Rest API docs. + # @!attribute [rw] documentations + # @return [::Array<::Google::Cloud::AIPlatform::V1::PublisherModel::Documentation>] + # Required. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the view rest API. + class ViewRestApi + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Open notebooks. + # @!attribute [rw] notebooks + # @return [::Array<::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences>] + # Required. Regional resource references to notebooks. + class OpenNotebooks + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Open fine tuning pipelines. + # @!attribute [rw] fine_tuning_pipelines + # @return [::Array<::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::RegionalResourceReferences>] + # Required. Regional resource references to fine tuning pipelines. + class OpenFineTuningPipelines + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Model metadata that is needed for UploadModel or + # DeployModel/CreateEndpoint requests. + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::AIPlatform::V1::DedicatedResources] + # A description of resources that are dedicated to the DeployedModel, + # and that need a higher degree of manual configuration. + # @!attribute [rw] automatic_resources + # @return [::Google::Cloud::AIPlatform::V1::AutomaticResources] + # A description of resources that to large degree are decided by Vertex + # AI, and require only a modest additional configuration. + # @!attribute [rw] shared_resources + # @return [::String] + # The resource name of the shared DeploymentResourcePool to deploy on. + # Format: + # `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + # @!attribute [rw] model_display_name + # @return [::String] + # Optional. Default model display name. + # @!attribute [rw] large_model_reference + # @return [::Google::Cloud::AIPlatform::V1::LargeModelReference] + # Optional. Large model reference. When this is set, model_artifact_spec + # is not needed. + # @!attribute [rw] container_spec + # @return [::Google::Cloud::AIPlatform::V1::ModelContainerSpec] + # Optional. The specification of the container that is to be used when + # deploying this Model in Vertex AI. Not present for Large Models. + # @!attribute [rw] artifact_uri + # @return [::String] + # Optional. The path to the directory containing the Model artifact and + # any of its supporting files. + # @!attribute [rw] deploy_task_name + # @return [::String] + # Optional. The name of the deploy task (e.g., "text to image + # generation"). + # @!attribute [rw] deploy_metadata + # @return [::Google::Cloud::AIPlatform::V1::PublisherModel::CallToAction::Deploy::DeployMetadata] + # Optional. Metadata information about this deployment config. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the regional resource reference. + # @!attribute [rw] public_artifact_uri + # @return [::String] + # Optional. The signed URI for ephemeral Cloud Storage access to model + # artifact. + class Deploy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata information about the deployment for managing deployment + # config. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels for the deployment. For managing deployment config + # like verifying, source of deployment config, etc. + # @!attribute [rw] sample_request + # @return [::String] + # Optional. Sample request for deployed endpoint. + class DeployMetadata + 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 + end + + # Configurations for PublisherModel GKE deployment + # @!attribute [rw] gke_yaml_configs + # @return [::Array<::String>] + # Optional. GKE deployment configuration in yaml format. + class DeployGke + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An enum representing the open source category of a PublisherModel. + module OpenSourceCategory + # The open source category is unspecified, which should not be used. + OPEN_SOURCE_CATEGORY_UNSPECIFIED = 0 + + # Used to indicate the PublisherModel is not open sourced. + PROPRIETARY = 1 + + # Used to indicate the PublisherModel is a Google-owned open source model + # w/ Google checkpoint. + GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 2 + + # Used to indicate the PublisherModel is a 3p-owned open source model w/ + # Google checkpoint. + THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 3 + + # Used to indicate the PublisherModel is a Google-owned pure open source + # model. + GOOGLE_OWNED_OSS = 4 + + # Used to indicate the PublisherModel is a 3p-owned pure open source model. + THIRD_PARTY_OWNED_OSS = 5 + end + + # An enum representing the launch stage of a PublisherModel. + module LaunchStage + # The model launch stage is unspecified. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # Used to indicate the PublisherModel is at Experimental launch stage, + # available to a small set of customers. + EXPERIMENTAL = 1 + + # Used to indicate the PublisherModel is at Private Preview launch stage, + # only available to a small set of customers, although a larger set of + # customers than an Experimental launch. Previews are the first launch + # stage used to get feedback from customers. + PRIVATE_PREVIEW = 2 + + # Used to indicate the PublisherModel is at Public Preview launch stage, + # available to all customers, although not supported for production + # workloads. + PUBLIC_PREVIEW = 3 + + # Used to indicate the PublisherModel is at GA launch stage, available to + # all customers and ready for production workload. + GA = 4 + end + + # An enum representing the state of the PublicModelVersion. + module VersionState + # The version state is unspecified. + VERSION_STATE_UNSPECIFIED = 0 + + # Used to indicate the version is stable. + VERSION_STATE_STABLE = 1 + + # Used to indicate the version is unstable. + VERSION_STATE_UNSTABLE = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb new file mode 100644 index 000000000000..409726a7fccd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # ReasoningEngine configurations + # @!attribute [rw] package_spec + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec::PackageSpec] + # Required. User provided package spec of the ReasoningEngine. + # @!attribute [rw] class_methods + # @return [::Array<::Google::Protobuf::Struct>] + # Optional. Declarations for object class methods in OpenAPI specification + # format. + class ReasoningEngineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # User provided package spec like pickled object and package requirements. + # @!attribute [rw] pickle_object_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the pickled python object. + # @!attribute [rw] dependency_files_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the dependency files in tar.gz format. + # @!attribute [rw] requirements_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the `requirements.txt` file + # @!attribute [rw] python_version + # @return [::String] + # Optional. The Python version. Currently support 3.8, 3.9, 3.10, 3.11. + # If not specified, default value is 3.10. + class PackageSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ReasoningEngine provides a customizable runtime for models to determine + # which actions to take and in which order. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the ReasoningEngine. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the ReasoningEngine. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the ReasoningEngine. + # @!attribute [rw] spec + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec] + # Required. Configurations of the ReasoningEngine + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ReasoningEngine was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ReasoningEngine was most recently updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + class ReasoningEngine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb new file mode 100644 index 000000000000..17ce13dc7d3c --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for [ReasoningEngineExecutionService.Query][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] input + # @return [::Google::Protobuf::Struct] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @!attribute [rw] class_method + # @return [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + class QueryReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for [ReasoningEngineExecutionService.Query][] + # @!attribute [rw] output + # @return [::Google::Protobuf::Value] + # Response provided by users in JSON object format. + class QueryReasoningEngineResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [ReasoningEngineExecutionService.StreamQuery][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] input + # @return [::Google::Protobuf::Struct] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @!attribute [rw] class_method + # @return [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + class StreamQueryReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb new file mode 100644 index 000000000000..d990e865352d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine ReasoningEngineService.CreateReasoningEngine}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] reasoning_engine + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # Required. The ReasoningEngine to create. + class CreateReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine ReasoningEngineService.CreateReasoningEngine} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class CreateReasoningEngineOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#get_reasoning_engine ReasoningEngineService.GetReasoningEngine}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + class GetReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine ReasoningEngineService.UpdateReasoningEngine}. + # @!attribute [rw] reasoning_engine + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # Required. The ReasoningEngine which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to update. + class UpdateReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine ReasoningEngineService.UpdateReasoningEngine} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class UpdateReasoningEngineOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines ReasoningEngineService.ListReasoningEngines}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + class ListReasoningEnginesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines ReasoningEngineService.ListReasoningEngines} + # @!attribute [rw] reasoning_engines + # @return [::Array<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # List of ReasoningEngines in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest#page_token ListReasoningEnginesRequest.page_token} + # to obtain that page. + class ListReasoningEnginesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#delete_reasoning_engine ReasoningEngineService.DeleteReasoningEngine}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + class DeleteReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reservation_affinity.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reservation_affinity.rb new file mode 100644 index 000000000000..c821a21e2dfe --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reservation_affinity.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A ReservationAffinity can be used to configure a Vertex AI resource (e.g., a + # DeployedModel) to draw its Compute Engine resources from a Shared + # Reservation, or exclusively from on-demand capacity. + # @!attribute [rw] reservation_affinity_type + # @return [::Google::Cloud::AIPlatform::V1::ReservationAffinity::Type] + # Required. Specifies the reservation affinity type. + # @!attribute [rw] key + # @return [::String] + # Optional. Corresponds to the label key of a reservation resource. To target + # a SPECIFIC_RESERVATION by name, use + # `compute.googleapis.com/reservation-name` as the key and specify the name + # of your reservation as its value. + # @!attribute [rw] values + # @return [::Array<::String>] + # Optional. Corresponds to the label values of a reservation resource. This + # must be the full resource name of the reservation. + class ReservationAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Identifies a type of reservation affinity. + module Type + # Default value. This should not be used. + TYPE_UNSPECIFIED = 0 + + # Do not consume from any reserved capacity, only use on-demand. + NO_RESERVATION = 1 + + # Consume any reservation available, falling back to on-demand. + ANY_RESERVATION = 2 + + # Consume from a specific reservation. When chosen, the reservation + # must be identified via the `key` and `values` fields. + SPECIFIC_RESERVATION = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/saved_query.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/saved_query.rb new file mode 100644 index 000000000000..4f01a42aebf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/saved_query.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A SavedQuery is a view of the dataset. It references a subset of annotations + # by problem type and filters. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the SavedQuery. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the SavedQuery. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Value] + # Some additional information about the SavedQuery. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this SavedQuery was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when SavedQuery was last updated. + # @!attribute [r] annotation_filter + # @return [::String] + # Output only. Filters on the Annotations in the dataset. + # @!attribute [rw] problem_type + # @return [::String] + # Required. Problem type of the SavedQuery. + # Allowed values: + # + # * IMAGE_CLASSIFICATION_SINGLE_LABEL + # * IMAGE_CLASSIFICATION_MULTI_LABEL + # * IMAGE_BOUNDING_POLY + # * IMAGE_BOUNDING_BOX + # * TEXT_CLASSIFICATION_SINGLE_LABEL + # * TEXT_CLASSIFICATION_MULTI_LABEL + # * TEXT_EXTRACTION + # * TEXT_SENTIMENT + # * VIDEO_CLASSIFICATION + # * VIDEO_OBJECT_TRACKING + # @!attribute [r] annotation_spec_count + # @return [::Integer] + # Output only. Number of AnnotationSpecs in the context of the SavedQuery. + # @!attribute [rw] etag + # @return [::String] + # Used to perform a consistent read-modify-write update. If not set, a blind + # "overwrite" update happens. + # @!attribute [r] support_automl_training + # @return [::Boolean] + # Output only. If the Annotations belonging to the SavedQuery can be used for + # AutoML training. + class SavedQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule.rb new file mode 100644 index 000000000000..e9f078ff5644 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # An instance of a Schedule periodically schedules runs to make API calls based + # on user specified time specification and API request type. + # @!attribute [rw] cron + # @return [::String] + # Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled + # runs. To explicitly set a timezone to the cron tab, apply a prefix in the + # cron tab: "CRON_TZ=$\\{IANA_TIME_ZONE}" or "TZ=$\\{IANA_TIME_ZONE}". + # The $\\{IANA_TIME_ZONE} may only be a valid string from IANA time zone + # database. For example, "CRON_TZ=America/New_York 1 * * * *", or + # "TZ=America/New_York 1 * * * *". + # @!attribute [rw] create_pipeline_job_request + # @return [::Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest] + # Request for + # {::Google::Cloud::AIPlatform::V1::PipelineService::Client#create_pipeline_job PipelineService.CreatePipelineJob}. + # CreatePipelineJobRequest.parent field is required (format: + # projects/\\{project}/locations/\\{location}). + # @!attribute [rw] create_notebook_execution_job_request + # @return [::Google::Cloud::AIPlatform::V1::CreateNotebookExecutionJobRequest] + # Request for + # {::Google::Cloud::AIPlatform::V1::NotebookService::Client#create_notebook_execution_job NotebookService.CreateNotebookExecutionJob}. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the Schedule. + # @!attribute [rw] display_name + # @return [::String] + # Required. User provided name of the Schedule. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp after which the first run can be scheduled. + # Default to Schedule create time if not specified. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp after which no new runs can be scheduled. + # If specified, The schedule will be completed when either + # end_time is reached or when scheduled_run_count >= max_run_count. + # If not specified, new runs will keep getting scheduled until this Schedule + # is paused or deleted. Already scheduled runs will be allowed to complete. + # Unset if not specified. + # @!attribute [rw] max_run_count + # @return [::Integer] + # Optional. Maximum run count of the schedule. + # If specified, The schedule will be completed when either + # started_run_count >= max_run_count or when end_time is reached. + # If not specified, new runs will keep getting scheduled until this Schedule + # is paused or deleted. Already scheduled runs will be allowed to complete. + # Unset if not specified. + # @!attribute [r] started_run_count + # @return [::Integer] + # Output only. The number of runs started by this schedule. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::Schedule::State] + # Output only. The state of this Schedule. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Schedule was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Schedule was updated. + # @!attribute [r] next_run_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Schedule should schedule the next run. + # Having a next_run_time in the past means the runs are being started + # behind schedule. + # @!attribute [r] last_pause_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Schedule was last paused. + # Unset if never paused. + # @!attribute [r] last_resume_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Schedule was last resumed. + # Unset if never resumed from pause. + # @!attribute [rw] max_concurrent_run_count + # @return [::Integer] + # Required. Maximum number of runs that can be started concurrently for this + # Schedule. This is the limit for starting the scheduled requests and not the + # execution of the operations/jobs created by the requests (if applicable). + # @!attribute [rw] allow_queueing + # @return [::Boolean] + # Optional. Whether new scheduled runs can be queued when max_concurrent_runs + # limit is reached. If set to true, new runs will be queued instead of + # skipped. Default to false. + # @!attribute [r] catch_up + # @return [::Boolean] + # Output only. Whether to backfill missed runs when the schedule is resumed + # from PAUSED state. If set to true, all missed runs will be scheduled. New + # runs will be scheduled after the backfill is complete. Default to false. + # @!attribute [r] last_scheduled_run_response + # @return [::Google::Cloud::AIPlatform::V1::Schedule::RunResponse] + # Output only. Response of the last scheduled run. + # This is the response for starting the scheduled requests and not the + # execution of the operations/jobs created by the requests (if applicable). + # Unset if no run has been scheduled yet. + class Schedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Status of a scheduled run. + # @!attribute [rw] scheduled_run_time + # @return [::Google::Protobuf::Timestamp] + # The scheduled run time based on the user-specified schedule. + # @!attribute [rw] run_response + # @return [::String] + # The response of the scheduled run. + class RunResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible state of the schedule. + module State + # Unspecified. + STATE_UNSPECIFIED = 0 + + # The Schedule is active. Runs are being scheduled on the user-specified + # timespec. + ACTIVE = 1 + + # The schedule is paused. No new runs will be created until the schedule + # is resumed. Already started runs will be allowed to complete. + PAUSED = 2 + + # The Schedule is completed. No new runs will be scheduled. Already started + # runs will be allowed to complete. Schedules in completed state cannot be + # paused or resumed. + COMPLETED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule_service.rb new file mode 100644 index 000000000000..50de084f3cd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schedule_service.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#create_schedule ScheduleService.CreateSchedule}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the Schedule in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] schedule + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # Required. The Schedule to create. + class CreateScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#get_schedule ScheduleService.GetSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Schedule resource. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + class GetScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#list_schedules ScheduleService.ListSchedules}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the Schedules from. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the Schedules that match the filter expression. The following + # fields are supported: + # + # * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + # * `state`: Supports `=` and `!=` comparisons. + # * `request`: Supports existence of the check. + # (e.g. `create_pipeline_job_request:*` --> Schedule has + # create_pipeline_job_request). + # * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + # Values must be in RFC 3339 format. + # * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + # existence check. Values must be in RFC 3339 format. + # * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + # comparisons. Values must be in RFC 3339 format. + # + # + # Filter expressions can be combined together using logical operators + # (`NOT`, `AND` & `OR`). + # The syntax to define filter expression is based on + # https://google.aip.dev/160. + # + # Examples: + # + # * `state="ACTIVE" AND display_name:"my_schedule_*"` + # * `NOT display_name="my_schedule"` + # * `create_time>"2021-05-18T00:00:00Z"` + # * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + # * `create_pipeline_job_request:*` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # Default to 100 if not specified. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained via + # {::Google::Cloud::AIPlatform::V1::ListSchedulesResponse#next_page_token ListSchedulesResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#list_schedules ScheduleService.ListSchedules} + # call. + # @!attribute [rw] order_by + # @return [::String] + # A comma-separated list of fields to order by. The default sort order is in + # ascending order. Use "desc" after a field name for descending. You can have + # multiple order_by fields provided. + # + # For example, using "create_time desc, end_time" will order results by + # create time in descending order, and if there are multiple schedules having + # the same create time, order them by the end time in ascending order. + # + # If order_by is not specified, it will order by default with create_time in + # descending order. + # + # Supported fields: + # + # * `create_time` + # * `start_time` + # * `end_time` + # * `next_run_time` + class ListSchedulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#list_schedules ScheduleService.ListSchedules} + # @!attribute [rw] schedules + # @return [::Array<::Google::Cloud::AIPlatform::V1::Schedule>] + # List of Schedules in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListSchedulesRequest#page_token ListSchedulesRequest.page_token} + # to obtain that page. + class ListSchedulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#delete_schedule ScheduleService.DeleteSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Schedule resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + class DeleteScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#pause_schedule ScheduleService.PauseSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Schedule resource to be paused. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + class PauseScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#resume_schedule ScheduleService.ResumeSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Schedule resource to be resumed. + # Format: + # `projects/{project}/locations/{location}/schedules/{schedule}` + # @!attribute [rw] catch_up + # @return [::Boolean] + # Optional. Whether to backfill missed runs when the schedule is resumed from + # PAUSED state. If set to true, all missed runs will be scheduled. New runs + # will be scheduled after the backfill is complete. This will also update + # {::Google::Cloud::AIPlatform::V1::Schedule#catch_up Schedule.catch_up} field. + # Default to false. + class ResumeScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ScheduleService::Client#update_schedule ScheduleService.UpdateSchedule}. + # @!attribute [rw] schedule + # @return [::Google::Cloud::AIPlatform::V1::Schedule] + # Required. The Schedule which replaces the resource on the server. + # The following restrictions will be applied: + # + # * The scheduled request type cannot be changed. + # * The non-empty fields cannot be unset. + # * The output_only fields will be ignored if specified. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. See + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. + class UpdateScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.rb new file mode 100644 index 000000000000..cd47970d7fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Image Classification. + # @!attribute [rw] content + # @return [::String] + # The image bytes or Cloud Storage URI to make the prediction on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the image. Only the images in below listed + # MIME types are supported. + # - image/jpeg + # - image/gif + # - image/png + # - image/webp + # - image/bmp + # - image/tiff + # - image/vnd.microsoft.icon + class ImageClassificationPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.rb new file mode 100644 index 000000000000..59e9988d1860 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Image Object Detection. + # @!attribute [rw] content + # @return [::String] + # The image bytes or Cloud Storage URI to make the prediction on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the image. Only the images in below listed + # MIME types are supported. + # - image/jpeg + # - image/gif + # - image/png + # - image/webp + # - image/bmp + # - image/tiff + # - image/vnd.microsoft.icon + class ImageObjectDetectionPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.rb new file mode 100644 index 000000000000..b7d15b0c7902 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Image Segmentation. + # @!attribute [rw] content + # @return [::String] + # The image bytes to make the predictions on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the image. Only the images in below listed + # MIME types are supported. + # - image/jpeg + # - image/png + class ImageSegmentationPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.rb new file mode 100644 index 000000000000..ebf91e0785f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Text Classification. + # @!attribute [rw] content + # @return [::String] + # The text snippet to make the predictions on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the text snippet. The supported MIME types are listed + # below. + # - text/plain + class TextClassificationPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.rb new file mode 100644 index 000000000000..a4e8a94888f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Text Extraction. + # @!attribute [rw] content + # @return [::String] + # The text snippet to make the predictions on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the text snippet. The supported MIME types are listed + # below. + # - text/plain + # @!attribute [rw] key + # @return [::String] + # This field is only used for batch prediction. If a key is provided, the + # batch prediction result will by mapped to this key. If omitted, then the + # batch prediction result will contain the entire input instance. Vertex AI + # will not check if keys in the request are duplicates, so it is up to the + # caller to ensure the keys are unique. + class TextExtractionPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.rb new file mode 100644 index 000000000000..64007d93e0d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Text Sentiment. + # @!attribute [rw] content + # @return [::String] + # The text snippet to make the predictions on. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the text snippet. The supported MIME types are listed + # below. + # - text/plain + class TextSentimentPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.rb new file mode 100644 index 000000000000..db10646b5bc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Video Action Recognition. + # @!attribute [rw] content + # @return [::String] + # The Google Cloud Storage location of the video on which to perform the + # prediction. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the video. Only the following are + # supported: video/mp4 video/avi video/quicktime + # @!attribute [rw] time_segment_start + # @return [::String] + # The beginning, inclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision. + # @!attribute [rw] time_segment_end + # @return [::String] + # The end, exclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision, and "inf" or "Infinity" is allowed, which + # means the end of the video. + class VideoActionRecognitionPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.rb new file mode 100644 index 000000000000..2fe7e4d23ce0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Video Classification. + # @!attribute [rw] content + # @return [::String] + # The Google Cloud Storage location of the video on which to perform the + # prediction. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the video. Only the following are + # supported: video/mp4 video/avi video/quicktime + # @!attribute [rw] time_segment_start + # @return [::String] + # The beginning, inclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision. + # @!attribute [rw] time_segment_end + # @return [::String] + # The end, exclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision, and "inf" or "Infinity" is allowed, which + # means the end of the video. + class VideoClassificationPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.rb new file mode 100644 index 000000000000..5cae8104fab7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Instance + # Prediction input format for Video Object Tracking. + # @!attribute [rw] content + # @return [::String] + # The Google Cloud Storage location of the video on which to perform the + # prediction. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content of the video. Only the following are + # supported: video/mp4 video/avi video/quicktime + # @!attribute [rw] time_segment_start + # @return [::String] + # The beginning, inclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision. + # @!attribute [rw] time_segment_end + # @return [::String] + # The end, exclusive, of the video's time segment on which to perform + # the prediction. Expressed as a number of seconds as measured from the + # start of the video, with "s" appended at the end. Fractions are allowed, + # up to a microsecond precision, and "inf" or "Infinity" is allowed, which + # means the end of the video. + class VideoObjectTrackingPredictionInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_classification.rb new file mode 100644 index 000000000000..7841a25adf82 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_classification.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Image Classification. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # The Model only returns predictions with at least this confidence score. + # Default value is 0.0 + # @!attribute [rw] max_predictions + # @return [::Integer] + # The Model only returns up to that many top, by confidence score, + # predictions per instance. If this number is very high, the Model may return + # fewer predictions. Default value is 10. + class ImageClassificationPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.rb new file mode 100644 index 000000000000..922f6b381aa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Image Object Detection. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # The Model only returns predictions with at least this confidence score. + # Default value is 0.0 + # @!attribute [rw] max_predictions + # @return [::Integer] + # The Model only returns up to that many top, by confidence score, + # predictions per instance. Note that number of returned predictions is also + # limited by metadata's predictionsLimit. Default value is 10. + class ImageObjectDetectionPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.rb new file mode 100644 index 000000000000..418541c69781 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Image Segmentation. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # When the model predicts category of pixels of the image, it will only + # provide predictions for pixels that it is at least this much confident + # about. All other pixels will be classified as background. Default value is + # 0.5. + class ImageSegmentationPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.rb new file mode 100644 index 000000000000..c9b63088aa2e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Video Action Recognition. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # The Model only returns predictions with at least this confidence score. + # Default value is 0.0 + # @!attribute [rw] max_predictions + # @return [::Integer] + # The model only returns up to that many top, by confidence score, + # predictions per frame of the video. If this number is very high, the + # Model may return fewer predictions per frame. Default value is 50. + class VideoActionRecognitionPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_classification.rb new file mode 100644 index 000000000000..f57b77b96033 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_classification.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Video Classification. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # The Model only returns predictions with at least this confidence score. + # Default value is 0.0 + # @!attribute [rw] max_predictions + # @return [::Integer] + # The Model only returns up to that many top, by confidence score, + # predictions per instance. If this number is very high, the Model may return + # fewer predictions. Default value is 10,000. + # @!attribute [rw] segment_classification + # @return [::Boolean] + # Set to true to request segment-level classification. Vertex AI returns + # labels and their confidence scores for the entire time segment of the + # video that user specified in the input instance. + # Default value is true + # @!attribute [rw] shot_classification + # @return [::Boolean] + # Set to true to request shot-level classification. Vertex AI determines + # the boundaries for each camera shot in the entire time segment of the + # video that user specified in the input instance. Vertex AI then + # returns labels and their confidence scores for each detected shot, along + # with the start and end time of the shot. + # WARNING: Model evaluation is not done for this classification type, + # the quality of it depends on the training data, but there are no metrics + # provided to describe that quality. + # Default value is false + # @!attribute [rw] one_sec_interval_classification + # @return [::Boolean] + # Set to true to request classification for a video at one-second intervals. + # Vertex AI returns labels and their confidence scores for each second of + # the entire time segment of the video that user specified in the input + # WARNING: Model evaluation is not done for this classification type, the + # quality of it depends on the training data, but there are no metrics + # provided to describe that quality. Default value is false + class VideoClassificationPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.rb new file mode 100644 index 000000000000..81d6f1a67789 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Params + # Prediction model parameters for Video Object Tracking. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # The Model only returns predictions with at least this confidence score. + # Default value is 0.0 + # @!attribute [rw] max_predictions + # @return [::Integer] + # The model only returns up to that many top, by confidence score, + # predictions per frame of the video. If this number is very high, the + # Model may return fewer predictions per frame. Default value is 50. + # @!attribute [rw] min_bounding_box_size + # @return [::Float] + # Only bounding boxes with shortest edge at least that long as a relative + # value of video frame size are returned. Default value is 0.0. + class VideoObjectTrackingPredictionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/classification.rb new file mode 100644 index 000000000000..cbd469063cee --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/classification.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Image and Text Classification. + # @!attribute [rw] ids + # @return [::Array<::Integer>] + # The resource IDs of the AnnotationSpecs that had been identified. + # @!attribute [rw] display_names + # @return [::Array<::String>] + # The display names of the AnnotationSpecs that had been identified, order + # matches the IDs. + # @!attribute [rw] confidences + # @return [::Array<::Float>] + # The Model's confidences in correctness of the predicted IDs, higher value + # means higher confidence. Order matches the Ids. + class ClassificationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.rb new file mode 100644 index 000000000000..3ea805857aa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Image Object Detection. + # @!attribute [rw] ids + # @return [::Array<::Integer>] + # The resource IDs of the AnnotationSpecs that had been identified, ordered + # by the confidence score descendingly. + # @!attribute [rw] display_names + # @return [::Array<::String>] + # The display names of the AnnotationSpecs that had been identified, order + # matches the IDs. + # @!attribute [rw] confidences + # @return [::Array<::Float>] + # The Model's confidences in correctness of the predicted IDs, higher value + # means higher confidence. Order matches the Ids. + # @!attribute [rw] bboxes + # @return [::Array<::Google::Protobuf::ListValue>] + # Bounding boxes, i.e. the rectangles over the image, that pinpoint + # the found AnnotationSpecs. Given in order that matches the IDs. Each + # bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and + # `yMax`, which represent the extremal coordinates of the box. They are + # relative to the image size, and the point 0,0 is in the top left + # of the image. + class ImageObjectDetectionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.rb new file mode 100644 index 000000000000..6eca2c9edda4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Image Segmentation. + # @!attribute [rw] category_mask + # @return [::String] + # A PNG image where each pixel in the mask represents the category in which + # the pixel in the original image was predicted to belong to. The size of + # this image will be the same as the original image. The mapping between the + # AnntoationSpec and the color can be found in model's metadata. The model + # will choose the most likely category and if none of the categories reach + # the confidence threshold, the pixel will be marked as background. + # @!attribute [rw] confidence_mask + # @return [::String] + # A one channel image which is encoded as an 8bit lossless PNG. The size of + # the image will be the same as the original image. For a specific pixel, + # darker color means less confidence in correctness of the cateogry in the + # categoryMask for the corresponding pixel. Black means no confidence and + # white means complete confidence. + class ImageSegmentationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.rb new file mode 100644 index 000000000000..ef6eac4efcf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Tabular Classification. + # @!attribute [rw] classes + # @return [::Array<::String>] + # The name of the classes being classified, contains all possible values of + # the target column. + # @!attribute [rw] scores + # @return [::Array<::Float>] + # The model's confidence in each class being correct, higher + # value means higher confidence. The N-th score corresponds to + # the N-th class in classes. + class TabularClassificationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.rb new file mode 100644 index 000000000000..3444235af339 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Tabular Regression. + # @!attribute [rw] value + # @return [::Float] + # The regression value. + # @!attribute [rw] lower_bound + # @return [::Float] + # The lower bound of the prediction interval. + # @!attribute [rw] upper_bound + # @return [::Float] + # The upper bound of the prediction interval. + class TabularRegressionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.rb new file mode 100644 index 000000000000..8be88a19e922 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Text Extraction. + # @!attribute [rw] ids + # @return [::Array<::Integer>] + # The resource IDs of the AnnotationSpecs that had been identified, + # ordered by the confidence score descendingly. + # @!attribute [rw] display_names + # @return [::Array<::String>] + # The display names of the AnnotationSpecs that had been identified, + # order matches the IDs. + # @!attribute [rw] text_segment_start_offsets + # @return [::Array<::Integer>] + # The start offsets, inclusive, of the text segment in which the + # AnnotationSpec has been identified. Expressed as a zero-based number + # of characters as measured from the start of the text snippet. + # @!attribute [rw] text_segment_end_offsets + # @return [::Array<::Integer>] + # The end offsets, inclusive, of the text segment in which the + # AnnotationSpec has been identified. Expressed as a zero-based number + # of characters as measured from the start of the text snippet. + # @!attribute [rw] confidences + # @return [::Array<::Float>] + # The Model's confidences in correctness of the predicted IDs, higher + # value means higher confidence. Order matches the Ids. + class TextExtractionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.rb new file mode 100644 index 000000000000..546900d7558f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Text Sentiment + # @!attribute [rw] sentiment + # @return [::Integer] + # The integer sentiment labels between 0 (inclusive) and sentimentMax label + # (inclusive), while 0 maps to the least positive sentiment and + # sentimentMax maps to the most positive one. The higher the score is, the + # more positive the sentiment in the text snippet is. Note: sentimentMax is + # an integer value between 1 (inclusive) and 10 (inclusive). + class TextSentimentPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.rb new file mode 100644 index 000000000000..082e3e086305 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Video Action Recognition. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] time_segment_start + # @return [::Google::Protobuf::Duration] + # The beginning, inclusive, of the video's time segment in which the + # AnnotationSpec has been identified. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. + # @!attribute [rw] time_segment_end + # @return [::Google::Protobuf::Duration] + # The end, exclusive, of the video's time segment in which the + # AnnotationSpec has been identified. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. + # @!attribute [rw] confidence + # @return [::Google::Protobuf::FloatValue] + # The Model's confidence in correction of this prediction, higher + # value means higher confidence. + class VideoActionRecognitionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.rb new file mode 100644 index 000000000000..161da914b4c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Video Classification. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] type + # @return [::String] + # The type of the prediction. The requested types can be configured + # via parameters. This will be one of + # - segment-classification + # - shot-classification + # - one-sec-interval-classification + # @!attribute [rw] time_segment_start + # @return [::Google::Protobuf::Duration] + # The beginning, inclusive, of the video's time segment in which the + # AnnotationSpec has been identified. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. Note that for + # 'segment-classification' prediction type, this equals the original + # 'timeSegmentStart' from the input instance, for other types it is the + # start of a shot or a 1 second interval respectively. + # @!attribute [rw] time_segment_end + # @return [::Google::Protobuf::Duration] + # The end, exclusive, of the video's time segment in which the + # AnnotationSpec has been identified. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. Note that for + # 'segment-classification' prediction type, this equals the original + # 'timeSegmentEnd' from the input instance, for other types it is the end + # of a shot or a 1 second interval respectively. + # @!attribute [rw] confidence + # @return [::Google::Protobuf::FloatValue] + # The Model's confidence in correction of this prediction, higher + # value means higher confidence. + class VideoClassificationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.rb new file mode 100644 index 000000000000..5563bcbc76dd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module Predict + module Prediction + # Prediction output format for Video Object Tracking. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] time_segment_start + # @return [::Google::Protobuf::Duration] + # The beginning, inclusive, of the video's time segment in which the + # object instance has been detected. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. + # @!attribute [rw] time_segment_end + # @return [::Google::Protobuf::Duration] + # The end, inclusive, of the video's time segment in which the + # object instance has been detected. Expressed as a number of seconds as + # measured from the start of the video, with fractions up to a microsecond + # precision, and with "s" appended at the end. + # @!attribute [rw] confidence + # @return [::Google::Protobuf::FloatValue] + # The Model's confidence in correction of this prediction, higher + # value means higher confidence. + # @!attribute [rw] frames + # @return [::Array<::Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction::VideoObjectTrackingPredictionResult::Frame>] + # All of the frames of the video in which a single object instance has been + # detected. The bounding boxes in the frames identify the same object. + class VideoObjectTrackingPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The fields `xMin`, `xMax`, `yMin`, and `yMax` refer to a bounding box, + # i.e. the rectangle over the video frame pinpointing the found + # AnnotationSpec. The coordinates are relative to the frame size, and the + # point 0,0 is in the top left of the frame. + # @!attribute [rw] time_offset + # @return [::Google::Protobuf::Duration] + # A time (frame) of a video in which the object has been detected. + # Expressed as a number of seconds as measured from the + # start of the video, with fractions up to a microsecond precision, and + # with "s" appended at the end. + # @!attribute [rw] x_min + # @return [::Google::Protobuf::FloatValue] + # The leftmost coordinate of the bounding box. + # @!attribute [rw] x_max + # @return [::Google::Protobuf::FloatValue] + # The rightmost coordinate of the bounding box. + # @!attribute [rw] y_min + # @return [::Google::Protobuf::FloatValue] + # The topmost coordinate of the bounding box. + # @!attribute [rw] y_max + # @return [::Google::Protobuf::FloatValue] + # The bottommost coordinate of the bounding box. + class Frame + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.rb new file mode 100644 index 000000000000..a376a287f023 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Image Classification Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageClassificationInputs] + # The input parameters of this TrainingJob. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageClassificationMetadata] + # The metadata information. + class AutoMlImageClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageClassificationInputs::ModelType] + # @!attribute [rw] base_model_id + # @return [::String] + # The ID of the `base` model. If it is specified, the new model will be + # trained based on the `base` model. Otherwise, the new model will be + # trained from scratch. The `base` model must be in the same + # Project and Location as the new Model to train, and have the same + # modelType. + # @!attribute [rw] budget_milli_node_hours + # @return [::Integer] + # The training budget of creating this model, expressed in milli node + # hours i.e. 1,000 value in this field means 1 node hour. The actual + # metadata.costMilliNodeHours will be equal or less than this value. + # If further model training ceases to provide any improvements, it will + # stop without using the full budget and the metadata.successfulStopReason + # will be `model-converged`. + # Note, node_hour = actual_hour * number_of_nodes_involved. + # For modelType `cloud`(default), the budget must be between 8,000 + # and 800,000 milli node hours, inclusive. The default value is 192,000 + # which represents one day in wall time, considering 8 nodes are used. + # For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + # `mobile-tf-high-accuracy-1`, the training budget must be between + # 1,000 and 100,000 milli node hours, inclusive. + # The default value is 24,000 which represents one day in wall time on a + # single node that is used. + # @!attribute [rw] disable_early_stopping + # @return [::Boolean] + # Use the entire training budget. This disables the early stopping feature. + # When false the early stopping feature is enabled, which means that + # AutoML Image Classification might stop training before the entire + # training budget has been used. + # @!attribute [rw] multi_label + # @return [::Boolean] + # If false, a single-label (multi-class) Model will be trained (i.e. + # assuming that for each image just up to one annotation may be + # applicable). If true, a multi-label Model will be trained (i.e. + # assuming that for each image multiple annotations may be applicable). + class AutoMlImageClassificationInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A Model best tailored to be used within Google Cloud, and which cannot + # be exported. + # Default. + CLOUD = 1 + + # A model that, in addition to being available within Google + # Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + # or Core ML model and used on a mobile or edge device afterwards. + # Expected to have low latency, but may have lower prediction + # quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 2 + + # A model that, in addition to being available within Google + # Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + # or Core ML model and used on a mobile or edge device with afterwards. + MOBILE_TF_VERSATILE_1 = 3 + + # A model that, in addition to being available within Google + # Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + # or Core ML model and used on a mobile or edge device afterwards. + # Expected to have a higher latency, but should also have a higher + # prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 4 + end + end + + # @!attribute [rw] cost_milli_node_hours + # @return [::Integer] + # The actual training cost of creating this model, expressed in + # milli node hours, i.e. 1,000 value in this field means 1 node hour. + # Guaranteed to not exceed inputs.budgetMilliNodeHours. + # @!attribute [rw] successful_stop_reason + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageClassificationMetadata::SuccessfulStopReason] + # For successful job completions, this is the reason why the job has + # finished. + class AutoMlImageClassificationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module SuccessfulStopReason + # Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0 + + # The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1 + + # Further training of the Model ceased to increase its quality, since it + # already has converged. + MODEL_CONVERGED = 2 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.rb new file mode 100644 index 000000000000..ca441180279f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Image Object Detection Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageObjectDetectionInputs] + # The input parameters of this TrainingJob. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageObjectDetectionMetadata] + # The metadata information + class AutoMlImageObjectDetection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageObjectDetectionInputs::ModelType] + # @!attribute [rw] budget_milli_node_hours + # @return [::Integer] + # The training budget of creating this model, expressed in milli node + # hours i.e. 1,000 value in this field means 1 node hour. The actual + # metadata.costMilliNodeHours will be equal or less than this value. + # If further model training ceases to provide any improvements, it will + # stop without using the full budget and the metadata.successfulStopReason + # will be `model-converged`. + # Note, node_hour = actual_hour * number_of_nodes_involved. + # For modelType `cloud`(default), the budget must be between 20,000 + # and 900,000 milli node hours, inclusive. The default value is 216,000 + # which represents one day in wall time, considering 9 nodes are used. + # For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + # `mobile-tf-high-accuracy-1` + # the training budget must be between 1,000 and 100,000 milli node hours, + # inclusive. The default value is 24,000 which represents one day in + # wall time on a single node that is used. + # @!attribute [rw] disable_early_stopping + # @return [::Boolean] + # Use the entire training budget. This disables the early stopping feature. + # When false the early stopping feature is enabled, which means that AutoML + # Image Object Detection might stop training before the entire training + # budget has been used. + class AutoMlImageObjectDetectionInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A model best tailored to be used within Google Cloud, and which cannot + # be exported. Expected to have a higher latency, but should also have a + # higher prediction quality than other cloud models. + CLOUD_HIGH_ACCURACY_1 = 1 + + # A model best tailored to be used within Google Cloud, and which cannot + # be exported. Expected to have a low latency, but may have lower + # prediction quality than other cloud models. + CLOUD_LOW_LATENCY_1 = 2 + + # A model that, in addition to being available within Google + # Cloud can also be exported (see ModelService.ExportModel) and + # used on a mobile or edge device with TensorFlow afterwards. + # Expected to have low latency, but may have lower prediction + # quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3 + + # A model that, in addition to being available within Google + # Cloud can also be exported (see ModelService.ExportModel) and + # used on a mobile or edge device with TensorFlow afterwards. + MOBILE_TF_VERSATILE_1 = 4 + + # A model that, in addition to being available within Google + # Cloud, can also be exported (see ModelService.ExportModel) and + # used on a mobile or edge device with TensorFlow afterwards. + # Expected to have a higher latency, but should also have a higher + # prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 5 + end + end + + # @!attribute [rw] cost_milli_node_hours + # @return [::Integer] + # The actual training cost of creating this model, expressed in + # milli node hours, i.e. 1,000 value in this field means 1 node hour. + # Guaranteed to not exceed inputs.budgetMilliNodeHours. + # @!attribute [rw] successful_stop_reason + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageObjectDetectionMetadata::SuccessfulStopReason] + # For successful job completions, this is the reason why the job has + # finished. + class AutoMlImageObjectDetectionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module SuccessfulStopReason + # Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0 + + # The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1 + + # Further training of the Model ceased to increase its quality, since it + # already has converged. + MODEL_CONVERGED = 2 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.rb new file mode 100644 index 000000000000..e0bdf651d49f --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Image Segmentation Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageSegmentationInputs] + # The input parameters of this TrainingJob. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageSegmentationMetadata] + # The metadata information. + class AutoMlImageSegmentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageSegmentationInputs::ModelType] + # @!attribute [rw] budget_milli_node_hours + # @return [::Integer] + # The training budget of creating this model, expressed in milli node + # hours i.e. 1,000 value in this field means 1 node hour. The actual + # metadata.costMilliNodeHours will be equal or less than this value. + # If further model training ceases to provide any improvements, it will + # stop without using the full budget and the metadata.successfulStopReason + # will be `model-converged`. + # Note, node_hour = actual_hour * number_of_nodes_involved. Or + # actaul_wall_clock_hours = train_budget_milli_node_hours / + # (number_of_nodes_involved * 1000) + # For modelType `cloud-high-accuracy-1`(default), the budget must be between + # 20,000 and 2,000,000 milli node hours, inclusive. The default value is + # 192,000 which represents one day in wall time + # (1000 milli * 24 hours * 8 nodes). + # @!attribute [rw] base_model_id + # @return [::String] + # The ID of the `base` model. If it is specified, the new model will be + # trained based on the `base` model. Otherwise, the new model will be + # trained from scratch. The `base` model must be in the same + # Project and Location as the new Model to train, and have the same + # modelType. + class AutoMlImageSegmentationInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A model to be used via prediction calls to uCAIP API. Expected + # to have a higher latency, but should also have a higher prediction + # quality than other models. + CLOUD_HIGH_ACCURACY_1 = 1 + + # A model to be used via prediction calls to uCAIP API. Expected + # to have a lower latency but relatively lower prediction quality. + CLOUD_LOW_ACCURACY_1 = 2 + + # A model that, in addition to being available within Google + # Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + # model and used on a mobile or edge device afterwards. + # Expected to have low latency, but may have lower prediction + # quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3 + end + end + + # @!attribute [rw] cost_milli_node_hours + # @return [::Integer] + # The actual training cost of creating this model, expressed in + # milli node hours, i.e. 1,000 value in this field means 1 node hour. + # Guaranteed to not exceed inputs.budgetMilliNodeHours. + # @!attribute [rw] successful_stop_reason + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlImageSegmentationMetadata::SuccessfulStopReason] + # For successful job completions, this is the reason why the job has + # finished. + class AutoMlImageSegmentationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module SuccessfulStopReason + # Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0 + + # The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1 + + # Further training of the Model ceased to increase its quality, since it + # already has converged. + MODEL_CONVERGED = 2 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.rb new file mode 100644 index 000000000000..deab35e6d7f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Tables Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs] + # The input parameters of this TrainingJob. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesMetadata] + # The metadata information. + class AutoMlTables + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] optimization_objective_recall_value + # @return [::Float] + # Required when optimization_objective is "maximize-precision-at-recall". + # Must be between 0 and 1, inclusive. + # @!attribute [rw] optimization_objective_precision_value + # @return [::Float] + # Required when optimization_objective is "maximize-recall-at-precision". + # Must be between 0 and 1, inclusive. + # @!attribute [rw] prediction_type + # @return [::String] + # The type of prediction the Model is to produce. + # "classification" - Predict one out of multiple target values is + # picked for each row. + # "regression" - Predict a value based on its relation to other values. + # This type is available only to columns that contain + # semantically numeric values, i.e. integers or floating + # point number, even if stored as e.g. strings. + # @!attribute [rw] target_column + # @return [::String] + # The column name of the target column that the model is to predict. + # @!attribute [rw] transformations + # @return [::Array<::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation>] + # Each transformation will apply transform function to given input column. + # And the result will be used for training. + # When creating transformation for BigQuery Struct column, the column should + # be flattened using "." as the delimiter. + # @!attribute [rw] optimization_objective + # @return [::String] + # Objective function the model is optimizing towards. The training process + # creates a model that maximizes/minimizes the value of the objective + # function over the validation set. + # + # The supported optimization objectives depend on the prediction type. + # If the field is not set, a default objective function is used. + # + # classification (binary): + # "maximize-au-roc" (default) - Maximize the area under the receiver + # operating characteristic (ROC) curve. + # "minimize-log-loss" - Minimize log loss. + # "maximize-au-prc" - Maximize the area under the precision-recall curve. + # "maximize-precision-at-recall" - Maximize precision for a specified + # recall value. + # "maximize-recall-at-precision" - Maximize recall for a specified + # precision value. + # + # classification (multi-class): + # "minimize-log-loss" (default) - Minimize log loss. + # + # regression: + # "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). + # "minimize-mae" - Minimize mean-absolute error (MAE). + # "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). + # @!attribute [rw] train_budget_milli_node_hours + # @return [::Integer] + # Required. The train budget of creating this model, expressed in milli node + # hours i.e. 1,000 value in this field means 1 node hour. + # + # The training cost of the model will not exceed this budget. The final cost + # will be attempted to be close to the budget, though may end up being (even) + # noticeably smaller - at the backend's discretion. This especially may + # happen when further model training ceases to provide any improvements. + # + # If the budget is set to a value known to be insufficient to train a + # model for the given dataset, the training won't be attempted and + # will error. + # + # The train budget must be between 1,000 and 72,000 milli node hours, + # inclusive. + # @!attribute [rw] disable_early_stopping + # @return [::Boolean] + # Use the entire training budget. This disables the early stopping feature. + # By default, the early stopping feature is enabled, which means that AutoML + # Tables might stop training before the entire training budget has been used. + # @!attribute [rw] weight_column_name + # @return [::String] + # Column name that should be used as the weight column. + # Higher values in this column give more importance to the row + # during model training. The column must have numeric values between 0 and + # 10000 inclusively; 0 means the row is ignored for training. If weight + # column field is not set, then all rows are assumed to have equal weight + # of 1. + # @!attribute [rw] export_evaluated_data_items_config + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::ExportEvaluatedDataItemsConfig] + # Configuration for exporting test set predictions to a BigQuery table. If + # this configuration is absent, then the export is not performed. + # @!attribute [rw] additional_experiments + # @return [::Array<::String>] + # Additional experiment flags for the Tables training pipeline. + class AutoMlTablesInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] auto + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::AutoTransformation] + # @!attribute [rw] numeric + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::NumericTransformation] + # @!attribute [rw] categorical + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::CategoricalTransformation] + # @!attribute [rw] timestamp + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::TimestampTransformation] + # @!attribute [rw] text + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::TextTransformation] + # @!attribute [rw] repeated_numeric + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::NumericArrayTransformation] + # @!attribute [rw] repeated_categorical + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::CategoricalArrayTransformation] + # @!attribute [rw] repeated_text + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTablesInputs::Transformation::TextArrayTransformation] + class Transformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Training pipeline will infer the proper transformation based on the + # statistic of dataset. + # @!attribute [rw] column_name + # @return [::String] + class AutoTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Training pipeline will perform following transformation functions. + # * The value converted to float32. + # * The z_score of the value. + # * log(value+1) when the value is greater than or equal to 0. Otherwise, + # this transformation is not applied and the value is considered a + # missing value. + # * z_score of log(value+1) when the value is greater than or equal to 0. + # Otherwise, this transformation is not applied and the value is + # considered a missing value. + # * A boolean value that indicates whether the value is valid. + # @!attribute [rw] column_name + # @return [::String] + # @!attribute [rw] invalid_values_allowed + # @return [::Boolean] + # If invalid values is allowed, the training pipeline will create a + # boolean feature that indicated whether the value is valid. + # Otherwise, the training pipeline will discard the input row from + # trainining data. + class NumericTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Training pipeline will perform following transformation functions. + # * The categorical string as is--no change to case, punctuation, + # spelling, + # tense, and so on. + # * Convert the category name to a dictionary lookup index and generate an + # embedding for each index. + # * Categories that appear less than 5 times in the training dataset are + # treated as the "unknown" category. The "unknown" category gets its own + # special lookup index and resulting embedding. + # @!attribute [rw] column_name + # @return [::String] + class CategoricalTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Training pipeline will perform following transformation functions. + # * Apply the transformation functions for Numerical columns. + # * Determine the year, month, day,and weekday. Treat each value from the + # * timestamp as a Categorical column. + # * Invalid numerical values (for example, values that fall outside of a + # typical timestamp range, or are extreme values) receive no special + # treatment and are not removed. + # @!attribute [rw] column_name + # @return [::String] + # @!attribute [rw] time_format + # @return [::String] + # The format in which that time field is expressed. The time_format must + # either be one of: + # * `unix-seconds` + # * `unix-milliseconds` + # * `unix-microseconds` + # * `unix-nanoseconds` + # (for respectively number of seconds, milliseconds, microseconds and + # nanoseconds since start of the Unix epoch); + # or be written in `strftime` syntax. If time_format is not set, then the + # default format is RFC 3339 `date-time` format, where + # `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) + # @!attribute [rw] invalid_values_allowed + # @return [::Boolean] + # If invalid values is allowed, the training pipeline will create a + # boolean feature that indicated whether the value is valid. + # Otherwise, the training pipeline will discard the input row from + # trainining data. + class TimestampTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Training pipeline will perform following transformation functions. + # * The text as is--no change to case, punctuation, spelling, tense, and + # so + # on. + # * Tokenize text to words. Convert each words to a dictionary lookup + # index + # and generate an embedding for each index. Combine the embedding of all + # elements into a single embedding using the mean. + # * Tokenization is based on unicode script boundaries. + # * Missing values get their own lookup index and resulting embedding. + # * Stop-words receive no special treatment and are not removed. + # @!attribute [rw] column_name + # @return [::String] + class TextTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Treats the column as numerical array and performs following + # transformation functions. + # * All transformations for Numerical types applied to the average of the + # all elements. + # * The average of empty arrays is treated as zero. + # @!attribute [rw] column_name + # @return [::String] + # @!attribute [rw] invalid_values_allowed + # @return [::Boolean] + # If invalid values is allowed, the training pipeline will create a + # boolean feature that indicated whether the value is valid. + # Otherwise, the training pipeline will discard the input row from + # trainining data. + class NumericArrayTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Treats the column as categorical array and performs following + # transformation functions. + # * For each element in the array, convert the category name to a + # dictionary + # lookup index and generate an embedding for each index. + # Combine the embedding of all elements into a single embedding using + # the mean. + # * Empty arrays treated as an embedding of zeroes. + # @!attribute [rw] column_name + # @return [::String] + class CategoricalArrayTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Treats the column as text array and performs following transformation + # functions. + # * Concatenate all text values in the array into a single text value + # using + # a space (" ") as a delimiter, and then treat the result as a single + # text value. Apply the transformations for Text columns. + # * Empty arrays treated as an empty text. + # @!attribute [rw] column_name + # @return [::String] + class TextArrayTransformation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Model metadata specific to AutoML Tables. + # @!attribute [rw] train_cost_milli_node_hours + # @return [::Integer] + # Output only. The actual training cost of the model, expressed in milli + # node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + # to not exceed the train budget. + class AutoMlTablesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.rb new file mode 100644 index 000000000000..95e80e8f90a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Text Classification Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTextClassificationInputs] + # The input parameters of this TrainingJob. + class AutoMlTextClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] multi_label + # @return [::Boolean] + class AutoMlTextClassificationInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.rb new file mode 100644 index 000000000000..d687db0fb3e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Text Extraction Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTextExtractionInputs] + # The input parameters of this TrainingJob. + class AutoMlTextExtraction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + class AutoMlTextExtractionInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.rb new file mode 100644 index 000000000000..4bc5c27f055a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Text Sentiment Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlTextSentimentInputs] + # The input parameters of this TrainingJob. + class AutoMlTextSentiment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] sentiment_max + # @return [::Integer] + # A sentiment is expressed as an integer ordinal, where higher value + # means a more positive sentiment. The range of sentiments that will be used + # is between 0 and sentimentMax (inclusive on both ends), and all the values + # in the range must be represented in the dataset before a model can be + # created. + # Only the Annotations with this sentimentMax will be used for training. + # sentimentMax value must be between 1 and 10 (inclusive). + class AutoMlTextSentimentInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.rb new file mode 100644 index 000000000000..ce13076f54df --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Video Action Recognition + # Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoActionRecognitionInputs] + # The input parameters of this TrainingJob. + class AutoMlVideoActionRecognition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoActionRecognitionInputs::ModelType] + class AutoMlVideoActionRecognitionInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A model best tailored to be used within Google Cloud, and which c annot + # be exported. Default. + CLOUD = 1 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) as a TensorFlow or + # TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) to a Jetson device + # afterwards. + MOBILE_JETSON_VERSATILE_1 = 3 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) as a TensorFlow or + # TensorFlow Lite model and used on a Coral device afterwards. + MOBILE_CORAL_VERSATILE_1 = 4 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.rb new file mode 100644 index 000000000000..8b4dbc6f93df --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Video Classification Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoClassificationInputs] + # The input parameters of this TrainingJob. + class AutoMlVideoClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoClassificationInputs::ModelType] + class AutoMlVideoClassificationInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A model best tailored to be used within Google Cloud, and which cannot + # be exported. Default. + CLOUD = 1 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) as a TensorFlow or + # TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) to a Jetson device + # afterwards. + MOBILE_JETSON_VERSATILE_1 = 3 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.rb new file mode 100644 index 000000000000..874af76d27af --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # A TrainingJob that trains and uploads an AutoML Video ObjectTracking Model. + # @!attribute [rw] inputs + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoObjectTrackingInputs] + # The input parameters of this TrainingJob. + class AutoMlVideoObjectTracking + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] model_type + # @return [::Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition::AutoMlVideoObjectTrackingInputs::ModelType] + class AutoMlVideoObjectTrackingInputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ModelType + # Should not be set. + MODEL_TYPE_UNSPECIFIED = 0 + + # A model best tailored to be used within Google Cloud, and which c annot + # be exported. Default. + CLOUD = 1 + + # A model that, in addition to being available within Google Cloud, can + # also be exported (see ModelService.ExportModel) as a TensorFlow or + # TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2 + + # A versatile model that is meant to be exported (see + # ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_VERSATILE_1 = 3 + + # A model that trades off quality for low latency, to be exported (see + # ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_LOW_LATENCY_1 = 4 + + # A versatile model that is meant to be exported (see + # ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_VERSATILE_1 = 5 + + # A model that trades off quality for low latency, to be exported (see + # ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_LOW_LATENCY_1 = 6 + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.rb new file mode 100644 index 000000000000..9faa21b37a32 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module Schema + module TrainingJob + module Definition + # Configuration for exporting test set predictions to a BigQuery table. + # @!attribute [rw] destination_bigquery_uri + # @return [::String] + # URI of desired destination BigQuery table. Expected format: + # bq://:: + # + # If not specified, then results are exported to the following auto-created + # BigQuery table: + # :export_evaluated_examples__.evaluated_examples + # @!attribute [rw] override_existing_table + # @return [::Boolean] + # If true and an export destination is specified, then the contents of the + # destination are overwritten. Otherwise, if the export destination already + # exists, then the export operation fails. + class ExportEvaluatedDataItemsConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb new file mode 100644 index 000000000000..07bb6eb9eeeb --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # PSC config that is used to automatically create forwarding rule via + # ServiceConnectionMap. + # @!attribute [rw] project_id + # @return [::String] + # Required. Project id used to create forwarding rule. + # @!attribute [rw] network + # @return [::String] + # Required. The full name of the Google Compute Engine + # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). + # [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + # `projects/{project}/global/networks/{network}`. + # Where \\{project} is a project number, as in '12345', and \\{network} is + # network name. + class PSCAutomationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents configuration for private service connect. + # @!attribute [rw] enable_private_service_connect + # @return [::Boolean] + # Required. If true, expose the IndexEndpoint via private service connect. + # @!attribute [rw] project_allowlist + # @return [::Array<::String>] + # A list of Projects from which the forwarding rule will target the service + # attachment. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The name of the generated service attachment resource. + # This is only populated if the endpoint is deployed with + # PrivateServiceConnect. + class PrivateServiceConnectConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PscAutomatedEndpoints defines the output of the forwarding rule + # automatically created by each PscAutomationConfig. + # @!attribute [rw] project_id + # @return [::String] + # Corresponding project_id in pscAutomationConfigs + # @!attribute [rw] network + # @return [::String] + # Corresponding network in pscAutomationConfigs. + # @!attribute [rw] match_address + # @return [::String] + # Ip Address created by the automated forwarding rule. + class PscAutomatedEndpoints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb new file mode 100644 index 000000000000..f864613b9844 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # SpecialistPool represents customers' own workforce to work on their data + # labeling jobs. It includes a group of specialist managers and workers. + # Managers are responsible for managing the workers in this pool as well as + # customers' data labeling jobs associated with this pool. Customers create + # specialist pool as well as start data labeling jobs on Cloud, managers and + # workers handle the jobs using CrowdCompute console. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the SpecialistPool. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of the SpecialistPool. + # The name can be up to 128 characters long and can consist of any UTF-8 + # characters. + # This field should be unique on project-level. + # @!attribute [r] specialist_managers_count + # @return [::Integer] + # Output only. The number of managers in this SpecialistPool. + # @!attribute [rw] specialist_manager_emails + # @return [::Array<::String>] + # The email addresses of the managers in the SpecialistPool. + # @!attribute [r] pending_data_labeling_jobs + # @return [::Array<::String>] + # Output only. The resource name of the pending data labeling jobs. + # @!attribute [rw] specialist_worker_emails + # @return [::Array<::String>] + # The email addresses of workers in the SpecialistPool. + class SpecialistPool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb new file mode 100644 index 000000000000..d0ff3c25c6e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#create_specialist_pool SpecialistPoolService.CreateSpecialistPool}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent Project name for the new SpecialistPool. + # The form is `projects/{project}/locations/{location}`. + # @!attribute [rw] specialist_pool + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # Required. The SpecialistPool to create. + class CreateSpecialistPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#create_specialist_pool SpecialistPoolService.CreateSpecialistPool}. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class CreateSpecialistPoolOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#get_specialist_pool SpecialistPoolService.GetSpecialistPool}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the SpecialistPool resource. + # The form is + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + class GetSpecialistPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the SpecialistPool's parent resource. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # Typically obtained by + # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse#next_page_token ListSpecialistPoolsResponse.next_page_token} + # of the previous + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools} + # call. Return first page if empty. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. FieldMask represents a set of + class ListSpecialistPoolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools}. + # @!attribute [rw] specialist_pools + # @return [::Array<::Google::Cloud::AIPlatform::V1::SpecialistPool>] + # A list of SpecialistPools that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListSpecialistPoolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#delete_specialist_pool SpecialistPoolService.DeleteSpecialistPool}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the SpecialistPool to delete. Format: + # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, any specialist managers in this SpecialistPool will also be + # deleted. (Otherwise, the request will only work if the SpecialistPool has + # no specialist managers.) + class DeleteSpecialistPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#update_specialist_pool SpecialistPoolService.UpdateSpecialistPool}. + # @!attribute [rw] specialist_pool + # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] + # Required. The SpecialistPool which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. + class UpdateSpecialistPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation metadata for + # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#update_specialist_pool SpecialistPoolService.UpdateSpecialistPool}. + # @!attribute [r] specialist_pool + # @return [::String] + # Output only. The name of the SpecialistPool to which the specialists are + # being added. Format: + # `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The operation generic information. + class UpdateSpecialistPoolOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb new file mode 100644 index 000000000000..7c8bd6e8dec0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb @@ -0,0 +1,731 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A message representing a Study. + # @!attribute [r] name + # @return [::String] + # Output only. The name of a study. The study's globally unique identifier. + # Format: `projects/{project}/locations/{location}/studies/{study}` + # @!attribute [rw] display_name + # @return [::String] + # Required. Describes the Study, default value is empty string. + # @!attribute [rw] study_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec] + # Required. Configuration of the Study. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::Study::State] + # Output only. The detailed state of a Study. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time at which the study was created. + # @!attribute [r] inactive_reason + # @return [::String] + # Output only. A human readable reason why the Study is inactive. + # This should be empty if a study is ACTIVE or COMPLETED. + class Study + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the Study state. + module State + # The study state is unspecified. + STATE_UNSPECIFIED = 0 + + # The study is active. + ACTIVE = 1 + + # The study is stopped due to an internal error. + INACTIVE = 2 + + # The study is done when the service exhausts the parameter search space + # or max_trial_count is reached. + COMPLETED = 3 + end + end + + # A message representing a Trial. A Trial contains a unique set of Parameters + # that has been or will be evaluated, along with the objective metrics got by + # running the Trial. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the Trial assigned by the service. + # @!attribute [r] id + # @return [::String] + # Output only. The identifier of the Trial assigned by the service. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::Trial::State] + # Output only. The detailed state of the Trial. + # @!attribute [r] parameters + # @return [::Array<::Google::Cloud::AIPlatform::V1::Trial::Parameter>] + # Output only. The parameters of the Trial. + # @!attribute [r] final_measurement + # @return [::Google::Cloud::AIPlatform::V1::Measurement] + # Output only. The final measurement containing the objective value. + # @!attribute [r] measurements + # @return [::Array<::Google::Cloud::AIPlatform::V1::Measurement>] + # Output only. A list of measurements that are strictly lexicographically + # ordered by their induced tuples (steps, elapsed_duration). + # These are used for early stopping computations. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the Trial was started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the Trial's status changed to `SUCCEEDED` or + # `INFEASIBLE`. + # @!attribute [r] client_id + # @return [::String] + # Output only. The identifier of the client that originally requested this + # Trial. Each client is identified by a unique client_id. When a client asks + # for a suggestion, Vertex AI Vizier will assign it a Trial. The client + # should evaluate the Trial, complete it, and report back to Vertex AI + # Vizier. If suggestion is asked again by same client_id before the Trial is + # completed, the same Trial will be returned. Multiple clients with + # different client_ids can ask for suggestions simultaneously, each of them + # will get their own Trial. + # @!attribute [r] infeasible_reason + # @return [::String] + # Output only. A human readable string describing why the Trial is + # infeasible. This is set only if Trial state is `INFEASIBLE`. + # @!attribute [r] custom_job + # @return [::String] + # Output only. The CustomJob name linked to the Trial. + # It's set for a HyperparameterTuningJob's Trial. + # @!attribute [r] web_access_uris + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. URIs for accessing [interactive + # shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + # (one URI for each training node). Only available if this trial is part of + # a + # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob HyperparameterTuningJob} + # and the job's + # {::Google::Cloud::AIPlatform::V1::CustomJobSpec#enable_web_access trial_job_spec.enable_web_access} + # field is `true`. + # + # The keys are names of each node used for the trial; for example, + # `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + # the second worker pool, and `workerpool1-1` for the second node in the + # second worker pool. + # + # The values are the URIs for each node's interactive shell. + class Trial + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message representing a parameter to be tuned. + # @!attribute [r] parameter_id + # @return [::String] + # Output only. The ID of the parameter. The parameter should be defined in + # [StudySpec's + # Parameters][google.cloud.aiplatform.v1.StudySpec.parameters]. + # @!attribute [r] value + # @return [::Google::Protobuf::Value] + # Output only. The value of the parameter. + # `number_value` will be set if a parameter defined in StudySpec is + # in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. + # `string_value` will be set if a parameter defined in StudySpec is + # in type 'CATEGORICAL'. + class Parameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class WebAccessUrisEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes a Trial state. + module State + # The Trial state is unspecified. + STATE_UNSPECIFIED = 0 + + # Indicates that a specific Trial has been requested, but it has not yet + # been suggested by the service. + REQUESTED = 1 + + # Indicates that the Trial has been suggested. + ACTIVE = 2 + + # Indicates that the Trial should stop according to the service. + STOPPING = 3 + + # Indicates that the Trial is completed successfully. + SUCCEEDED = 4 + + # Indicates that the Trial should not be attempted again. + # The service will set a Trial to INFEASIBLE when it's done but missing + # the final_measurement. + INFEASIBLE = 5 + end + end + + # @!attribute [rw] description + # @return [::String] + # A human-readable field which can store a description of this context. + # This will become part of the resulting Trial's description field. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::AIPlatform::V1::Trial::Parameter>] + # If/when a Trial is generated or selected from this Context, + # its Parameters will match any parameters specified here. + # (I.e. if this context specifies parameter name:'a' int_value:3, + # then a resulting Trial will have int_value:3 for its parameter named + # 'a'.) Note that we first attempt to match existing REQUESTED Trials with + # contexts, and if there are no matches, we generate suggestions in the + # subspace defined by the parameters specified here. + # NOTE: a Context without any Parameters matches the entire feasible search + # space. + class TrialContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time-based Constraint for Study + # @!attribute [rw] max_duration + # @return [::Google::Protobuf::Duration] + # Counts the wallclock time passed since the creation of this Study. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Compares the wallclock time to this time. Must use UTC timezone. + class StudyTimeConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents specification of a Study. + # @!attribute [rw] decay_curve_stopping_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::DecayCurveAutomatedStoppingSpec] + # The automated early stopping spec using decay curve rule. + # @!attribute [rw] median_automated_stopping_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MedianAutomatedStoppingSpec] + # The automated early stopping spec using median rule. + # @!attribute [rw] convex_automated_stopping_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ConvexAutomatedStoppingSpec] + # The automated early stopping spec using convex stopping rule. + # @!attribute [rw] metrics + # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec>] + # Required. Metric specs for the Study. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec>] + # Required. The set of parameters to tune. + # @!attribute [rw] algorithm + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::Algorithm] + # The search algorithm specified for the Study. + # @!attribute [rw] observation_noise + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ObservationNoise] + # The observation noise level of the study. + # Currently only supported by the Vertex AI Vizier service. Not supported by + # HyperparameterTuningJob or TrainingPipeline. + # @!attribute [rw] measurement_selection_type + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MeasurementSelectionType] + # Describe which measurement selection type will be used + # @!attribute [rw] study_stopping_config + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::StudyStoppingConfig] + # Conditions for automated stopping of a Study. Enable automated stopping by + # configuring at least one condition. + class StudySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a metric to optimize. + # @!attribute [rw] metric_id + # @return [::String] + # Required. The ID of the metric. Must not contain whitespaces and must be + # unique amongst all MetricSpecs. + # @!attribute [rw] goal + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec::GoalType] + # Required. The optimization goal of the metric. + # @!attribute [rw] safety_config + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec::SafetyMetricConfig] + # Used for safe search. In the case, the metric will be a safety + # metric. You must provide a separate metric for objective metric. + class MetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Used in safe optimization to specify threshold levels and risk tolerance. + # @!attribute [rw] safety_threshold + # @return [::Float] + # Safety threshold (boundary value between safe and unsafe). NOTE that if + # you leave SafetyMetricConfig unset, a default value of 0 will be used. + # @!attribute [rw] desired_min_safe_trials_fraction + # @return [::Float] + # Desired minimum fraction of safe trials (over total number of trials) + # that should be targeted by the algorithm at any time during the + # study (best effort). This should be between 0.0 and 1.0 and a value of + # 0.0 means that there is no minimum and an algorithm proceeds without + # targeting any specific fraction. A value of 1.0 means that the + # algorithm attempts to only Suggest safe Trials. + class SafetyMetricConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The available types of optimization goals. + module GoalType + # Goal Type will default to maximize. + GOAL_TYPE_UNSPECIFIED = 0 + + # Maximize the goal metric. + MAXIMIZE = 1 + + # Minimize the goal metric. + MINIMIZE = 2 + end + end + + # Represents a single parameter to optimize. + # @!attribute [rw] double_value_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::DoubleValueSpec] + # The value spec for a 'DOUBLE' parameter. + # @!attribute [rw] integer_value_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::IntegerValueSpec] + # The value spec for an 'INTEGER' parameter. + # @!attribute [rw] categorical_value_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::CategoricalValueSpec] + # The value spec for a 'CATEGORICAL' parameter. + # @!attribute [rw] discrete_value_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::DiscreteValueSpec] + # The value spec for a 'DISCRETE' parameter. + # @!attribute [rw] parameter_id + # @return [::String] + # Required. The ID of the parameter. Must not contain whitespaces and must + # be unique amongst all ParameterSpecs. + # @!attribute [rw] scale_type + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ScaleType] + # How the parameter should be scaled. + # Leave unset for `CATEGORICAL` parameters. + # @!attribute [rw] conditional_parameter_specs + # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec>] + # A conditional parameter node is active if the parameter's value matches + # the conditional node's parent_value_condition. + # + # If two items in conditional_parameter_specs have the same name, they + # must have disjoint parent_value_condition. + class ParameterSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Value specification for a parameter in `DOUBLE` type. + # @!attribute [rw] min_value + # @return [::Float] + # Required. Inclusive minimum value of the parameter. + # @!attribute [rw] max_value + # @return [::Float] + # Required. Inclusive maximum value of the parameter. + # @!attribute [rw] default_value + # @return [::Float] + # A default value for a `DOUBLE` parameter that is assumed to be a + # relatively good starting point. Unset value signals that there is no + # offered starting point. + # + # Currently only supported by the Vertex AI Vizier service. Not supported + # by HyperparameterTuningJob or TrainingPipeline. + class DoubleValueSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Value specification for a parameter in `INTEGER` type. + # @!attribute [rw] min_value + # @return [::Integer] + # Required. Inclusive minimum value of the parameter. + # @!attribute [rw] max_value + # @return [::Integer] + # Required. Inclusive maximum value of the parameter. + # @!attribute [rw] default_value + # @return [::Integer] + # A default value for an `INTEGER` parameter that is assumed to be a + # relatively good starting point. Unset value signals that there is no + # offered starting point. + # + # Currently only supported by the Vertex AI Vizier service. Not supported + # by HyperparameterTuningJob or TrainingPipeline. + class IntegerValueSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Value specification for a parameter in `CATEGORICAL` type. + # @!attribute [rw] values + # @return [::Array<::String>] + # Required. The list of possible categories. + # @!attribute [rw] default_value + # @return [::String] + # A default value for a `CATEGORICAL` parameter that is assumed to be a + # relatively good starting point. Unset value signals that there is no + # offered starting point. + # + # Currently only supported by the Vertex AI Vizier service. Not supported + # by HyperparameterTuningJob or TrainingPipeline. + class CategoricalValueSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Value specification for a parameter in `DISCRETE` type. + # @!attribute [rw] values + # @return [::Array<::Float>] + # Required. A list of possible values. + # The list should be in increasing order and at least 1e-10 apart. + # For instance, this parameter might have possible settings of 1.5, 2.5, + # and 4.0. This list should not contain more than 1,000 values. + # @!attribute [rw] default_value + # @return [::Float] + # A default value for a `DISCRETE` parameter that is assumed to be a + # relatively good starting point. Unset value signals that there is no + # offered starting point. It automatically rounds to the + # nearest feasible discrete point. + # + # Currently only supported by the Vertex AI Vizier service. Not supported + # by HyperparameterTuningJob or TrainingPipeline. + class DiscreteValueSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a parameter spec with condition from its parent parameter. + # @!attribute [rw] parent_discrete_values + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::DiscreteValueCondition] + # The spec for matching values from a parent parameter of + # `DISCRETE` type. + # @!attribute [rw] parent_int_values + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::IntValueCondition] + # The spec for matching values from a parent parameter of `INTEGER` + # type. + # @!attribute [rw] parent_categorical_values + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::CategoricalValueCondition] + # The spec for matching values from a parent parameter of + # `CATEGORICAL` type. + # @!attribute [rw] parameter_spec + # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec] + # Required. The spec for a conditional parameter. + class ConditionalParameterSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the spec to match discrete values from parent parameter. + # @!attribute [rw] values + # @return [::Array<::Float>] + # Required. Matches values of the parent parameter of 'DISCRETE' type. + # All values must exist in `discrete_value_spec` of parent parameter. + # + # The Epsilon of the value matching is 1e-10. + class DiscreteValueCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec to match integer values from parent parameter. + # @!attribute [rw] values + # @return [::Array<::Integer>] + # Required. Matches values of the parent parameter of 'INTEGER' type. + # All values must lie in `integer_value_spec` of parent parameter. + class IntValueCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the spec to match categorical values from parent parameter. + # @!attribute [rw] values + # @return [::Array<::String>] + # Required. Matches values of the parent parameter of 'CATEGORICAL' + # type. All values must exist in `categorical_value_spec` of parent + # parameter. + class CategoricalValueCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The type of scaling that should be applied to this parameter. + module ScaleType + # By default, no scaling is applied. + SCALE_TYPE_UNSPECIFIED = 0 + + # Scales the feasible space to (0, 1) linearly. + UNIT_LINEAR_SCALE = 1 + + # Scales the feasible space logarithmically to (0, 1). The entire + # feasible space must be strictly positive. + UNIT_LOG_SCALE = 2 + + # Scales the feasible space "reverse" logarithmically to (0, 1). The + # result is that values close to the top of the feasible space are spread + # out more than points near the bottom. The entire feasible space must be + # strictly positive. + UNIT_REVERSE_LOG_SCALE = 3 + end + end + + # The decay curve automated stopping rule builds a Gaussian Process + # Regressor to predict the final objective value of a Trial based on the + # already completed Trials and the intermediate measurements of the current + # Trial. Early stopping is requested for the current Trial if there is very + # low probability to exceed the optimal value found so far. + # @!attribute [rw] use_elapsed_duration + # @return [::Boolean] + # True if + # {::Google::Cloud::AIPlatform::V1::Measurement#elapsed_duration Measurement.elapsed_duration} + # is used as the x-axis of each Trials Decay Curve. Otherwise, + # {::Google::Cloud::AIPlatform::V1::Measurement#step_count Measurement.step_count} + # will be used as the x-axis. + class DecayCurveAutomatedStoppingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The median automated stopping rule stops a pending Trial if the Trial's + # best objective_value is strictly below the median 'performance' of all + # completed Trials reported up to the Trial's last measurement. + # Currently, 'performance' refers to the running average of the objective + # values reported by the Trial in each measurement. + # @!attribute [rw] use_elapsed_duration + # @return [::Boolean] + # True if median automated stopping rule applies on + # {::Google::Cloud::AIPlatform::V1::Measurement#elapsed_duration Measurement.elapsed_duration}. + # It means that elapsed_duration field of latest measurement of current + # Trial is used to compute median objective value for each completed + # Trials. + class MedianAutomatedStoppingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for ConvexAutomatedStoppingSpec. + # When there are enough completed trials (configured by + # min_measurement_count), for pending trials with enough measurements and + # steps, the policy first computes an overestimate of the objective value at + # max_num_steps according to the slope of the incomplete objective value + # curve. No prediction can be made if the curve is completely flat. If the + # overestimation is worse than the best objective value of the completed + # trials, this pending trial will be early-stopped, but a last measurement + # will be added to the pending trial with max_num_steps and predicted + # objective value from the autoregression model. + # @!attribute [rw] max_step_count + # @return [::Integer] + # Steps used in predicting the final objective for early stopped trials. In + # general, it's set to be the same as the defined steps in training / + # tuning. If not defined, it will learn it from the completed trials. When + # use_steps is false, this field is set to the maximum elapsed seconds. + # @!attribute [rw] min_step_count + # @return [::Integer] + # Minimum number of steps for a trial to complete. Trials which do not have + # a measurement with step_count > min_step_count won't be considered for + # early stopping. It's ok to set it to 0, and a trial can be early stopped + # at any stage. By default, min_step_count is set to be one-tenth of the + # max_step_count. + # When use_elapsed_duration is true, this field is set to the minimum + # elapsed seconds. + # @!attribute [rw] min_measurement_count + # @return [::Integer] + # The minimal number of measurements in a Trial. Early-stopping checks + # will not trigger if less than min_measurement_count+1 completed trials or + # pending trials with less than min_measurement_count measurements. If not + # defined, the default value is 5. + # @!attribute [rw] learning_rate_parameter_name + # @return [::String] + # The hyper-parameter name used in the tuning job that stands for learning + # rate. Leave it blank if learning rate is not in a parameter in tuning. + # The learning_rate is used to estimate the objective value of the ongoing + # trial. + # @!attribute [rw] use_elapsed_duration + # @return [::Boolean] + # This bool determines whether or not the rule is applied based on + # elapsed_secs or steps. If use_elapsed_duration==false, the early stopping + # decision is made according to the predicted objective values according to + # the target steps. If use_elapsed_duration==true, elapsed_secs is used + # instead of steps. Also, in this case, the parameters max_num_steps and + # min_num_steps are overloaded to contain max_elapsed_seconds and + # min_elapsed_seconds. + # @!attribute [rw] update_all_stopped_trials + # @return [::Boolean] + # ConvexAutomatedStoppingSpec by default only updates the trials that needs + # to be early stopped using a newly trained auto-regressive model. When + # this flag is set to True, all stopped trials from the beginning are + # potentially updated in terms of their `final_measurement`. Also, note + # that the training logic of autoregressive models is different in this + # case. Enabling this option has shown better results and this may be the + # default option in the future. + class ConvexAutomatedStoppingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration (stopping conditions) for automated stopping of a Study. + # Conditions include trial budgets, time budgets, and convergence detection. + # @!attribute [rw] should_stop_asap + # @return [::Google::Protobuf::BoolValue] + # If true, a Study enters STOPPING_ASAP whenever it would normally enters + # STOPPING state. + # + # The bottom line is: set to true if you want to interrupt on-going + # evaluations of Trials as soon as the study stopping condition is met. + # (Please see Study.State documentation for the source of truth). + # @!attribute [rw] minimum_runtime_constraint + # @return [::Google::Cloud::AIPlatform::V1::StudyTimeConstraint] + # Each "stopping rule" in this proto specifies an "if" condition. Before + # Vizier would generate a new suggestion, it first checks each specified + # stopping rule, from top to bottom in this list. + # Note that the first few rules (e.g. minimum_runtime_constraint, + # min_num_trials) will prevent other stopping rules from being evaluated + # until they are met. For example, setting `min_num_trials=5` and + # `always_stop_after= 1 hour` means that the Study will ONLY stop after it + # has 5 COMPLETED trials, even if more than an hour has passed since its + # creation. It follows the first applicable rule (whose "if" condition is + # satisfied) to make a stopping decision. If none of the specified rules + # are applicable, then Vizier decides that the study should not stop. + # If Vizier decides that the study should stop, the study enters + # STOPPING state (or STOPPING_ASAP if should_stop_asap = true). + # IMPORTANT: The automatic study state transition happens precisely as + # described above; that is, deleting trials or updating StudyConfig NEVER + # automatically moves the study state back to ACTIVE. If you want to + # _resume_ a Study that was stopped, 1) change the stopping conditions if + # necessary, 2) activate the study, and then 3) ask for suggestions. + # If the specified time or duration has not passed, do not stop the + # study. + # @!attribute [rw] maximum_runtime_constraint + # @return [::Google::Cloud::AIPlatform::V1::StudyTimeConstraint] + # If the specified time or duration has passed, stop the study. + # @!attribute [rw] min_num_trials + # @return [::Google::Protobuf::Int32Value] + # If there are fewer than this many COMPLETED trials, do not stop the + # study. + # @!attribute [rw] max_num_trials + # @return [::Google::Protobuf::Int32Value] + # If there are more than this many trials, stop the study. + # @!attribute [rw] max_num_trials_no_progress + # @return [::Google::Protobuf::Int32Value] + # If the objective value has not improved for this many consecutive + # trials, stop the study. + # + # WARNING: Effective only for single-objective studies. + # @!attribute [rw] max_duration_no_progress + # @return [::Google::Protobuf::Duration] + # If the objective value has not improved for this much time, stop the + # study. + # + # WARNING: Effective only for single-objective studies. + class StudyStoppingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The available search algorithms for the Study. + module Algorithm + # The default algorithm used by Vertex AI for [hyperparameter + # tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) + # and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). + ALGORITHM_UNSPECIFIED = 0 + + # Simple grid search within the feasible space. To use grid search, + # all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. + GRID_SEARCH = 2 + + # Simple random search within the feasible space. + RANDOM_SEARCH = 3 + end + + # Describes the noise level of the repeated observations. + # + # "Noisy" means that the repeated observations with the same Trial parameters + # may lead to different metric evaluations. + module ObservationNoise + # The default noise level chosen by Vertex AI. + OBSERVATION_NOISE_UNSPECIFIED = 0 + + # Vertex AI assumes that the objective function is (nearly) + # perfectly reproducible, and will never repeat the same Trial + # parameters. + LOW = 1 + + # Vertex AI will estimate the amount of noise in metric + # evaluations, it may repeat the same Trial parameters more than once. + HIGH = 2 + end + + # This indicates which measurement to use if/when the service automatically + # selects the final measurement from previously reported intermediate + # measurements. Choose this based on two considerations: + # A) Do you expect your measurements to monotonically improve? + # If so, choose LAST_MEASUREMENT. On the other hand, if you're in a + # situation where your system can "over-train" and you expect the + # performance to get better for a while but then start declining, + # choose BEST_MEASUREMENT. + # B) Are your measurements significantly noisy and/or irreproducible? + # If so, BEST_MEASUREMENT will tend to be over-optimistic, and it + # may be better to choose LAST_MEASUREMENT. + # If both or neither of (A) and (B) apply, it doesn't matter which + # selection type is chosen. + module MeasurementSelectionType + # Will be treated as LAST_MEASUREMENT. + MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0 + + # Use the last measurement reported. + LAST_MEASUREMENT = 1 + + # Use the best measurement reported. + BEST_MEASUREMENT = 2 + end + end + + # A message representing a Measurement of a Trial. A Measurement contains + # the Metrics got by executing a Trial using suggested hyperparameter + # values. + # @!attribute [r] elapsed_duration + # @return [::Google::Protobuf::Duration] + # Output only. Time that the Trial has been running at the point of this + # Measurement. + # @!attribute [r] step_count + # @return [::Integer] + # Output only. The number of steps the machine learning model has been + # trained for. Must be non-negative. + # @!attribute [r] metrics + # @return [::Array<::Google::Cloud::AIPlatform::V1::Measurement::Metric>] + # Output only. A list of metrics got by evaluating the objective functions + # using suggested Parameter values. + class Measurement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message representing a metric in the measurement. + # @!attribute [r] metric_id + # @return [::String] + # Output only. The ID of the Metric. The Metric should be defined in + # [StudySpec's Metrics][google.cloud.aiplatform.v1.StudySpec.metrics]. + # @!attribute [r] value + # @return [::Float] + # Output only. The value for this metric. + class Metric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb new file mode 100644 index 000000000000..497f82c70379 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Tensorboard is a physical database that stores users' training metrics. + # A default Tensorboard is provided in each region of a Google Cloud project. + # If needed users can also create extra Tensorboards in their projects. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the Tensorboard. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @!attribute [rw] display_name + # @return [::String] + # Required. User provided name of this Tensorboard. + # @!attribute [rw] description + # @return [::String] + # Description of this Tensorboard. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a Tensorboard. If set, this + # Tensorboard and all sub-resources of this Tensorboard will be secured by + # this key. + # @!attribute [r] blob_storage_path_prefix + # @return [::String] + # Output only. Consumer project Cloud Storage path prefix used to store blob + # data, which can either be a bucket or directory. Does not end with a '/'. + # @!attribute [r] run_count + # @return [::Integer] + # Output only. The number of Runs stored in this Tensorboard. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Tensorboard was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this Tensorboard was last updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Tensorboards. + # + # 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. + # No more than 64 user labels can be associated with one Tensorboard + # (System labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] etag + # @return [::String] + # Used to perform a consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] is_default + # @return [::Boolean] + # Used to indicate if the TensorBoard instance is the default one. + # Each project & region can have at most one default TensorBoard instance. + # Creation of a default TensorBoard instance and updating an existing + # TensorBoard instance to be default will mark all other TensorBoard + # instances (if any) as non default. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class Tensorboard + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb new file mode 100644 index 000000000000..1fee10550150 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # All the data stored in a TensorboardTimeSeries. + # @!attribute [rw] tensorboard_time_series_id + # @return [::String] + # Required. The ID of the TensorboardTimeSeries, which will become the final + # component of the TensorboardTimeSeries' resource name + # @!attribute [rw] value_type + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::ValueType] + # Required. Immutable. The value type of this time series. All the values in + # this time series data must match this value type. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # Required. Data points in this time series. + class TimeSeriesData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A TensorboardTimeSeries data point. + # @!attribute [rw] scalar + # @return [::Google::Cloud::AIPlatform::V1::Scalar] + # A scalar value. + # @!attribute [rw] tensor + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTensor] + # A tensor value. + # @!attribute [rw] blobs + # @return [::Google::Cloud::AIPlatform::V1::TensorboardBlobSequence] + # A blob sequence value. + # @!attribute [rw] wall_time + # @return [::Google::Protobuf::Timestamp] + # Wall clock timestamp when this data point is generated by the end user. + # @!attribute [rw] step + # @return [::Integer] + # Step index of this data point within the run. + class TimeSeriesDataPoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One point viewable on a scalar metric plot. + # @!attribute [rw] value + # @return [::Float] + # Value of the point at this step / timestamp. + class Scalar + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One point viewable on a tensor metric plot. + # @!attribute [rw] value + # @return [::String] + # Required. Serialized form of + # https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto + # @!attribute [rw] version_number + # @return [::Integer] + # Optional. Version number of TensorProto used to serialize + # {::Google::Cloud::AIPlatform::V1::TensorboardTensor#value value}. + class TensorboardTensor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One point viewable on a blob metric plot, but mostly just a wrapper message + # to work around repeated fields can't be used directly within `oneof` fields. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardBlob>] + # List of blobs contained within the sequence. + class TensorboardBlobSequence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One blob (e.g, image, graph) viewable on a blob metric plot. + # @!attribute [r] id + # @return [::String] + # Output only. A URI safe key uniquely identifying a blob. Can be used to + # locate the blob stored in the Cloud Storage bucket of the consumer project. + # @!attribute [rw] data + # @return [::String] + # Optional. The bytes of the blob is not present unless it's returned by the + # ReadTensorboardBlobData endpoint. + class TensorboardBlob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb new file mode 100644 index 000000000000..aba10508d49e --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # A TensorboardExperiment is a group of TensorboardRuns, that are typically the + # results of a training job run, in a Tensorboard. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the TensorboardExperiment. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @!attribute [rw] display_name + # @return [::String] + # User provided name of this TensorboardExperiment. + # @!attribute [rw] description + # @return [::String] + # Description of this TensorboardExperiment. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardExperiment was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardExperiment was last updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your + # TensorboardExperiment. + # + # Label keys and values cannot be longer than 64 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # No more than 64 user labels can be associated with one Dataset (System + # labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with `aiplatform.googleapis.com/` + # and are immutable. The following system labels exist for each Dataset: + # + # * `aiplatform.googleapis.com/dataset_metadata_schema`: output only. Its + # value is the + # [metadata_schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] + # title. + # @!attribute [rw] etag + # @return [::String] + # Used to perform consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] source + # @return [::String] + # Immutable. Source of the TensorboardExperiment. Example: a custom training + # job. + class TensorboardExperiment + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb new file mode 100644 index 000000000000..14e47fdb129b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # TensorboardRun maps to a specific execution of a training job with a given + # set of hyperparameter values, model definition, dataset, etc + # @!attribute [r] name + # @return [::String] + # Output only. Name of the TensorboardRun. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @!attribute [rw] display_name + # @return [::String] + # Required. User provided name of this TensorboardRun. + # This value must be unique among all TensorboardRuns + # belonging to the same parent TensorboardExperiment. + # @!attribute [rw] description + # @return [::String] + # Description of this TensorboardRun. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardRun was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardRun was last updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your TensorboardRuns. + # + # This field will be used to filter and visualize Runs in the Tensorboard UI. + # For example, a Vertex AI training job can set a label + # aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created + # within that job. An end user can set a label experiment_id=xxxxx for all + # the runs produced in a Jupyter notebook. These runs can be grouped by a + # label value and visualized together in the Tensorboard UI. + # + # 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. + # No more than 64 user labels can be associated with one TensorboardRun + # (System labels are excluded). + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # System reserved label keys are prefixed with "aiplatform.googleapis.com/" + # and are immutable. + # @!attribute [rw] etag + # @return [::String] + # Used to perform a consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + class TensorboardRun + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb new file mode 100644 index 000000000000..c23393614662 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb @@ -0,0 +1,825 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard TensorboardService.CreateTensorboard}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the Tensorboard in. + # Format: `projects/{project}/locations/{location}` + # @!attribute [rw] tensorboard + # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] + # Required. The Tensorboard to create. + class CreateTensorboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard TensorboardService.GetTensorboard}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + class GetTensorboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list Tensorboards. + # Format: + # `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Lists the Tensorboards that match the filter expression. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Tensorboards to return. The service may return + # fewer than this value. If unspecified, at most 100 Tensorboards are + # returned. The maximum value is 100; values above 100 are coerced to + # 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # Field to use to sort the list. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListTensorboardsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards}. + # @!attribute [rw] tensorboards + # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensorboard>] + # The Tensorboards mathching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest#page_token ListTensorboardsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListTensorboardsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard TensorboardService.UpdateTensorboard}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Tensorboard resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @!attribute [rw] tensorboard + # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] + # Required. The Tensorboard's `name` field is used to identify the + # Tensorboard to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + class UpdateTensorboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard TensorboardService.DeleteTensorboard}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Tensorboard to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + class DeleteTensorboardRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_usage TensorboardService.ReadTensorboardUsage}. + # @!attribute [rw] tensorboard + # @return [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + class ReadTensorboardUsageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_usage TensorboardService.ReadTensorboardUsage}. + # @!attribute [rw] monthly_usage_data + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerMonthUsageData}] + # Maps year-month (YYYYMM) string to per month usage data. + class ReadTensorboardUsageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Per user usage data. + # @!attribute [rw] username + # @return [::String] + # User's username + # @!attribute [rw] view_count + # @return [::Integer] + # Number of times the user has read data within the Tensorboard. + class PerUserUsageData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Per month usage data + # @!attribute [rw] user_usage_data + # @return [::Array<::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerUserUsageData>] + # Usage data for each user in the given month. + class PerMonthUsageData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerMonthUsageData] + class MonthlyUsageDataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_size TensorboardService.ReadTensorboardSize}. + # @!attribute [rw] tensorboard + # @return [::String] + # Required. The name of the Tensorboard resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + class ReadTensorboardSizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_size TensorboardService.ReadTensorboardSize}. + # @!attribute [rw] storage_size_byte + # @return [::Integer] + # Payload storage size for the TensorBoard + class ReadTensorboardSizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_experiment TensorboardService.CreateTensorboardExperiment}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Tensorboard to create the + # TensorboardExperiment in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @!attribute [rw] tensorboard_experiment + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # The TensorboardExperiment to create. + # @!attribute [rw] tensorboard_experiment_id + # @return [::String] + # Required. The ID to use for the Tensorboard experiment, which becomes the + # final component of the Tensorboard experiment's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + class CreateTensorboardExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_experiment TensorboardService.GetTensorboardExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardExperiment resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + class GetTensorboardExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Tensorboard to list + # TensorboardExperiments. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + # @!attribute [rw] filter + # @return [::String] + # Lists the TensorboardExperiments that match the filter expression. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of TensorboardExperiments to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardExperiments are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # Field to use to sort the list. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListTensorboardExperimentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments}. + # @!attribute [rw] tensorboard_experiments + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] + # The TensorboardExperiments mathching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest#page_token ListTensorboardExperimentsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListTensorboardExperimentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_experiment TensorboardService.UpdateTensorboardExperiment}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardExperiment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @!attribute [rw] tensorboard_experiment + # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] + # Required. The TensorboardExperiment's `name` field is used to identify the + # TensorboardExperiment to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + class UpdateTensorboardExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_experiment TensorboardService.DeleteTensorboardExperiment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardExperiment to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + class DeleteTensorboardExperimentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_runs TensorboardService.BatchCreateTensorboardRuns}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardExperiment to create the + # TensorboardRuns in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The parent field in the CreateTensorboardRunRequest messages must match + # this field. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest>] + # Required. The request message specifying the TensorboardRuns to create. + # A maximum of 1000 TensorboardRuns can be created in a batch. + class BatchCreateTensorboardRunsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_runs TensorboardService.BatchCreateTensorboardRuns}. + # @!attribute [rw] tensorboard_runs + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # The created TensorboardRuns. + class BatchCreateTensorboardRunsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_run TensorboardService.CreateTensorboardRun}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardExperiment to create the + # TensorboardRun in. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @!attribute [rw] tensorboard_run + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # Required. The TensorboardRun to create. + # @!attribute [rw] tensorboard_run_id + # @return [::String] + # Required. The ID to use for the Tensorboard run, which becomes the final + # component of the Tensorboard run's resource name. + # + # This value should be 1-128 characters, and valid characters + # are `/[a-z][0-9]-/`. + class CreateTensorboardRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_run TensorboardService.GetTensorboardRun}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardRun resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + class GetTensorboardRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_blob_data TensorboardService.ReadTensorboardBlobData}. + # @!attribute [rw] time_series + # @return [::String] + # Required. The resource name of the TensorboardTimeSeries to list Blobs. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @!attribute [rw] blob_ids + # @return [::Array<::String>] + # IDs of the blobs to read. + class ReadTensorboardBlobDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_blob_data TensorboardService.ReadTensorboardBlobData}. + # @!attribute [rw] blobs + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardBlob>] + # Blob messages containing blob bytes. + class ReadTensorboardBlobDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardExperiment to list + # TensorboardRuns. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @!attribute [rw] filter + # @return [::String] + # Lists the TensorboardRuns that match the filter expression. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of TensorboardRuns to return. The service may return + # fewer than this value. If unspecified, at most 50 TensorboardRuns are + # returned. The maximum value is 1000; values above 1000 are coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # Field to use to sort the list. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListTensorboardRunsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns}. + # @!attribute [rw] tensorboard_runs + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardRun>] + # The TensorboardRuns mathching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest#page_token ListTensorboardRunsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListTensorboardRunsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_run TensorboardService.UpdateTensorboardRun}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardRun resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @!attribute [rw] tensorboard_run + # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] + # Required. The TensorboardRun's `name` field is used to identify the + # TensorboardRun to be updated. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + class UpdateTensorboardRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_run TensorboardService.DeleteTensorboardRun}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardRun to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + class DeleteTensorboardRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_time_series TensorboardService.BatchCreateTensorboardTimeSeries}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardExperiment to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # The TensorboardRuns referenced by the parent fields in the + # CreateTensorboardTimeSeriesRequest messages must be sub resources of this + # TensorboardExperiment. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest>] + # Required. The request message specifying the TensorboardTimeSeries to + # create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. + class BatchCreateTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_time_series TensorboardService.BatchCreateTensorboardTimeSeries}. + # @!attribute [rw] tensorboard_time_series + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # The created TensorboardTimeSeries. + class BatchCreateTensorboardTimeSeriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_time_series TensorboardService.CreateTensorboardTimeSeries}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardRun to create the + # TensorboardTimeSeries in. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @!attribute [rw] tensorboard_time_series_id + # @return [::String] + # Optional. The user specified unique ID to use for the + # TensorboardTimeSeries, which becomes the final component of the + # TensorboardTimeSeries's resource name. This value should match + # "[a-z0-9][a-z0-9-]\\{0, 127}" + # @!attribute [rw] tensorboard_time_series + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # Required. The TensorboardTimeSeries to create. + class CreateTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_time_series TensorboardService.GetTensorboardTimeSeries}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardTimeSeries resource. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + class GetTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TensorboardRun to list + # TensorboardTimeSeries. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @!attribute [rw] filter + # @return [::String] + # Lists the TensorboardTimeSeries that match the filter expression. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of TensorboardTimeSeries to return. The service may + # return fewer than this value. If unspecified, at most 50 + # TensorboardTimeSeries are returned. The maximum value is 1000; values + # above 1000 are coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # Field to use to sort the list. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Mask specifying which fields to read. + class ListTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries}. + # @!attribute [rw] tensorboard_time_series + # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] + # The TensorboardTimeSeries mathching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest#page_token ListTensorboardTimeSeriesRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListTensorboardTimeSeriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_time_series TensorboardService.UpdateTensorboardTimeSeries}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # TensorboardTimeSeries resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field is overwritten if it's in the mask. If the + # user does not provide a mask then all fields are overwritten if new + # values are specified. + # @!attribute [rw] tensorboard_time_series + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] + # Required. The TensorboardTimeSeries' `name` field is used to identify the + # TensorboardTimeSeries to be updated. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + class UpdateTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_time_series TensorboardService.DeleteTensorboardTimeSeries}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TensorboardTimeSeries to be deleted. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + class DeleteTensorboardTimeSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_read_tensorboard_time_series_data TensorboardService.BatchReadTensorboardTimeSeriesData}. + # @!attribute [rw] tensorboard + # @return [::String] + # Required. The resource name of the Tensorboard containing + # TensorboardTimeSeries to read data from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + # The TensorboardTimeSeries referenced by + # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest#time_series time_series} + # must be sub resources of this Tensorboard. + # @!attribute [rw] time_series + # @return [::Array<::String>] + # Required. The resource names of the TensorboardTimeSeries to read data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + class BatchReadTensorboardTimeSeriesDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_read_tensorboard_time_series_data TensorboardService.BatchReadTensorboardTimeSeriesData}. + # @!attribute [rw] time_series_data + # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData>] + # The returned time series data. + class BatchReadTensorboardTimeSeriesDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_time_series_data TensorboardService.ReadTensorboardTimeSeriesData}. + # @!attribute [rw] tensorboard_time_series + # @return [::String] + # Required. The resource name of the TensorboardTimeSeries to read data from. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @!attribute [rw] max_data_points + # @return [::Integer] + # The maximum number of TensorboardTimeSeries' data to return. + # + # This value should be a positive integer. + # This value can be set to -1 to return all data. + # @!attribute [rw] filter + # @return [::String] + # Reads the TensorboardTimeSeries' data that match the filter expression. + class ReadTensorboardTimeSeriesDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_time_series_data TensorboardService.ReadTensorboardTimeSeriesData}. + # @!attribute [rw] time_series_data + # @return [::Google::Cloud::AIPlatform::V1::TimeSeriesData] + # The returned time series data. + class ReadTensorboardTimeSeriesDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_experiment_data TensorboardService.WriteTensorboardExperimentData}. + # @!attribute [rw] tensorboard_experiment + # @return [::String] + # Required. The resource name of the TensorboardExperiment to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + # @!attribute [rw] write_run_data_requests + # @return [::Array<::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest>] + # Required. Requests containing per-run TensorboardTimeSeries data to write. + class WriteTensorboardExperimentDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_experiment_data TensorboardService.WriteTensorboardExperimentData}. + class WriteTensorboardExperimentDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_run_data TensorboardService.WriteTensorboardRunData}. + # @!attribute [rw] tensorboard_run + # @return [::String] + # Required. The resource name of the TensorboardRun to write data to. + # Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + # @!attribute [rw] time_series_data + # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData>] + # Required. The TensorboardTimeSeries data to write. + # Values with in a time series are indexed by their step value. + # Repeated writes to the same step will overwrite the existing value for that + # step. + # The upper limit of data points per write request is 5000. + class WriteTensorboardRunDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_run_data TensorboardService.WriteTensorboardRunData}. + class WriteTensorboardRunDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data TensorboardService.ExportTensorboardTimeSeriesData}. + # @!attribute [rw] tensorboard_time_series + # @return [::String] + # Required. The resource name of the TensorboardTimeSeries to export data + # from. Format: + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + # @!attribute [rw] filter + # @return [::String] + # Exports the TensorboardTimeSeries' data that match the filter expression. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of data points to return per page. + # The default page_size is 1000. Values must be between 1 and 10000. + # Values above 10000 are coerced to 10000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} + # must match the call that provided the page token. + # @!attribute [rw] order_by + # @return [::String] + # Field to use to sort the TensorboardTimeSeries' data. + # By default, TensorboardTimeSeries' data is returned in a pseudo random + # order. + class ExportTensorboardTimeSeriesDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data TensorboardService.ExportTensorboardTimeSeriesData}. + # @!attribute [rw] time_series_data_points + # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] + # The returned time series data points. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest#page_token page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ExportTensorboardTimeSeriesDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform create Tensorboard. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Tensorboard. + class CreateTensorboardOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of operations that perform update Tensorboard. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # Operation metadata for Tensorboard. + class UpdateTensorboardOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb new file mode 100644 index 000000000000..3eab80f429bd --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # TensorboardTimeSeries maps to times series produced in training runs + # @!attribute [r] name + # @return [::String] + # Output only. Name of the TensorboardTimeSeries. + # @!attribute [rw] display_name + # @return [::String] + # Required. User provided name of this TensorboardTimeSeries. + # This value should be unique among all TensorboardTimeSeries resources + # belonging to the same TensorboardRun resource (parent resource). + # @!attribute [rw] description + # @return [::String] + # Description of this TensorboardTimeSeries. + # @!attribute [rw] value_type + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::ValueType] + # Required. Immutable. Type of TensorboardTimeSeries value. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardTimeSeries was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this TensorboardTimeSeries was last updated. + # @!attribute [rw] etag + # @return [::String] + # Used to perform a consistent read-modify-write updates. If not set, a blind + # "overwrite" update happens. + # @!attribute [rw] plugin_name + # @return [::String] + # Immutable. Name of the plugin this time series pertain to. Such as Scalar, + # Tensor, Blob + # @!attribute [rw] plugin_data + # @return [::String] + # Data of the current plugin, with the size limited to 65KB. + # @!attribute [r] metadata + # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::Metadata] + # Output only. Scalar, Tensor, or Blob metadata for this + # TensorboardTimeSeries. + class TensorboardTimeSeries + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes metadata for a TensorboardTimeSeries. + # @!attribute [r] max_step + # @return [::Integer] + # Output only. Max step index of all data points within a + # TensorboardTimeSeries. + # @!attribute [r] max_wall_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Max wall clock timestamp of all data points within a + # TensorboardTimeSeries. + # @!attribute [r] max_blob_sequence_length + # @return [::Integer] + # Output only. The largest blob sequence length (number of blobs) of all + # data points in this time series, if its ValueType is BLOB_SEQUENCE. + class Metadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An enum representing the value type of a TensorboardTimeSeries. + module ValueType + # The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0 + + # Used for TensorboardTimeSeries that is a list of scalars. + # E.g. accuracy of a model over epochs/time. + SCALAR = 1 + + # Used for TensorboardTimeSeries that is a list of tensors. + # E.g. histograms of weights of layer in a model over epoch/time. + TENSOR = 2 + + # Used for TensorboardTimeSeries that is a list of blob sequences. + # E.g. set of sample images with labels over epochs/time. + BLOB_SEQUENCE = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb new file mode 100644 index 000000000000..f7a6134c7749 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Tool details that the model may use to generate response. + # + # A `Tool` is a piece of code that enables the system to interact with + # external systems to perform an action, or set of actions, outside of + # knowledge and scope of the model. A Tool object should contain exactly + # one type of Tool (e.g FunctionDeclaration, Retrieval or + # GoogleSearchRetrieval). + # @!attribute [rw] function_declarations + # @return [::Array<::Google::Cloud::AIPlatform::V1::FunctionDeclaration>] + # Optional. Function tool type. + # One or more function declarations to be passed to the model along with the + # current user query. Model may decide to call a subset of these functions + # by populating [FunctionCall][content.part.function_call] in the response. + # User should provide a [FunctionResponse][content.part.function_response] + # for each function call in the next turn. Based on the function responses, + # Model will generate the final response back to the user. + # Maximum 128 function declarations can be provided. + # @!attribute [rw] retrieval + # @return [::Google::Cloud::AIPlatform::V1::Retrieval] + # Optional. Retrieval tool type. + # System will always execute the provided retrieval tool(s) to get external + # knowledge to answer the prompt. Retrieval results are presented to the + # model for generation. + # @!attribute [rw] google_search_retrieval + # @return [::Google::Cloud::AIPlatform::V1::GoogleSearchRetrieval] + # Optional. GoogleSearchRetrieval tool type. + # Specialized retrieval tool that is powered by Google search. + class Tool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Structured representation of a function declaration as defined by the + # [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included + # in this declaration are the function name, description, parameters and + # response type. This FunctionDeclaration is a representation of a block of + # code that can be used as a `Tool` by the model and executed by the client. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the function to call. + # Must start with a letter or an underscore. + # Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a + # maximum length of 64. + # @!attribute [rw] description + # @return [::String] + # Optional. Description and purpose of the function. + # Model uses it to decide how and whether to call the function. + # @!attribute [rw] parameters + # @return [::Google::Cloud::AIPlatform::V1::Schema] + # Optional. Describes the parameters to this function in JSON Schema Object + # format. Reflects the Open API 3.03 Parameter Object. string Key: the name + # of the parameter. Parameter names are case sensitive. Schema Value: the + # Schema defining the type used for the parameter. For function with no + # parameters, this can be left unset. Parameter names must start with a + # letter or an underscore and must only contain chars a-z, A-Z, 0-9, or + # underscores with a maximum length of 64. Example with 1 required and 1 + # optional parameter: type: OBJECT properties: + # param1: + # type: STRING + # param2: + # type: INTEGER + # required: + # - param1 + # @!attribute [rw] response + # @return [::Google::Cloud::AIPlatform::V1::Schema] + # Optional. Describes the output from this function in JSON Schema format. + # Reflects the Open API 3.03 Response Object. The Schema defines the type + # used for the response value of the function. + class FunctionDeclaration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A predicted [FunctionCall] returned from the model that contains a string + # representing the [FunctionDeclaration.name] and a structured JSON object + # containing the parameters and their values. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the function to call. + # Matches [FunctionDeclaration.name]. + # @!attribute [rw] args + # @return [::Google::Protobuf::Struct] + # Optional. Required. The function parameters and values in JSON object + # format. See [FunctionDeclaration.parameters] for parameter details. + class FunctionCall + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result output from a [FunctionCall] that contains a string representing + # the [FunctionDeclaration.name] and a structured JSON object containing any + # output from the function is used as context to the model. This should contain + # the result of a [FunctionCall] made based on model prediction. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the function to call. + # Matches [FunctionDeclaration.name] and [FunctionCall.name]. + # @!attribute [rw] response + # @return [::Google::Protobuf::Struct] + # Required. The function response in JSON object format. + # Use "output" key to specify function output and "error" key to specify + # error details (if any). If "output" and "error" keys are not specified, + # then whole "response" is treated as function output. + class FunctionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines a retrieval tool that model can call to access external knowledge. + # @!attribute [rw] vertex_ai_search + # @return [::Google::Cloud::AIPlatform::V1::VertexAISearch] + # Set to use data source powered by Vertex AI Search. + # @!attribute [rw] vertex_rag_store + # @return [::Google::Cloud::AIPlatform::V1::VertexRagStore] + # Set to use data source powered by Vertex RAG store. + # User data is uploaded via the VertexRagDataService. + # @!attribute [rw] disable_attribution + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Deprecated. This option is no longer supported. + class Retrieval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieve from Vertex RAG Store for grounding. + # @!attribute [rw] rag_resources + # @return [::Array<::Google::Cloud::AIPlatform::V1::VertexRagStore::RagResource>] + # Optional. The representation of the rag source. It can be used to specify + # corpus only or ragfiles. Currently only support one corpus or multiple + # files from one corpus. In the future we may open up multiple corpora + # support. + # @!attribute [rw] similarity_top_k + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Optional. Number of top k results to return from the selected corpora. + # @!attribute [rw] vector_distance_threshold + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Float] + # Optional. Only return results with vector distance smaller than the + # threshold. + # @!attribute [rw] rag_retrieval_config + # @return [::Google::Cloud::AIPlatform::V1::RagRetrievalConfig] + # Optional. The retrieval config for the Rag query. + class VertexRagStore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The definition of the Rag resource. + # @!attribute [rw] rag_corpus + # @return [::String] + # Optional. RagCorpora resource name. + # Format: + # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + # @!attribute [rw] rag_file_ids + # @return [::Array<::String>] + # Optional. rag_file_id. The files should be in the same rag_corpus set in + # rag_corpus field. + class RagResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Retrieve from Vertex AI Search datastore for grounding. + # See https://cloud.google.com/products/agent-builder + # @!attribute [rw] datastore + # @return [::String] + # Required. Fully-qualified Vertex AI Search data store resource ID. + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` + class VertexAISearch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tool to retrieve public web data for grounding, powered by Google. + # @!attribute [rw] dynamic_retrieval_config + # @return [::Google::Cloud::AIPlatform::V1::DynamicRetrievalConfig] + # Specifies the dynamic retrieval configuration for the given source. + class GoogleSearchRetrieval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the options to customize dynamic retrieval. + # @!attribute [rw] mode + # @return [::Google::Cloud::AIPlatform::V1::DynamicRetrievalConfig::Mode] + # The mode of the predictor to be used in dynamic retrieval. + # @!attribute [rw] dynamic_threshold + # @return [::Float] + # Optional. The threshold to be used in dynamic retrieval. + # If not set, a system default value is used. + class DynamicRetrievalConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mode of the predictor to be used in dynamic retrieval. + module Mode + # Always trigger retrieval. + MODE_UNSPECIFIED = 0 + + # Run retrieval only when system decides it is necessary. + MODE_DYNAMIC = 1 + end + end + + # Tool config. This config is shared for all tools provided in the request. + # @!attribute [rw] function_calling_config + # @return [::Google::Cloud::AIPlatform::V1::FunctionCallingConfig] + # Optional. Function calling config. + # @!attribute [rw] retrieval_config + # @return [::Google::Cloud::AIPlatform::V1::RetrievalConfig] + # Optional. Retrieval config. + class ToolConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Function calling config. + # @!attribute [rw] mode + # @return [::Google::Cloud::AIPlatform::V1::FunctionCallingConfig::Mode] + # Optional. Function calling mode. + # @!attribute [rw] allowed_function_names + # @return [::Array<::String>] + # Optional. Function names to call. Only set when the Mode is ANY. Function + # names should match [FunctionDeclaration.name]. With mode set to ANY, model + # will predict a function call from the set of function names provided. + class FunctionCallingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Function calling mode. + module Mode + # Unspecified function calling mode. This value should not be used. + MODE_UNSPECIFIED = 0 + + # Default model behavior, model decides to predict either a function call + # or a natural language response. + AUTO = 1 + + # Model is constrained to always predicting a function call only. + # If "allowed_function_names" are set, the predicted function call will be + # limited to any one of "allowed_function_names", else the predicted + # function call will be any one of the provided "function_declarations". + ANY = 2 + + # Model will not predict any function call. Model behavior is same as when + # not passing any function declarations. + NONE = 3 + end + end + + # Retrieval config. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # The location of the user. + # @!attribute [rw] language_code + # @return [::String] + # The language code of the user. + class RetrievalConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the context retrieval config. + # @!attribute [rw] top_k + # @return [::Integer] + # Optional. The number of contexts to retrieve. + # @!attribute [rw] filter + # @return [::Google::Cloud::AIPlatform::V1::RagRetrievalConfig::Filter] + # Optional. Config for filters. + class RagRetrievalConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Config for filters. + # @!attribute [rw] vector_distance_threshold + # @return [::Float] + # Optional. Only returns contexts with vector distance smaller than the + # threshold. + # @!attribute [rw] vector_similarity_threshold + # @return [::Float] + # Optional. Only returns contexts with vector similarity larger than the + # threshold. + # @!attribute [rw] metadata_filter + # @return [::String] + # Optional. String for metadata filtering. + class Filter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb new file mode 100644 index 000000000000..770872b8e9ba --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # The TrainingPipeline orchestrates tasks associated with training a Model. It + # always executes the training task, and optionally may also + # export data from Vertex AI's Dataset which becomes the training input, + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model upload} the Model to + # Vertex AI, and evaluate the Model. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the TrainingPipeline. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user-defined name of this TrainingPipeline. + # @!attribute [rw] input_data_config + # @return [::Google::Cloud::AIPlatform::V1::InputDataConfig] + # Specifies Vertex AI owned input data that may be used for training the + # Model. The TrainingPipeline's + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} + # should make clear whether this config is used and if there are any special + # requirements on how it should be filled. If nothing about this config is + # mentioned in the + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}, + # then it should be assumed that the TrainingPipeline does not depend on this + # configuration. + # @!attribute [rw] training_task_definition + # @return [::String] + # Required. A Google Cloud Storage path to the YAML file that defines the + # training task which is responsible for producing the model artifact, and + # may also include additional auxiliary work. The definition files that can + # be used here are found in + # gs://google-cloud-aiplatform/schema/trainingjob/definition/. + # Note: The URI given on output will be immutable and probably different, + # including the URI scheme, than the one given on input. The output URI will + # point to a location where the user only has a read access. + # @!attribute [rw] training_task_inputs + # @return [::Google::Protobuf::Value] + # Required. The training task's parameter(s), as specified in the + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}'s + # `inputs`. + # @!attribute [r] training_task_metadata + # @return [::Google::Protobuf::Value] + # Output only. The metadata information as specified in the + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}'s + # `metadata`. This metadata is an auxiliary runtime and final information + # about the training task. While the pipeline is running this information is + # populated only at a best effort basis. Only present if the + # pipeline's + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} + # contains `metadata` object. + # @!attribute [rw] model_to_upload + # @return [::Google::Cloud::AIPlatform::V1::Model] + # Describes the Model that may be uploaded (via + # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel}) + # by this TrainingPipeline. The TrainingPipeline's + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} + # should make clear whether this Model description should be populated, and + # if there are any special requirements regarding how it should be filled. If + # nothing is mentioned in the + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}, + # then it should be assumed that this field should not be filled and the + # training task either uploads the Model without a need of this information, + # or that training task does not support uploading a Model as part of the + # pipeline. When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and + # the trained Model had been uploaded into Vertex AI, then the + # model_to_upload's resource {::Google::Cloud::AIPlatform::V1::Model#name name} is + # populated. The Model is always uploaded into the Project and Location in + # which this pipeline is. + # @!attribute [rw] model_id + # @return [::String] + # Optional. The ID to use for the uploaded Model, which will become the final + # component of the model resource name. + # + # This value may be up to 63 characters, and valid characters are + # `[a-z0-9_-]`. The first character cannot be a number or hyphen. + # @!attribute [rw] parent_model + # @return [::String] + # Optional. When specify this field, the `model_to_upload` will not be + # uploaded as a new model, instead, it will become a new version of this + # `parent_model`. + # @!attribute [r] state + # @return [::Google::Cloud::AIPlatform::V1::PipelineState] + # Output only. The detailed state of the pipeline. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only populated when the pipeline's state is + # `PIPELINE_STATE_FAILED` or `PIPELINE_STATE_CANCELLED`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the TrainingPipeline was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the TrainingPipeline for the first time entered the + # `PIPELINE_STATE_RUNNING` state. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the TrainingPipeline entered any of the following + # states: `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, + # `PIPELINE_STATE_CANCELLED`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the TrainingPipeline was most recently updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize TrainingPipelines. + # + # 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] encryption_spec + # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] + # Customer-managed encryption key spec for a TrainingPipeline. If set, this + # TrainingPipeline will be secured by this key. + # + # Note: Model trained by this TrainingPipeline is also secured by this key if + # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#encryption_spec model_to_upload} + # is not set separately. + class TrainingPipeline + 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 + + # Specifies Vertex AI owned input data to be used for training, and + # possibly evaluating, the Model. + # @!attribute [rw] fraction_split + # @return [::Google::Cloud::AIPlatform::V1::FractionSplit] + # Split based on fractions defining the size of each set. + # @!attribute [rw] filter_split + # @return [::Google::Cloud::AIPlatform::V1::FilterSplit] + # Split based on the provided filters for each set. + # @!attribute [rw] predefined_split + # @return [::Google::Cloud::AIPlatform::V1::PredefinedSplit] + # Supported only for tabular Datasets. + # + # Split based on a predefined key. + # @!attribute [rw] timestamp_split + # @return [::Google::Cloud::AIPlatform::V1::TimestampSplit] + # Supported only for tabular Datasets. + # + # Split based on the timestamp of the input data pieces. + # @!attribute [rw] stratified_split + # @return [::Google::Cloud::AIPlatform::V1::StratifiedSplit] + # Supported only for tabular Datasets. + # + # Split based on the distribution of the specified column. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] + # The Cloud Storage location where the training data is to be + # written to. In the given directory a new directory is created with + # name: + # `dataset---` + # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + # All training input data is written into that directory. + # + # The Vertex AI environment variables representing Cloud Storage + # data URIs are represented in the Cloud Storage wildcard + # format to support sharded data. e.g.: "gs://.../training-*.jsonl" + # + # * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data + # * AIP_TRAINING_DATA_URI = + # "gcs_destination/dataset---
- # - # If not specified, then results are exported to the following auto-created - # BigQuery table: - # :export_evaluated_examples__.evaluated_examples - # @!attribute [rw] override_existing_table - # @return [::Boolean] - # If true and an export destination is specified, then the contents of the - # destination are overwritten. Otherwise, if the export destination already - # exists, then the export operation fails. - class ExportEvaluatedDataItemsConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb deleted file mode 100644 index 07bb6eb9eeeb..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/service_networking.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # PSC config that is used to automatically create forwarding rule via - # ServiceConnectionMap. - # @!attribute [rw] project_id - # @return [::String] - # Required. Project id used to create forwarding rule. - # @!attribute [rw] network - # @return [::String] - # Required. The full name of the Google Compute Engine - # [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). - # [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - # `projects/{project}/global/networks/{network}`. - # Where \\{project} is a project number, as in '12345', and \\{network} is - # network name. - class PSCAutomationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents configuration for private service connect. - # @!attribute [rw] enable_private_service_connect - # @return [::Boolean] - # Required. If true, expose the IndexEndpoint via private service connect. - # @!attribute [rw] project_allowlist - # @return [::Array<::String>] - # A list of Projects from which the forwarding rule will target the service - # attachment. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. The name of the generated service attachment resource. - # This is only populated if the endpoint is deployed with - # PrivateServiceConnect. - class PrivateServiceConnectConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PscAutomatedEndpoints defines the output of the forwarding rule - # automatically created by each PscAutomationConfig. - # @!attribute [rw] project_id - # @return [::String] - # Corresponding project_id in pscAutomationConfigs - # @!attribute [rw] network - # @return [::String] - # Corresponding network in pscAutomationConfigs. - # @!attribute [rw] match_address - # @return [::String] - # Ip Address created by the automated forwarding rule. - class PscAutomatedEndpoints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb deleted file mode 100644 index f864613b9844..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # SpecialistPool represents customers' own workforce to work on their data - # labeling jobs. It includes a group of specialist managers and workers. - # Managers are responsible for managing the workers in this pool as well as - # customers' data labeling jobs associated with this pool. Customers create - # specialist pool as well as start data labeling jobs on Cloud, managers and - # workers handle the jobs using CrowdCompute console. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the SpecialistPool. - # @!attribute [rw] display_name - # @return [::String] - # Required. The user-defined name of the SpecialistPool. - # The name can be up to 128 characters long and can consist of any UTF-8 - # characters. - # This field should be unique on project-level. - # @!attribute [r] specialist_managers_count - # @return [::Integer] - # Output only. The number of managers in this SpecialistPool. - # @!attribute [rw] specialist_manager_emails - # @return [::Array<::String>] - # The email addresses of the managers in the SpecialistPool. - # @!attribute [r] pending_data_labeling_jobs - # @return [::Array<::String>] - # Output only. The resource name of the pending data labeling jobs. - # @!attribute [rw] specialist_worker_emails - # @return [::Array<::String>] - # The email addresses of workers in the SpecialistPool. - class SpecialistPool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb deleted file mode 100644 index d0ff3c25c6e7..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # Request message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#create_specialist_pool SpecialistPoolService.CreateSpecialistPool}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent Project name for the new SpecialistPool. - # The form is `projects/{project}/locations/{location}`. - # @!attribute [rw] specialist_pool - # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] - # Required. The SpecialistPool to create. - class CreateSpecialistPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#create_specialist_pool SpecialistPoolService.CreateSpecialistPool}. - # @!attribute [rw] generic_metadata - # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] - # The operation generic information. - class CreateSpecialistPoolOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#get_specialist_pool SpecialistPoolService.GetSpecialistPool}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the SpecialistPool resource. - # The form is - # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - class GetSpecialistPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the SpecialistPool's parent resource. - # Format: `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # Typically obtained by - # {::Google::Cloud::AIPlatform::V1::ListSpecialistPoolsResponse#next_page_token ListSpecialistPoolsResponse.next_page_token} - # of the previous - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools} - # call. Return first page if empty. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Mask specifying which fields to read. FieldMask represents a set of - class ListSpecialistPoolsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools SpecialistPoolService.ListSpecialistPools}. - # @!attribute [rw] specialist_pools - # @return [::Array<::Google::Cloud::AIPlatform::V1::SpecialistPool>] - # A list of SpecialistPools that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListSpecialistPoolsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#delete_specialist_pool SpecialistPoolService.DeleteSpecialistPool}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the SpecialistPool to delete. Format: - # `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - # @!attribute [rw] force - # @return [::Boolean] - # If set to true, any specialist managers in this SpecialistPool will also be - # deleted. (Otherwise, the request will only work if the SpecialistPool has - # no specialist managers.) - class DeleteSpecialistPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#update_specialist_pool SpecialistPoolService.UpdateSpecialistPool}. - # @!attribute [rw] specialist_pool - # @return [::Google::Cloud::AIPlatform::V1::SpecialistPool] - # Required. The SpecialistPool which replaces the resource on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The update mask applies to the resource. - class UpdateSpecialistPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation metadata for - # {::Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#update_specialist_pool SpecialistPoolService.UpdateSpecialistPool}. - # @!attribute [r] specialist_pool - # @return [::String] - # Output only. The name of the SpecialistPool to which the specialists are - # being added. Format: - # `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` - # @!attribute [rw] generic_metadata - # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] - # The operation generic information. - class UpdateSpecialistPoolOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb deleted file mode 100644 index 7c8bd6e8dec0..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/study.rb +++ /dev/null @@ -1,731 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # A message representing a Study. - # @!attribute [r] name - # @return [::String] - # Output only. The name of a study. The study's globally unique identifier. - # Format: `projects/{project}/locations/{location}/studies/{study}` - # @!attribute [rw] display_name - # @return [::String] - # Required. Describes the Study, default value is empty string. - # @!attribute [rw] study_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec] - # Required. Configuration of the Study. - # @!attribute [r] state - # @return [::Google::Cloud::AIPlatform::V1::Study::State] - # Output only. The detailed state of a Study. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time at which the study was created. - # @!attribute [r] inactive_reason - # @return [::String] - # Output only. A human readable reason why the Study is inactive. - # This should be empty if a study is ACTIVE or COMPLETED. - class Study - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the Study state. - module State - # The study state is unspecified. - STATE_UNSPECIFIED = 0 - - # The study is active. - ACTIVE = 1 - - # The study is stopped due to an internal error. - INACTIVE = 2 - - # The study is done when the service exhausts the parameter search space - # or max_trial_count is reached. - COMPLETED = 3 - end - end - - # A message representing a Trial. A Trial contains a unique set of Parameters - # that has been or will be evaluated, along with the objective metrics got by - # running the Trial. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name of the Trial assigned by the service. - # @!attribute [r] id - # @return [::String] - # Output only. The identifier of the Trial assigned by the service. - # @!attribute [r] state - # @return [::Google::Cloud::AIPlatform::V1::Trial::State] - # Output only. The detailed state of the Trial. - # @!attribute [r] parameters - # @return [::Array<::Google::Cloud::AIPlatform::V1::Trial::Parameter>] - # Output only. The parameters of the Trial. - # @!attribute [r] final_measurement - # @return [::Google::Cloud::AIPlatform::V1::Measurement] - # Output only. The final measurement containing the objective value. - # @!attribute [r] measurements - # @return [::Array<::Google::Cloud::AIPlatform::V1::Measurement>] - # Output only. A list of measurements that are strictly lexicographically - # ordered by their induced tuples (steps, elapsed_duration). - # These are used for early stopping computations. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the Trial was started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the Trial's status changed to `SUCCEEDED` or - # `INFEASIBLE`. - # @!attribute [r] client_id - # @return [::String] - # Output only. The identifier of the client that originally requested this - # Trial. Each client is identified by a unique client_id. When a client asks - # for a suggestion, Vertex AI Vizier will assign it a Trial. The client - # should evaluate the Trial, complete it, and report back to Vertex AI - # Vizier. If suggestion is asked again by same client_id before the Trial is - # completed, the same Trial will be returned. Multiple clients with - # different client_ids can ask for suggestions simultaneously, each of them - # will get their own Trial. - # @!attribute [r] infeasible_reason - # @return [::String] - # Output only. A human readable string describing why the Trial is - # infeasible. This is set only if Trial state is `INFEASIBLE`. - # @!attribute [r] custom_job - # @return [::String] - # Output only. The CustomJob name linked to the Trial. - # It's set for a HyperparameterTuningJob's Trial. - # @!attribute [r] web_access_uris - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. URIs for accessing [interactive - # shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - # (one URI for each training node). Only available if this trial is part of - # a - # {::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob HyperparameterTuningJob} - # and the job's - # {::Google::Cloud::AIPlatform::V1::CustomJobSpec#enable_web_access trial_job_spec.enable_web_access} - # field is `true`. - # - # The keys are names of each node used for the trial; for example, - # `workerpool0-0` for the primary node, `workerpool1-0` for the first node in - # the second worker pool, and `workerpool1-1` for the second node in the - # second worker pool. - # - # The values are the URIs for each node's interactive shell. - class Trial - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message representing a parameter to be tuned. - # @!attribute [r] parameter_id - # @return [::String] - # Output only. The ID of the parameter. The parameter should be defined in - # [StudySpec's - # Parameters][google.cloud.aiplatform.v1.StudySpec.parameters]. - # @!attribute [r] value - # @return [::Google::Protobuf::Value] - # Output only. The value of the parameter. - # `number_value` will be set if a parameter defined in StudySpec is - # in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. - # `string_value` will be set if a parameter defined in StudySpec is - # in type 'CATEGORICAL'. - class Parameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class WebAccessUrisEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes a Trial state. - module State - # The Trial state is unspecified. - STATE_UNSPECIFIED = 0 - - # Indicates that a specific Trial has been requested, but it has not yet - # been suggested by the service. - REQUESTED = 1 - - # Indicates that the Trial has been suggested. - ACTIVE = 2 - - # Indicates that the Trial should stop according to the service. - STOPPING = 3 - - # Indicates that the Trial is completed successfully. - SUCCEEDED = 4 - - # Indicates that the Trial should not be attempted again. - # The service will set a Trial to INFEASIBLE when it's done but missing - # the final_measurement. - INFEASIBLE = 5 - end - end - - # @!attribute [rw] description - # @return [::String] - # A human-readable field which can store a description of this context. - # This will become part of the resulting Trial's description field. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::AIPlatform::V1::Trial::Parameter>] - # If/when a Trial is generated or selected from this Context, - # its Parameters will match any parameters specified here. - # (I.e. if this context specifies parameter name:'a' int_value:3, - # then a resulting Trial will have int_value:3 for its parameter named - # 'a'.) Note that we first attempt to match existing REQUESTED Trials with - # contexts, and if there are no matches, we generate suggestions in the - # subspace defined by the parameters specified here. - # NOTE: a Context without any Parameters matches the entire feasible search - # space. - class TrialContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time-based Constraint for Study - # @!attribute [rw] max_duration - # @return [::Google::Protobuf::Duration] - # Counts the wallclock time passed since the creation of this Study. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Compares the wallclock time to this time. Must use UTC timezone. - class StudyTimeConstraint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents specification of a Study. - # @!attribute [rw] decay_curve_stopping_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::DecayCurveAutomatedStoppingSpec] - # The automated early stopping spec using decay curve rule. - # @!attribute [rw] median_automated_stopping_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MedianAutomatedStoppingSpec] - # The automated early stopping spec using median rule. - # @!attribute [rw] convex_automated_stopping_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ConvexAutomatedStoppingSpec] - # The automated early stopping spec using convex stopping rule. - # @!attribute [rw] metrics - # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec>] - # Required. Metric specs for the Study. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec>] - # Required. The set of parameters to tune. - # @!attribute [rw] algorithm - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::Algorithm] - # The search algorithm specified for the Study. - # @!attribute [rw] observation_noise - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ObservationNoise] - # The observation noise level of the study. - # Currently only supported by the Vertex AI Vizier service. Not supported by - # HyperparameterTuningJob or TrainingPipeline. - # @!attribute [rw] measurement_selection_type - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MeasurementSelectionType] - # Describe which measurement selection type will be used - # @!attribute [rw] study_stopping_config - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::StudyStoppingConfig] - # Conditions for automated stopping of a Study. Enable automated stopping by - # configuring at least one condition. - class StudySpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a metric to optimize. - # @!attribute [rw] metric_id - # @return [::String] - # Required. The ID of the metric. Must not contain whitespaces and must be - # unique amongst all MetricSpecs. - # @!attribute [rw] goal - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec::GoalType] - # Required. The optimization goal of the metric. - # @!attribute [rw] safety_config - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::MetricSpec::SafetyMetricConfig] - # Used for safe search. In the case, the metric will be a safety - # metric. You must provide a separate metric for objective metric. - class MetricSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Used in safe optimization to specify threshold levels and risk tolerance. - # @!attribute [rw] safety_threshold - # @return [::Float] - # Safety threshold (boundary value between safe and unsafe). NOTE that if - # you leave SafetyMetricConfig unset, a default value of 0 will be used. - # @!attribute [rw] desired_min_safe_trials_fraction - # @return [::Float] - # Desired minimum fraction of safe trials (over total number of trials) - # that should be targeted by the algorithm at any time during the - # study (best effort). This should be between 0.0 and 1.0 and a value of - # 0.0 means that there is no minimum and an algorithm proceeds without - # targeting any specific fraction. A value of 1.0 means that the - # algorithm attempts to only Suggest safe Trials. - class SafetyMetricConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The available types of optimization goals. - module GoalType - # Goal Type will default to maximize. - GOAL_TYPE_UNSPECIFIED = 0 - - # Maximize the goal metric. - MAXIMIZE = 1 - - # Minimize the goal metric. - MINIMIZE = 2 - end - end - - # Represents a single parameter to optimize. - # @!attribute [rw] double_value_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::DoubleValueSpec] - # The value spec for a 'DOUBLE' parameter. - # @!attribute [rw] integer_value_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::IntegerValueSpec] - # The value spec for an 'INTEGER' parameter. - # @!attribute [rw] categorical_value_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::CategoricalValueSpec] - # The value spec for a 'CATEGORICAL' parameter. - # @!attribute [rw] discrete_value_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::DiscreteValueSpec] - # The value spec for a 'DISCRETE' parameter. - # @!attribute [rw] parameter_id - # @return [::String] - # Required. The ID of the parameter. Must not contain whitespaces and must - # be unique amongst all ParameterSpecs. - # @!attribute [rw] scale_type - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ScaleType] - # How the parameter should be scaled. - # Leave unset for `CATEGORICAL` parameters. - # @!attribute [rw] conditional_parameter_specs - # @return [::Array<::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec>] - # A conditional parameter node is active if the parameter's value matches - # the conditional node's parent_value_condition. - # - # If two items in conditional_parameter_specs have the same name, they - # must have disjoint parent_value_condition. - class ParameterSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Value specification for a parameter in `DOUBLE` type. - # @!attribute [rw] min_value - # @return [::Float] - # Required. Inclusive minimum value of the parameter. - # @!attribute [rw] max_value - # @return [::Float] - # Required. Inclusive maximum value of the parameter. - # @!attribute [rw] default_value - # @return [::Float] - # A default value for a `DOUBLE` parameter that is assumed to be a - # relatively good starting point. Unset value signals that there is no - # offered starting point. - # - # Currently only supported by the Vertex AI Vizier service. Not supported - # by HyperparameterTuningJob or TrainingPipeline. - class DoubleValueSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Value specification for a parameter in `INTEGER` type. - # @!attribute [rw] min_value - # @return [::Integer] - # Required. Inclusive minimum value of the parameter. - # @!attribute [rw] max_value - # @return [::Integer] - # Required. Inclusive maximum value of the parameter. - # @!attribute [rw] default_value - # @return [::Integer] - # A default value for an `INTEGER` parameter that is assumed to be a - # relatively good starting point. Unset value signals that there is no - # offered starting point. - # - # Currently only supported by the Vertex AI Vizier service. Not supported - # by HyperparameterTuningJob or TrainingPipeline. - class IntegerValueSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Value specification for a parameter in `CATEGORICAL` type. - # @!attribute [rw] values - # @return [::Array<::String>] - # Required. The list of possible categories. - # @!attribute [rw] default_value - # @return [::String] - # A default value for a `CATEGORICAL` parameter that is assumed to be a - # relatively good starting point. Unset value signals that there is no - # offered starting point. - # - # Currently only supported by the Vertex AI Vizier service. Not supported - # by HyperparameterTuningJob or TrainingPipeline. - class CategoricalValueSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Value specification for a parameter in `DISCRETE` type. - # @!attribute [rw] values - # @return [::Array<::Float>] - # Required. A list of possible values. - # The list should be in increasing order and at least 1e-10 apart. - # For instance, this parameter might have possible settings of 1.5, 2.5, - # and 4.0. This list should not contain more than 1,000 values. - # @!attribute [rw] default_value - # @return [::Float] - # A default value for a `DISCRETE` parameter that is assumed to be a - # relatively good starting point. Unset value signals that there is no - # offered starting point. It automatically rounds to the - # nearest feasible discrete point. - # - # Currently only supported by the Vertex AI Vizier service. Not supported - # by HyperparameterTuningJob or TrainingPipeline. - class DiscreteValueSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a parameter spec with condition from its parent parameter. - # @!attribute [rw] parent_discrete_values - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::DiscreteValueCondition] - # The spec for matching values from a parent parameter of - # `DISCRETE` type. - # @!attribute [rw] parent_int_values - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::IntValueCondition] - # The spec for matching values from a parent parameter of `INTEGER` - # type. - # @!attribute [rw] parent_categorical_values - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec::ConditionalParameterSpec::CategoricalValueCondition] - # The spec for matching values from a parent parameter of - # `CATEGORICAL` type. - # @!attribute [rw] parameter_spec - # @return [::Google::Cloud::AIPlatform::V1::StudySpec::ParameterSpec] - # Required. The spec for a conditional parameter. - class ConditionalParameterSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the spec to match discrete values from parent parameter. - # @!attribute [rw] values - # @return [::Array<::Float>] - # Required. Matches values of the parent parameter of 'DISCRETE' type. - # All values must exist in `discrete_value_spec` of parent parameter. - # - # The Epsilon of the value matching is 1e-10. - class DiscreteValueCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the spec to match integer values from parent parameter. - # @!attribute [rw] values - # @return [::Array<::Integer>] - # Required. Matches values of the parent parameter of 'INTEGER' type. - # All values must lie in `integer_value_spec` of parent parameter. - class IntValueCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the spec to match categorical values from parent parameter. - # @!attribute [rw] values - # @return [::Array<::String>] - # Required. Matches values of the parent parameter of 'CATEGORICAL' - # type. All values must exist in `categorical_value_spec` of parent - # parameter. - class CategoricalValueCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The type of scaling that should be applied to this parameter. - module ScaleType - # By default, no scaling is applied. - SCALE_TYPE_UNSPECIFIED = 0 - - # Scales the feasible space to (0, 1) linearly. - UNIT_LINEAR_SCALE = 1 - - # Scales the feasible space logarithmically to (0, 1). The entire - # feasible space must be strictly positive. - UNIT_LOG_SCALE = 2 - - # Scales the feasible space "reverse" logarithmically to (0, 1). The - # result is that values close to the top of the feasible space are spread - # out more than points near the bottom. The entire feasible space must be - # strictly positive. - UNIT_REVERSE_LOG_SCALE = 3 - end - end - - # The decay curve automated stopping rule builds a Gaussian Process - # Regressor to predict the final objective value of a Trial based on the - # already completed Trials and the intermediate measurements of the current - # Trial. Early stopping is requested for the current Trial if there is very - # low probability to exceed the optimal value found so far. - # @!attribute [rw] use_elapsed_duration - # @return [::Boolean] - # True if - # {::Google::Cloud::AIPlatform::V1::Measurement#elapsed_duration Measurement.elapsed_duration} - # is used as the x-axis of each Trials Decay Curve. Otherwise, - # {::Google::Cloud::AIPlatform::V1::Measurement#step_count Measurement.step_count} - # will be used as the x-axis. - class DecayCurveAutomatedStoppingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The median automated stopping rule stops a pending Trial if the Trial's - # best objective_value is strictly below the median 'performance' of all - # completed Trials reported up to the Trial's last measurement. - # Currently, 'performance' refers to the running average of the objective - # values reported by the Trial in each measurement. - # @!attribute [rw] use_elapsed_duration - # @return [::Boolean] - # True if median automated stopping rule applies on - # {::Google::Cloud::AIPlatform::V1::Measurement#elapsed_duration Measurement.elapsed_duration}. - # It means that elapsed_duration field of latest measurement of current - # Trial is used to compute median objective value for each completed - # Trials. - class MedianAutomatedStoppingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for ConvexAutomatedStoppingSpec. - # When there are enough completed trials (configured by - # min_measurement_count), for pending trials with enough measurements and - # steps, the policy first computes an overestimate of the objective value at - # max_num_steps according to the slope of the incomplete objective value - # curve. No prediction can be made if the curve is completely flat. If the - # overestimation is worse than the best objective value of the completed - # trials, this pending trial will be early-stopped, but a last measurement - # will be added to the pending trial with max_num_steps and predicted - # objective value from the autoregression model. - # @!attribute [rw] max_step_count - # @return [::Integer] - # Steps used in predicting the final objective for early stopped trials. In - # general, it's set to be the same as the defined steps in training / - # tuning. If not defined, it will learn it from the completed trials. When - # use_steps is false, this field is set to the maximum elapsed seconds. - # @!attribute [rw] min_step_count - # @return [::Integer] - # Minimum number of steps for a trial to complete. Trials which do not have - # a measurement with step_count > min_step_count won't be considered for - # early stopping. It's ok to set it to 0, and a trial can be early stopped - # at any stage. By default, min_step_count is set to be one-tenth of the - # max_step_count. - # When use_elapsed_duration is true, this field is set to the minimum - # elapsed seconds. - # @!attribute [rw] min_measurement_count - # @return [::Integer] - # The minimal number of measurements in a Trial. Early-stopping checks - # will not trigger if less than min_measurement_count+1 completed trials or - # pending trials with less than min_measurement_count measurements. If not - # defined, the default value is 5. - # @!attribute [rw] learning_rate_parameter_name - # @return [::String] - # The hyper-parameter name used in the tuning job that stands for learning - # rate. Leave it blank if learning rate is not in a parameter in tuning. - # The learning_rate is used to estimate the objective value of the ongoing - # trial. - # @!attribute [rw] use_elapsed_duration - # @return [::Boolean] - # This bool determines whether or not the rule is applied based on - # elapsed_secs or steps. If use_elapsed_duration==false, the early stopping - # decision is made according to the predicted objective values according to - # the target steps. If use_elapsed_duration==true, elapsed_secs is used - # instead of steps. Also, in this case, the parameters max_num_steps and - # min_num_steps are overloaded to contain max_elapsed_seconds and - # min_elapsed_seconds. - # @!attribute [rw] update_all_stopped_trials - # @return [::Boolean] - # ConvexAutomatedStoppingSpec by default only updates the trials that needs - # to be early stopped using a newly trained auto-regressive model. When - # this flag is set to True, all stopped trials from the beginning are - # potentially updated in terms of their `final_measurement`. Also, note - # that the training logic of autoregressive models is different in this - # case. Enabling this option has shown better results and this may be the - # default option in the future. - class ConvexAutomatedStoppingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration (stopping conditions) for automated stopping of a Study. - # Conditions include trial budgets, time budgets, and convergence detection. - # @!attribute [rw] should_stop_asap - # @return [::Google::Protobuf::BoolValue] - # If true, a Study enters STOPPING_ASAP whenever it would normally enters - # STOPPING state. - # - # The bottom line is: set to true if you want to interrupt on-going - # evaluations of Trials as soon as the study stopping condition is met. - # (Please see Study.State documentation for the source of truth). - # @!attribute [rw] minimum_runtime_constraint - # @return [::Google::Cloud::AIPlatform::V1::StudyTimeConstraint] - # Each "stopping rule" in this proto specifies an "if" condition. Before - # Vizier would generate a new suggestion, it first checks each specified - # stopping rule, from top to bottom in this list. - # Note that the first few rules (e.g. minimum_runtime_constraint, - # min_num_trials) will prevent other stopping rules from being evaluated - # until they are met. For example, setting `min_num_trials=5` and - # `always_stop_after= 1 hour` means that the Study will ONLY stop after it - # has 5 COMPLETED trials, even if more than an hour has passed since its - # creation. It follows the first applicable rule (whose "if" condition is - # satisfied) to make a stopping decision. If none of the specified rules - # are applicable, then Vizier decides that the study should not stop. - # If Vizier decides that the study should stop, the study enters - # STOPPING state (or STOPPING_ASAP if should_stop_asap = true). - # IMPORTANT: The automatic study state transition happens precisely as - # described above; that is, deleting trials or updating StudyConfig NEVER - # automatically moves the study state back to ACTIVE. If you want to - # _resume_ a Study that was stopped, 1) change the stopping conditions if - # necessary, 2) activate the study, and then 3) ask for suggestions. - # If the specified time or duration has not passed, do not stop the - # study. - # @!attribute [rw] maximum_runtime_constraint - # @return [::Google::Cloud::AIPlatform::V1::StudyTimeConstraint] - # If the specified time or duration has passed, stop the study. - # @!attribute [rw] min_num_trials - # @return [::Google::Protobuf::Int32Value] - # If there are fewer than this many COMPLETED trials, do not stop the - # study. - # @!attribute [rw] max_num_trials - # @return [::Google::Protobuf::Int32Value] - # If there are more than this many trials, stop the study. - # @!attribute [rw] max_num_trials_no_progress - # @return [::Google::Protobuf::Int32Value] - # If the objective value has not improved for this many consecutive - # trials, stop the study. - # - # WARNING: Effective only for single-objective studies. - # @!attribute [rw] max_duration_no_progress - # @return [::Google::Protobuf::Duration] - # If the objective value has not improved for this much time, stop the - # study. - # - # WARNING: Effective only for single-objective studies. - class StudyStoppingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The available search algorithms for the Study. - module Algorithm - # The default algorithm used by Vertex AI for [hyperparameter - # tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) - # and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). - ALGORITHM_UNSPECIFIED = 0 - - # Simple grid search within the feasible space. To use grid search, - # all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. - GRID_SEARCH = 2 - - # Simple random search within the feasible space. - RANDOM_SEARCH = 3 - end - - # Describes the noise level of the repeated observations. - # - # "Noisy" means that the repeated observations with the same Trial parameters - # may lead to different metric evaluations. - module ObservationNoise - # The default noise level chosen by Vertex AI. - OBSERVATION_NOISE_UNSPECIFIED = 0 - - # Vertex AI assumes that the objective function is (nearly) - # perfectly reproducible, and will never repeat the same Trial - # parameters. - LOW = 1 - - # Vertex AI will estimate the amount of noise in metric - # evaluations, it may repeat the same Trial parameters more than once. - HIGH = 2 - end - - # This indicates which measurement to use if/when the service automatically - # selects the final measurement from previously reported intermediate - # measurements. Choose this based on two considerations: - # A) Do you expect your measurements to monotonically improve? - # If so, choose LAST_MEASUREMENT. On the other hand, if you're in a - # situation where your system can "over-train" and you expect the - # performance to get better for a while but then start declining, - # choose BEST_MEASUREMENT. - # B) Are your measurements significantly noisy and/or irreproducible? - # If so, BEST_MEASUREMENT will tend to be over-optimistic, and it - # may be better to choose LAST_MEASUREMENT. - # If both or neither of (A) and (B) apply, it doesn't matter which - # selection type is chosen. - module MeasurementSelectionType - # Will be treated as LAST_MEASUREMENT. - MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0 - - # Use the last measurement reported. - LAST_MEASUREMENT = 1 - - # Use the best measurement reported. - BEST_MEASUREMENT = 2 - end - end - - # A message representing a Measurement of a Trial. A Measurement contains - # the Metrics got by executing a Trial using suggested hyperparameter - # values. - # @!attribute [r] elapsed_duration - # @return [::Google::Protobuf::Duration] - # Output only. Time that the Trial has been running at the point of this - # Measurement. - # @!attribute [r] step_count - # @return [::Integer] - # Output only. The number of steps the machine learning model has been - # trained for. Must be non-negative. - # @!attribute [r] metrics - # @return [::Array<::Google::Cloud::AIPlatform::V1::Measurement::Metric>] - # Output only. A list of metrics got by evaluating the objective functions - # using suggested Parameter values. - class Measurement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message representing a metric in the measurement. - # @!attribute [r] metric_id - # @return [::String] - # Output only. The ID of the Metric. The Metric should be defined in - # [StudySpec's Metrics][google.cloud.aiplatform.v1.StudySpec.metrics]. - # @!attribute [r] value - # @return [::Float] - # Output only. The value for this metric. - class Metric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb deleted file mode 100644 index 497f82c70379..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # Tensorboard is a physical database that stores users' training metrics. - # A default Tensorboard is provided in each region of a Google Cloud project. - # If needed users can also create extra Tensorboards in their projects. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the Tensorboard. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - # @!attribute [rw] display_name - # @return [::String] - # Required. User provided name of this Tensorboard. - # @!attribute [rw] description - # @return [::String] - # Description of this Tensorboard. - # @!attribute [rw] encryption_spec - # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] - # Customer-managed encryption key spec for a Tensorboard. If set, this - # Tensorboard and all sub-resources of this Tensorboard will be secured by - # this key. - # @!attribute [r] blob_storage_path_prefix - # @return [::String] - # Output only. Consumer project Cloud Storage path prefix used to store blob - # data, which can either be a bucket or directory. Does not end with a '/'. - # @!attribute [r] run_count - # @return [::Integer] - # Output only. The number of Runs stored in this Tensorboard. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this Tensorboard was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this Tensorboard was last updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels with user-defined metadata to organize your Tensorboards. - # - # 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. - # No more than 64 user labels can be associated with one Tensorboard - # (System labels are excluded). - # - # See https://goo.gl/xmQnxf for more information and examples of labels. - # System reserved label keys are prefixed with "aiplatform.googleapis.com/" - # and are immutable. - # @!attribute [rw] etag - # @return [::String] - # Used to perform a consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - # @!attribute [rw] is_default - # @return [::Boolean] - # Used to indicate if the TensorBoard instance is the default one. - # Each project & region can have at most one default TensorBoard instance. - # Creation of a default TensorBoard instance and updating an existing - # TensorBoard instance to be default will mark all other TensorBoard - # instances (if any) as non default. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. Reserved for future use. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. Reserved for future use. - class Tensorboard - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb deleted file mode 100644 index 1fee10550150..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_data.rb +++ /dev/null @@ -1,111 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # All the data stored in a TensorboardTimeSeries. - # @!attribute [rw] tensorboard_time_series_id - # @return [::String] - # Required. The ID of the TensorboardTimeSeries, which will become the final - # component of the TensorboardTimeSeries' resource name - # @!attribute [rw] value_type - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::ValueType] - # Required. Immutable. The value type of this time series. All the values in - # this time series data must match this value type. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] - # Required. Data points in this time series. - class TimeSeriesData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A TensorboardTimeSeries data point. - # @!attribute [rw] scalar - # @return [::Google::Cloud::AIPlatform::V1::Scalar] - # A scalar value. - # @!attribute [rw] tensor - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTensor] - # A tensor value. - # @!attribute [rw] blobs - # @return [::Google::Cloud::AIPlatform::V1::TensorboardBlobSequence] - # A blob sequence value. - # @!attribute [rw] wall_time - # @return [::Google::Protobuf::Timestamp] - # Wall clock timestamp when this data point is generated by the end user. - # @!attribute [rw] step - # @return [::Integer] - # Step index of this data point within the run. - class TimeSeriesDataPoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One point viewable on a scalar metric plot. - # @!attribute [rw] value - # @return [::Float] - # Value of the point at this step / timestamp. - class Scalar - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One point viewable on a tensor metric plot. - # @!attribute [rw] value - # @return [::String] - # Required. Serialized form of - # https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto - # @!attribute [rw] version_number - # @return [::Integer] - # Optional. Version number of TensorProto used to serialize - # {::Google::Cloud::AIPlatform::V1::TensorboardTensor#value value}. - class TensorboardTensor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One point viewable on a blob metric plot, but mostly just a wrapper message - # to work around repeated fields can't be used directly within `oneof` fields. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardBlob>] - # List of blobs contained within the sequence. - class TensorboardBlobSequence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One blob (e.g, image, graph) viewable on a blob metric plot. - # @!attribute [r] id - # @return [::String] - # Output only. A URI safe key uniquely identifying a blob. Can be used to - # locate the blob stored in the Cloud Storage bucket of the consumer project. - # @!attribute [rw] data - # @return [::String] - # Optional. The bytes of the blob is not present unless it's returned by the - # ReadTensorboardBlobData endpoint. - class TensorboardBlob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb deleted file mode 100644 index aba10508d49e..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # A TensorboardExperiment is a group of TensorboardRuns, that are typically the - # results of a training job run, in a Tensorboard. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the TensorboardExperiment. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # @!attribute [rw] display_name - # @return [::String] - # User provided name of this TensorboardExperiment. - # @!attribute [rw] description - # @return [::String] - # Description of this TensorboardExperiment. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardExperiment was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardExperiment was last updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels with user-defined metadata to organize your - # TensorboardExperiment. - # - # Label keys and values cannot be longer than 64 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # No more than 64 user labels can be associated with one Dataset (System - # labels are excluded). - # - # See https://goo.gl/xmQnxf for more information and examples of labels. - # System reserved label keys are prefixed with `aiplatform.googleapis.com/` - # and are immutable. The following system labels exist for each Dataset: - # - # * `aiplatform.googleapis.com/dataset_metadata_schema`: output only. Its - # value is the - # [metadata_schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] - # title. - # @!attribute [rw] etag - # @return [::String] - # Used to perform consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - # @!attribute [rw] source - # @return [::String] - # Immutable. Source of the TensorboardExperiment. Example: a custom training - # job. - class TensorboardExperiment - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb deleted file mode 100644 index 14e47fdb129b..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_run.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # TensorboardRun maps to a specific execution of a training job with a given - # set of hyperparameter values, model definition, dataset, etc - # @!attribute [r] name - # @return [::String] - # Output only. Name of the TensorboardRun. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - # @!attribute [rw] display_name - # @return [::String] - # Required. User provided name of this TensorboardRun. - # This value must be unique among all TensorboardRuns - # belonging to the same parent TensorboardExperiment. - # @!attribute [rw] description - # @return [::String] - # Description of this TensorboardRun. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardRun was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardRun was last updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels with user-defined metadata to organize your TensorboardRuns. - # - # This field will be used to filter and visualize Runs in the Tensorboard UI. - # For example, a Vertex AI training job can set a label - # aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created - # within that job. An end user can set a label experiment_id=xxxxx for all - # the runs produced in a Jupyter notebook. These runs can be grouped by a - # label value and visualized together in the Tensorboard UI. - # - # 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. - # No more than 64 user labels can be associated with one TensorboardRun - # (System labels are excluded). - # - # See https://goo.gl/xmQnxf for more information and examples of labels. - # System reserved label keys are prefixed with "aiplatform.googleapis.com/" - # and are immutable. - # @!attribute [rw] etag - # @return [::String] - # Used to perform a consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - class TensorboardRun - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb deleted file mode 100644 index c23393614662..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb +++ /dev/null @@ -1,825 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard TensorboardService.CreateTensorboard}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the Location to create the Tensorboard in. - # Format: `projects/{project}/locations/{location}` - # @!attribute [rw] tensorboard - # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] - # Required. The Tensorboard to create. - class CreateTensorboardRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard TensorboardService.GetTensorboard}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Tensorboard resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - class GetTensorboardRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the Location to list Tensorboards. - # Format: - # `projects/{project}/locations/{location}` - # @!attribute [rw] filter - # @return [::String] - # Lists the Tensorboards that match the filter expression. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of Tensorboards to return. The service may return - # fewer than this value. If unspecified, at most 100 Tensorboards are - # returned. The maximum value is 100; values above 100 are coerced to - # 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards} - # must match the call that provided the page token. - # @!attribute [rw] order_by - # @return [::String] - # Field to use to sort the list. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Mask specifying which fields to read. - class ListTensorboardsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards TensorboardService.ListTensorboards}. - # @!attribute [rw] tensorboards - # @return [::Array<::Google::Cloud::AIPlatform::V1::Tensorboard>] - # The Tensorboards mathching the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::AIPlatform::V1::ListTensorboardsRequest#page_token ListTensorboardsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListTensorboardsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard TensorboardService.UpdateTensorboard}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Tensorboard resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field is overwritten if it's in the mask. If the - # user does not provide a mask then all fields are overwritten if new - # values are specified. - # @!attribute [rw] tensorboard - # @return [::Google::Cloud::AIPlatform::V1::Tensorboard] - # Required. The Tensorboard's `name` field is used to identify the - # Tensorboard to be updated. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - class UpdateTensorboardRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard TensorboardService.DeleteTensorboard}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Tensorboard to be deleted. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - class DeleteTensorboardRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_usage TensorboardService.ReadTensorboardUsage}. - # @!attribute [rw] tensorboard - # @return [::String] - # Required. The name of the Tensorboard resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - class ReadTensorboardUsageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_usage TensorboardService.ReadTensorboardUsage}. - # @!attribute [rw] monthly_usage_data - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerMonthUsageData}] - # Maps year-month (YYYYMM) string to per month usage data. - class ReadTensorboardUsageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Per user usage data. - # @!attribute [rw] username - # @return [::String] - # User's username - # @!attribute [rw] view_count - # @return [::Integer] - # Number of times the user has read data within the Tensorboard. - class PerUserUsageData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Per month usage data - # @!attribute [rw] user_usage_data - # @return [::Array<::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerUserUsageData>] - # Usage data for each user in the given month. - class PerMonthUsageData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::AIPlatform::V1::ReadTensorboardUsageResponse::PerMonthUsageData] - class MonthlyUsageDataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_size TensorboardService.ReadTensorboardSize}. - # @!attribute [rw] tensorboard - # @return [::String] - # Required. The name of the Tensorboard resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - class ReadTensorboardSizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_size TensorboardService.ReadTensorboardSize}. - # @!attribute [rw] storage_size_byte - # @return [::Integer] - # Payload storage size for the TensorBoard - class ReadTensorboardSizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_experiment TensorboardService.CreateTensorboardExperiment}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the Tensorboard to create the - # TensorboardExperiment in. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - # @!attribute [rw] tensorboard_experiment - # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] - # The TensorboardExperiment to create. - # @!attribute [rw] tensorboard_experiment_id - # @return [::String] - # Required. The ID to use for the Tensorboard experiment, which becomes the - # final component of the Tensorboard experiment's resource name. - # - # This value should be 1-128 characters, and valid characters - # are `/[a-z][0-9]-/`. - class CreateTensorboardExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_experiment TensorboardService.GetTensorboardExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardExperiment resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - class GetTensorboardExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the Tensorboard to list - # TensorboardExperiments. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - # @!attribute [rw] filter - # @return [::String] - # Lists the TensorboardExperiments that match the filter expression. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of TensorboardExperiments to return. The service may - # return fewer than this value. If unspecified, at most 50 - # TensorboardExperiments are returned. The maximum value is 1000; values - # above 1000 are coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments} - # must match the call that provided the page token. - # @!attribute [rw] order_by - # @return [::String] - # Field to use to sort the list. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Mask specifying which fields to read. - class ListTensorboardExperimentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments TensorboardService.ListTensorboardExperiments}. - # @!attribute [rw] tensorboard_experiments - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardExperiment>] - # The TensorboardExperiments mathching the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest#page_token ListTensorboardExperimentsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListTensorboardExperimentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_experiment TensorboardService.UpdateTensorboardExperiment}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # TensorboardExperiment resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field is overwritten if it's in the mask. If the - # user does not provide a mask then all fields are overwritten if new - # values are specified. - # @!attribute [rw] tensorboard_experiment - # @return [::Google::Cloud::AIPlatform::V1::TensorboardExperiment] - # Required. The TensorboardExperiment's `name` field is used to identify the - # TensorboardExperiment to be updated. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - class UpdateTensorboardExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_experiment TensorboardService.DeleteTensorboardExperiment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardExperiment to be deleted. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - class DeleteTensorboardExperimentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_runs TensorboardService.BatchCreateTensorboardRuns}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardExperiment to create the - # TensorboardRuns in. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # The parent field in the CreateTensorboardRunRequest messages must match - # this field. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest>] - # Required. The request message specifying the TensorboardRuns to create. - # A maximum of 1000 TensorboardRuns can be created in a batch. - class BatchCreateTensorboardRunsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_runs TensorboardService.BatchCreateTensorboardRuns}. - # @!attribute [rw] tensorboard_runs - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardRun>] - # The created TensorboardRuns. - class BatchCreateTensorboardRunsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_run TensorboardService.CreateTensorboardRun}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardExperiment to create the - # TensorboardRun in. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # @!attribute [rw] tensorboard_run - # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] - # Required. The TensorboardRun to create. - # @!attribute [rw] tensorboard_run_id - # @return [::String] - # Required. The ID to use for the Tensorboard run, which becomes the final - # component of the Tensorboard run's resource name. - # - # This value should be 1-128 characters, and valid characters - # are `/[a-z][0-9]-/`. - class CreateTensorboardRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_run TensorboardService.GetTensorboardRun}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardRun resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - class GetTensorboardRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_blob_data TensorboardService.ReadTensorboardBlobData}. - # @!attribute [rw] time_series - # @return [::String] - # Required. The resource name of the TensorboardTimeSeries to list Blobs. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - # @!attribute [rw] blob_ids - # @return [::Array<::String>] - # IDs of the blobs to read. - class ReadTensorboardBlobDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_blob_data TensorboardService.ReadTensorboardBlobData}. - # @!attribute [rw] blobs - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardBlob>] - # Blob messages containing blob bytes. - class ReadTensorboardBlobDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardExperiment to list - # TensorboardRuns. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # @!attribute [rw] filter - # @return [::String] - # Lists the TensorboardRuns that match the filter expression. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of TensorboardRuns to return. The service may return - # fewer than this value. If unspecified, at most 50 TensorboardRuns are - # returned. The maximum value is 1000; values above 1000 are coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns} - # must match the call that provided the page token. - # @!attribute [rw] order_by - # @return [::String] - # Field to use to sort the list. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Mask specifying which fields to read. - class ListTensorboardRunsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs TensorboardService.ListTensorboardRuns}. - # @!attribute [rw] tensorboard_runs - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardRun>] - # The TensorboardRuns mathching the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest#page_token ListTensorboardRunsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListTensorboardRunsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_run TensorboardService.UpdateTensorboardRun}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # TensorboardRun resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field is overwritten if it's in the mask. If the - # user does not provide a mask then all fields are overwritten if new - # values are specified. - # @!attribute [rw] tensorboard_run - # @return [::Google::Cloud::AIPlatform::V1::TensorboardRun] - # Required. The TensorboardRun's `name` field is used to identify the - # TensorboardRun to be updated. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - class UpdateTensorboardRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_run TensorboardService.DeleteTensorboardRun}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardRun to be deleted. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - class DeleteTensorboardRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_time_series TensorboardService.BatchCreateTensorboardTimeSeries}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardExperiment to create the - # TensorboardTimeSeries in. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # The TensorboardRuns referenced by the parent fields in the - # CreateTensorboardTimeSeriesRequest messages must be sub resources of this - # TensorboardExperiment. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest>] - # Required. The request message specifying the TensorboardTimeSeries to - # create. A maximum of 1000 TensorboardTimeSeries can be created in a batch. - class BatchCreateTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_time_series TensorboardService.BatchCreateTensorboardTimeSeries}. - # @!attribute [rw] tensorboard_time_series - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] - # The created TensorboardTimeSeries. - class BatchCreateTensorboardTimeSeriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_time_series TensorboardService.CreateTensorboardTimeSeries}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardRun to create the - # TensorboardTimeSeries in. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - # @!attribute [rw] tensorboard_time_series_id - # @return [::String] - # Optional. The user specified unique ID to use for the - # TensorboardTimeSeries, which becomes the final component of the - # TensorboardTimeSeries's resource name. This value should match - # "[a-z0-9][a-z0-9-]\\{0, 127}" - # @!attribute [rw] tensorboard_time_series - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] - # Required. The TensorboardTimeSeries to create. - class CreateTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_time_series TensorboardService.GetTensorboardTimeSeries}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardTimeSeries resource. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - class GetTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TensorboardRun to list - # TensorboardTimeSeries. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - # @!attribute [rw] filter - # @return [::String] - # Lists the TensorboardTimeSeries that match the filter expression. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of TensorboardTimeSeries to return. The service may - # return fewer than this value. If unspecified, at most 50 - # TensorboardTimeSeries are returned. The maximum value is 1000; values - # above 1000 are coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries} - # must match the call that provided the page token. - # @!attribute [rw] order_by - # @return [::String] - # Field to use to sort the list. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Mask specifying which fields to read. - class ListTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series TensorboardService.ListTensorboardTimeSeries}. - # @!attribute [rw] tensorboard_time_series - # @return [::Array<::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries>] - # The TensorboardTimeSeries mathching the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest#page_token ListTensorboardTimeSeriesRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListTensorboardTimeSeriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_time_series TensorboardService.UpdateTensorboardTimeSeries}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # TensorboardTimeSeries resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field is overwritten if it's in the mask. If the - # user does not provide a mask then all fields are overwritten if new - # values are specified. - # @!attribute [rw] tensorboard_time_series - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries] - # Required. The TensorboardTimeSeries' `name` field is used to identify the - # TensorboardTimeSeries to be updated. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - class UpdateTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_time_series TensorboardService.DeleteTensorboardTimeSeries}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TensorboardTimeSeries to be deleted. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - class DeleteTensorboardTimeSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_read_tensorboard_time_series_data TensorboardService.BatchReadTensorboardTimeSeriesData}. - # @!attribute [rw] tensorboard - # @return [::String] - # Required. The resource name of the Tensorboard containing - # TensorboardTimeSeries to read data from. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - # The TensorboardTimeSeries referenced by - # {::Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest#time_series time_series} - # must be sub resources of this Tensorboard. - # @!attribute [rw] time_series - # @return [::Array<::String>] - # Required. The resource names of the TensorboardTimeSeries to read data - # from. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - class BatchReadTensorboardTimeSeriesDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_read_tensorboard_time_series_data TensorboardService.BatchReadTensorboardTimeSeriesData}. - # @!attribute [rw] time_series_data - # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData>] - # The returned time series data. - class BatchReadTensorboardTimeSeriesDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_time_series_data TensorboardService.ReadTensorboardTimeSeriesData}. - # @!attribute [rw] tensorboard_time_series - # @return [::String] - # Required. The resource name of the TensorboardTimeSeries to read data from. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - # @!attribute [rw] max_data_points - # @return [::Integer] - # The maximum number of TensorboardTimeSeries' data to return. - # - # This value should be a positive integer. - # This value can be set to -1 to return all data. - # @!attribute [rw] filter - # @return [::String] - # Reads the TensorboardTimeSeries' data that match the filter expression. - class ReadTensorboardTimeSeriesDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_time_series_data TensorboardService.ReadTensorboardTimeSeriesData}. - # @!attribute [rw] time_series_data - # @return [::Google::Cloud::AIPlatform::V1::TimeSeriesData] - # The returned time series data. - class ReadTensorboardTimeSeriesDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_experiment_data TensorboardService.WriteTensorboardExperimentData}. - # @!attribute [rw] tensorboard_experiment - # @return [::String] - # Required. The resource name of the TensorboardExperiment to write data to. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - # @!attribute [rw] write_run_data_requests - # @return [::Array<::Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest>] - # Required. Requests containing per-run TensorboardTimeSeries data to write. - class WriteTensorboardExperimentDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_experiment_data TensorboardService.WriteTensorboardExperimentData}. - class WriteTensorboardExperimentDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_run_data TensorboardService.WriteTensorboardRunData}. - # @!attribute [rw] tensorboard_run - # @return [::String] - # Required. The resource name of the TensorboardRun to write data to. - # Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - # @!attribute [rw] time_series_data - # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesData>] - # Required. The TensorboardTimeSeries data to write. - # Values with in a time series are indexed by their step value. - # Repeated writes to the same step will overwrite the existing value for that - # step. - # The upper limit of data points per write request is 5000. - class WriteTensorboardRunDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_run_data TensorboardService.WriteTensorboardRunData}. - class WriteTensorboardRunDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data TensorboardService.ExportTensorboardTimeSeriesData}. - # @!attribute [rw] tensorboard_time_series - # @return [::String] - # Required. The resource name of the TensorboardTimeSeries to export data - # from. Format: - # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - # @!attribute [rw] filter - # @return [::String] - # Exports the TensorboardTimeSeries' data that match the filter expression. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of data points to return per page. - # The default page_size is 1000. Values must be between 1 and 10000. - # Values above 10000 are coerced to 10000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data ExportTensorboardTimeSeriesData} - # must match the call that provided the page token. - # @!attribute [rw] order_by - # @return [::String] - # Field to use to sort the TensorboardTimeSeries' data. - # By default, TensorboardTimeSeries' data is returned in a pseudo random - # order. - class ExportTensorboardTimeSeriesDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data TensorboardService.ExportTensorboardTimeSeriesData}. - # @!attribute [rw] time_series_data_points - # @return [::Array<::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint>] - # The returned time series data points. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest#page_token page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ExportTensorboardTimeSeriesDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of operations that perform create Tensorboard. - # @!attribute [rw] generic_metadata - # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] - # Operation metadata for Tensorboard. - class CreateTensorboardOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of operations that perform update Tensorboard. - # @!attribute [rw] generic_metadata - # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] - # Operation metadata for Tensorboard. - class UpdateTensorboardOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb deleted file mode 100644 index 3eab80f429bd..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_time_series.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # TensorboardTimeSeries maps to times series produced in training runs - # @!attribute [r] name - # @return [::String] - # Output only. Name of the TensorboardTimeSeries. - # @!attribute [rw] display_name - # @return [::String] - # Required. User provided name of this TensorboardTimeSeries. - # This value should be unique among all TensorboardTimeSeries resources - # belonging to the same TensorboardRun resource (parent resource). - # @!attribute [rw] description - # @return [::String] - # Description of this TensorboardTimeSeries. - # @!attribute [rw] value_type - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::ValueType] - # Required. Immutable. Type of TensorboardTimeSeries value. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardTimeSeries was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this TensorboardTimeSeries was last updated. - # @!attribute [rw] etag - # @return [::String] - # Used to perform a consistent read-modify-write updates. If not set, a blind - # "overwrite" update happens. - # @!attribute [rw] plugin_name - # @return [::String] - # Immutable. Name of the plugin this time series pertain to. Such as Scalar, - # Tensor, Blob - # @!attribute [rw] plugin_data - # @return [::String] - # Data of the current plugin, with the size limited to 65KB. - # @!attribute [r] metadata - # @return [::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries::Metadata] - # Output only. Scalar, Tensor, or Blob metadata for this - # TensorboardTimeSeries. - class TensorboardTimeSeries - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes metadata for a TensorboardTimeSeries. - # @!attribute [r] max_step - # @return [::Integer] - # Output only. Max step index of all data points within a - # TensorboardTimeSeries. - # @!attribute [r] max_wall_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Max wall clock timestamp of all data points within a - # TensorboardTimeSeries. - # @!attribute [r] max_blob_sequence_length - # @return [::Integer] - # Output only. The largest blob sequence length (number of blobs) of all - # data points in this time series, if its ValueType is BLOB_SEQUENCE. - class Metadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An enum representing the value type of a TensorboardTimeSeries. - module ValueType - # The value type is unspecified. - VALUE_TYPE_UNSPECIFIED = 0 - - # Used for TensorboardTimeSeries that is a list of scalars. - # E.g. accuracy of a model over epochs/time. - SCALAR = 1 - - # Used for TensorboardTimeSeries that is a list of tensors. - # E.g. histograms of weights of layer in a model over epoch/time. - TENSOR = 2 - - # Used for TensorboardTimeSeries that is a list of blob sequences. - # E.g. set of sample images with labels over epochs/time. - BLOB_SEQUENCE = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb deleted file mode 100644 index f7a6134c7749..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tool.rb +++ /dev/null @@ -1,320 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # Tool details that the model may use to generate response. - # - # A `Tool` is a piece of code that enables the system to interact with - # external systems to perform an action, or set of actions, outside of - # knowledge and scope of the model. A Tool object should contain exactly - # one type of Tool (e.g FunctionDeclaration, Retrieval or - # GoogleSearchRetrieval). - # @!attribute [rw] function_declarations - # @return [::Array<::Google::Cloud::AIPlatform::V1::FunctionDeclaration>] - # Optional. Function tool type. - # One or more function declarations to be passed to the model along with the - # current user query. Model may decide to call a subset of these functions - # by populating [FunctionCall][content.part.function_call] in the response. - # User should provide a [FunctionResponse][content.part.function_response] - # for each function call in the next turn. Based on the function responses, - # Model will generate the final response back to the user. - # Maximum 128 function declarations can be provided. - # @!attribute [rw] retrieval - # @return [::Google::Cloud::AIPlatform::V1::Retrieval] - # Optional. Retrieval tool type. - # System will always execute the provided retrieval tool(s) to get external - # knowledge to answer the prompt. Retrieval results are presented to the - # model for generation. - # @!attribute [rw] google_search_retrieval - # @return [::Google::Cloud::AIPlatform::V1::GoogleSearchRetrieval] - # Optional. GoogleSearchRetrieval tool type. - # Specialized retrieval tool that is powered by Google search. - class Tool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Structured representation of a function declaration as defined by the - # [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included - # in this declaration are the function name, description, parameters and - # response type. This FunctionDeclaration is a representation of a block of - # code that can be used as a `Tool` by the model and executed by the client. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the function to call. - # Must start with a letter or an underscore. - # Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a - # maximum length of 64. - # @!attribute [rw] description - # @return [::String] - # Optional. Description and purpose of the function. - # Model uses it to decide how and whether to call the function. - # @!attribute [rw] parameters - # @return [::Google::Cloud::AIPlatform::V1::Schema] - # Optional. Describes the parameters to this function in JSON Schema Object - # format. Reflects the Open API 3.03 Parameter Object. string Key: the name - # of the parameter. Parameter names are case sensitive. Schema Value: the - # Schema defining the type used for the parameter. For function with no - # parameters, this can be left unset. Parameter names must start with a - # letter or an underscore and must only contain chars a-z, A-Z, 0-9, or - # underscores with a maximum length of 64. Example with 1 required and 1 - # optional parameter: type: OBJECT properties: - # param1: - # type: STRING - # param2: - # type: INTEGER - # required: - # - param1 - # @!attribute [rw] response - # @return [::Google::Cloud::AIPlatform::V1::Schema] - # Optional. Describes the output from this function in JSON Schema format. - # Reflects the Open API 3.03 Response Object. The Schema defines the type - # used for the response value of the function. - class FunctionDeclaration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A predicted [FunctionCall] returned from the model that contains a string - # representing the [FunctionDeclaration.name] and a structured JSON object - # containing the parameters and their values. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the function to call. - # Matches [FunctionDeclaration.name]. - # @!attribute [rw] args - # @return [::Google::Protobuf::Struct] - # Optional. Required. The function parameters and values in JSON object - # format. See [FunctionDeclaration.parameters] for parameter details. - class FunctionCall - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result output from a [FunctionCall] that contains a string representing - # the [FunctionDeclaration.name] and a structured JSON object containing any - # output from the function is used as context to the model. This should contain - # the result of a [FunctionCall] made based on model prediction. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the function to call. - # Matches [FunctionDeclaration.name] and [FunctionCall.name]. - # @!attribute [rw] response - # @return [::Google::Protobuf::Struct] - # Required. The function response in JSON object format. - # Use "output" key to specify function output and "error" key to specify - # error details (if any). If "output" and "error" keys are not specified, - # then whole "response" is treated as function output. - class FunctionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines a retrieval tool that model can call to access external knowledge. - # @!attribute [rw] vertex_ai_search - # @return [::Google::Cloud::AIPlatform::V1::VertexAISearch] - # Set to use data source powered by Vertex AI Search. - # @!attribute [rw] vertex_rag_store - # @return [::Google::Cloud::AIPlatform::V1::VertexRagStore] - # Set to use data source powered by Vertex RAG store. - # User data is uploaded via the VertexRagDataService. - # @!attribute [rw] disable_attribution - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Deprecated. This option is no longer supported. - class Retrieval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retrieve from Vertex RAG Store for grounding. - # @!attribute [rw] rag_resources - # @return [::Array<::Google::Cloud::AIPlatform::V1::VertexRagStore::RagResource>] - # Optional. The representation of the rag source. It can be used to specify - # corpus only or ragfiles. Currently only support one corpus or multiple - # files from one corpus. In the future we may open up multiple corpora - # support. - # @!attribute [rw] similarity_top_k - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Optional. Number of top k results to return from the selected corpora. - # @!attribute [rw] vector_distance_threshold - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Float] - # Optional. Only return results with vector distance smaller than the - # threshold. - # @!attribute [rw] rag_retrieval_config - # @return [::Google::Cloud::AIPlatform::V1::RagRetrievalConfig] - # Optional. The retrieval config for the Rag query. - class VertexRagStore - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The definition of the Rag resource. - # @!attribute [rw] rag_corpus - # @return [::String] - # Optional. RagCorpora resource name. - # Format: - # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` - # @!attribute [rw] rag_file_ids - # @return [::Array<::String>] - # Optional. rag_file_id. The files should be in the same rag_corpus set in - # rag_corpus field. - class RagResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Retrieve from Vertex AI Search datastore for grounding. - # See https://cloud.google.com/products/agent-builder - # @!attribute [rw] datastore - # @return [::String] - # Required. Fully-qualified Vertex AI Search data store resource ID. - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` - class VertexAISearch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Tool to retrieve public web data for grounding, powered by Google. - # @!attribute [rw] dynamic_retrieval_config - # @return [::Google::Cloud::AIPlatform::V1::DynamicRetrievalConfig] - # Specifies the dynamic retrieval configuration for the given source. - class GoogleSearchRetrieval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the options to customize dynamic retrieval. - # @!attribute [rw] mode - # @return [::Google::Cloud::AIPlatform::V1::DynamicRetrievalConfig::Mode] - # The mode of the predictor to be used in dynamic retrieval. - # @!attribute [rw] dynamic_threshold - # @return [::Float] - # Optional. The threshold to be used in dynamic retrieval. - # If not set, a system default value is used. - class DynamicRetrievalConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mode of the predictor to be used in dynamic retrieval. - module Mode - # Always trigger retrieval. - MODE_UNSPECIFIED = 0 - - # Run retrieval only when system decides it is necessary. - MODE_DYNAMIC = 1 - end - end - - # Tool config. This config is shared for all tools provided in the request. - # @!attribute [rw] function_calling_config - # @return [::Google::Cloud::AIPlatform::V1::FunctionCallingConfig] - # Optional. Function calling config. - # @!attribute [rw] retrieval_config - # @return [::Google::Cloud::AIPlatform::V1::RetrievalConfig] - # Optional. Retrieval config. - class ToolConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Function calling config. - # @!attribute [rw] mode - # @return [::Google::Cloud::AIPlatform::V1::FunctionCallingConfig::Mode] - # Optional. Function calling mode. - # @!attribute [rw] allowed_function_names - # @return [::Array<::String>] - # Optional. Function names to call. Only set when the Mode is ANY. Function - # names should match [FunctionDeclaration.name]. With mode set to ANY, model - # will predict a function call from the set of function names provided. - class FunctionCallingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Function calling mode. - module Mode - # Unspecified function calling mode. This value should not be used. - MODE_UNSPECIFIED = 0 - - # Default model behavior, model decides to predict either a function call - # or a natural language response. - AUTO = 1 - - # Model is constrained to always predicting a function call only. - # If "allowed_function_names" are set, the predicted function call will be - # limited to any one of "allowed_function_names", else the predicted - # function call will be any one of the provided "function_declarations". - ANY = 2 - - # Model will not predict any function call. Model behavior is same as when - # not passing any function declarations. - NONE = 3 - end - end - - # Retrieval config. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # The location of the user. - # @!attribute [rw] language_code - # @return [::String] - # The language code of the user. - class RetrievalConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the context retrieval config. - # @!attribute [rw] top_k - # @return [::Integer] - # Optional. The number of contexts to retrieve. - # @!attribute [rw] filter - # @return [::Google::Cloud::AIPlatform::V1::RagRetrievalConfig::Filter] - # Optional. Config for filters. - class RagRetrievalConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Config for filters. - # @!attribute [rw] vector_distance_threshold - # @return [::Float] - # Optional. Only returns contexts with vector distance smaller than the - # threshold. - # @!attribute [rw] vector_similarity_threshold - # @return [::Float] - # Optional. Only returns contexts with vector similarity larger than the - # threshold. - # @!attribute [rw] metadata_filter - # @return [::String] - # Optional. String for metadata filtering. - class Filter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb b/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb deleted file mode 100644 index 770872b8e9ba..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb +++ /dev/null @@ -1,434 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AIPlatform - module V1 - # The TrainingPipeline orchestrates tasks associated with training a Model. It - # always executes the training task, and optionally may also - # export data from Vertex AI's Dataset which becomes the training input, - # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model upload} the Model to - # Vertex AI, and evaluate the Model. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name of the TrainingPipeline. - # @!attribute [rw] display_name - # @return [::String] - # Required. The user-defined name of this TrainingPipeline. - # @!attribute [rw] input_data_config - # @return [::Google::Cloud::AIPlatform::V1::InputDataConfig] - # Specifies Vertex AI owned input data that may be used for training the - # Model. The TrainingPipeline's - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} - # should make clear whether this config is used and if there are any special - # requirements on how it should be filled. If nothing about this config is - # mentioned in the - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}, - # then it should be assumed that the TrainingPipeline does not depend on this - # configuration. - # @!attribute [rw] training_task_definition - # @return [::String] - # Required. A Google Cloud Storage path to the YAML file that defines the - # training task which is responsible for producing the model artifact, and - # may also include additional auxiliary work. The definition files that can - # be used here are found in - # gs://google-cloud-aiplatform/schema/trainingjob/definition/. - # Note: The URI given on output will be immutable and probably different, - # including the URI scheme, than the one given on input. The output URI will - # point to a location where the user only has a read access. - # @!attribute [rw] training_task_inputs - # @return [::Google::Protobuf::Value] - # Required. The training task's parameter(s), as specified in the - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}'s - # `inputs`. - # @!attribute [r] training_task_metadata - # @return [::Google::Protobuf::Value] - # Output only. The metadata information as specified in the - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}'s - # `metadata`. This metadata is an auxiliary runtime and final information - # about the training task. While the pipeline is running this information is - # populated only at a best effort basis. Only present if the - # pipeline's - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} - # contains `metadata` object. - # @!attribute [rw] model_to_upload - # @return [::Google::Cloud::AIPlatform::V1::Model] - # Describes the Model that may be uploaded (via - # {::Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model ModelService.UploadModel}) - # by this TrainingPipeline. The TrainingPipeline's - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition} - # should make clear whether this Model description should be populated, and - # if there are any special requirements regarding how it should be filled. If - # nothing is mentioned in the - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#training_task_definition training_task_definition}, - # then it should be assumed that this field should not be filled and the - # training task either uploads the Model without a need of this information, - # or that training task does not support uploading a Model as part of the - # pipeline. When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and - # the trained Model had been uploaded into Vertex AI, then the - # model_to_upload's resource {::Google::Cloud::AIPlatform::V1::Model#name name} is - # populated. The Model is always uploaded into the Project and Location in - # which this pipeline is. - # @!attribute [rw] model_id - # @return [::String] - # Optional. The ID to use for the uploaded Model, which will become the final - # component of the model resource name. - # - # This value may be up to 63 characters, and valid characters are - # `[a-z0-9_-]`. The first character cannot be a number or hyphen. - # @!attribute [rw] parent_model - # @return [::String] - # Optional. When specify this field, the `model_to_upload` will not be - # uploaded as a new model, instead, it will become a new version of this - # `parent_model`. - # @!attribute [r] state - # @return [::Google::Cloud::AIPlatform::V1::PipelineState] - # Output only. The detailed state of the pipeline. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Only populated when the pipeline's state is - # `PIPELINE_STATE_FAILED` or `PIPELINE_STATE_CANCELLED`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the TrainingPipeline was created. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the TrainingPipeline for the first time entered the - # `PIPELINE_STATE_RUNNING` state. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the TrainingPipeline entered any of the following - # states: `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, - # `PIPELINE_STATE_CANCELLED`. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the TrainingPipeline was most recently updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels with user-defined metadata to organize TrainingPipelines. - # - # 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] encryption_spec - # @return [::Google::Cloud::AIPlatform::V1::EncryptionSpec] - # Customer-managed encryption key spec for a TrainingPipeline. If set, this - # TrainingPipeline will be secured by this key. - # - # Note: Model trained by this TrainingPipeline is also secured by this key if - # {::Google::Cloud::AIPlatform::V1::TrainingPipeline#encryption_spec model_to_upload} - # is not set separately. - class TrainingPipeline - 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 - - # Specifies Vertex AI owned input data to be used for training, and - # possibly evaluating, the Model. - # @!attribute [rw] fraction_split - # @return [::Google::Cloud::AIPlatform::V1::FractionSplit] - # Split based on fractions defining the size of each set. - # @!attribute [rw] filter_split - # @return [::Google::Cloud::AIPlatform::V1::FilterSplit] - # Split based on the provided filters for each set. - # @!attribute [rw] predefined_split - # @return [::Google::Cloud::AIPlatform::V1::PredefinedSplit] - # Supported only for tabular Datasets. - # - # Split based on a predefined key. - # @!attribute [rw] timestamp_split - # @return [::Google::Cloud::AIPlatform::V1::TimestampSplit] - # Supported only for tabular Datasets. - # - # Split based on the timestamp of the input data pieces. - # @!attribute [rw] stratified_split - # @return [::Google::Cloud::AIPlatform::V1::StratifiedSplit] - # Supported only for tabular Datasets. - # - # Split based on the distribution of the specified column. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AIPlatform::V1::GcsDestination] - # The Cloud Storage location where the training data is to be - # written to. In the given directory a new directory is created with - # name: - # `dataset---` - # where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. - # All training input data is written into that directory. - # - # The Vertex AI environment variables representing Cloud Storage - # data URIs are represented in the Cloud Storage wildcard - # format to support sharded data. e.g.: "gs://.../training-*.jsonl" - # - # * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data - # * AIP_TRAINING_DATA_URI = - # "gcs_destination/dataset---